Add brightness control script and keybindings
This commit is contained in:
parent
492e1f1bc1
commit
f53c306504
2 changed files with 64 additions and 20 deletions
|
@ -27,10 +27,13 @@ let
|
||||||
launcher = "${pkgs.walker}/bin/walker --modules applications,ssh";
|
launcher = "${pkgs.walker}/bin/walker --modules applications,ssh";
|
||||||
pactl = lib.getExe' pkgs.pulseaudio "pactl";
|
pactl = lib.getExe' pkgs.pulseaudio "pactl";
|
||||||
terminal = exec (import ./scripts/terminal.nix { inherit pkgs; });
|
terminal = exec (import ./scripts/terminal.nix { inherit pkgs; });
|
||||||
|
brightness = exec (import ./scripts/brightness.nix { inherit pkgs; });
|
||||||
|
|
||||||
## Long ass keys ##
|
## Long ass keys ##
|
||||||
lowerVol = "XF86AudioLowerVolume";
|
lowerVol = "XF86AudioLowerVolume";
|
||||||
raiseVol = "XF86AudioRaiseVolume";
|
raiseVol = "XF86AudioRaiseVolume";
|
||||||
|
brightUp = "XF86MonBrightnessUp";
|
||||||
|
brightDown = "XF86MonBrightnessDown";
|
||||||
|
|
||||||
## Keybinds & Submaps ##
|
## Keybinds & Submaps ##
|
||||||
|
|
||||||
|
@ -64,9 +67,12 @@ let
|
||||||
# "SUPER, L, exec, ${lockscreen}"
|
# "SUPER, L, exec, ${lockscreen}"
|
||||||
"SUPER, Q, killactive,"
|
"SUPER, Q, killactive,"
|
||||||
"CTRL_ALT, Delete, exit,"
|
"CTRL_ALT, Delete, exit,"
|
||||||
|
", ${brightUp}, exec, ${brightness} + 10"
|
||||||
|
", ${brightDown}, exec, ${brightness} - 10"
|
||||||
|
|
||||||
## Window Management ##
|
## Window Management ##
|
||||||
"SUPER_SHIFT, F, fullscreen, 0"
|
"SUPER_SHIFT, F, fullscreen, 0"
|
||||||
|
"SUPER_ALT, F, fullscreenstate, 0 3"
|
||||||
# "SUPER, F, exec, ${notify} 'Fullscreen Mode'"
|
# "SUPER, F, exec, ${notify} 'Fullscreen Mode'"
|
||||||
"SUPER, Backspace, togglefloating,"
|
"SUPER, Backspace, togglefloating,"
|
||||||
"SUPER, Backspace, centerwindow,"
|
"SUPER, Backspace, centerwindow,"
|
||||||
|
|
38
home/toph/common/optional/hyprland/scripts/brightness.nix
Normal file
38
home/toph/common/optional/hyprland/scripts/brightness.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
pkgs.writeScript "brightness-control" ''
|
||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
# brightness-control --up 10
|
||||||
|
# brightness-control + 10
|
||||||
|
# brightness-control --down 15
|
||||||
|
# brightness-control - 15
|
||||||
|
|
||||||
|
if test (count $argv) -ne 2
|
||||||
|
echo "Usage: $argv[0] [--up|+|--down|-] <INTEGER>"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set option $argv[1]
|
||||||
|
set value $argv[2]
|
||||||
|
|
||||||
|
if test "$option" = "--up" -o "$option" = "+"
|
||||||
|
set op "+"
|
||||||
|
else if test "$option" = "--down" -o "$option" = "-"
|
||||||
|
set op "-"
|
||||||
|
else
|
||||||
|
echo "Invalid option. Use --up | + or --down | -"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
# Hardcoded bus numbers from ddcutil detect. Adjust if necessary.
|
||||||
|
set buses 10 11
|
||||||
|
|
||||||
|
for bus in $buses
|
||||||
|
echo "Changing brightness on bus $bus: ddcutil setvcp 10 $op $value --bus $bus"
|
||||||
|
ddcutil setvcp 10 $op $value --bus $bus
|
||||||
|
end
|
||||||
|
''
|
Loading…
Add table
Reference in a new issue