Skip to content

Commit

Permalink
Added Completions and improved pkgbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Supernovatux committed Sep 6, 2022
1 parent 4830d6a commit 2e99e17
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/target
PKGBUILD
auto_backlight-*.*.*-x86_64.tar.gz
auto-backlight-*.*.*-x86_64.tar.gz
tar-helper.sh
*.out*
completions
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "auto_backlight"
version = "1.0.1"
version = "2.0.0"
edition = "2021"
authors = ["Supernovatux <[email protected]>"]
homepage = "https://github.com/Supernovatux/auto_backlight"
repository = "https://github.com/Supernovatux/auto_backlight"
description = "A tool to automatically change brightness based on screen contents"
keywords = ["brightness-control","rust","linux"]
license = "MIT"
include = ["LICENSE", "README.md"]
include = ["LICENSE", "README.md","completions/auto-backlight.fish"]
build = "build.rs"

[profile.release]
lto = "fat"
Expand All @@ -34,4 +35,13 @@ glob = "*"
ksni = "*"
fast_image_resize = "*"
futures = "*"
futures-timer = "*"
futures-timer = "*"

[build-dependencies]
clap = "*"
clap_complete = "*"
clap-verbosity-flag = "*"
log = "*"
[[bin]]
name = "auto-backlight"
path = "src/main.rs"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Git clone the repo and do a cargo build.
- Multimonitor support
- Make it cross platform.

## Features
- System tray


## Related

Here are some related projects
Expand Down
33 changes: 33 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use clap::*;
use clap_complete::{
generate_to,
shells::{Bash, Fish, Zsh},
};
use std::io::Error;

include!("src/cli_parser.rs");

fn main() -> Result<(), Error> {
let outdir = "completions";
let mut cmd = Cli::into_app();
generate_to(
Bash,
&mut cmd, // We need to specify what generator to use
"auto-backlight", // We need to specify the bin name manually
outdir, // We need to specify where to write to
)?;
generate_to(
Zsh,
&mut cmd, // We need to specify what generator to use
"auto-backlight", // We need to specify the bin name manually
outdir, // We need to specify where to write to
)?;
generate_to(
Fish,
&mut cmd, // We need to specify what generator to use
"auto-backlight", // We need to specify the bin name manually
outdir, // We need to specify where to write to
)?;

Ok(())
}
2 changes: 1 addition & 1 deletion src/brightness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl BrightnessDevices {
}
pub fn get_brightness(&self) -> i16 {
//As of now it averages out.
//Multi-monitor support is to be addeed
//Multi-monitor support is to be addeed
let sum: i16 = self
.devices
.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/sys_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ pub fn start_knsi(status: Arc<AtomicBool>, tx: oneshot::Sender<()>) -> ksni::Han
let ret = service.handle();
service.spawn();
ret
}
}

0 comments on commit 2e99e17

Please sign in to comment.