added changing brightness
This commit is contained in:
parent
1ca1a17cec
commit
895c11e4f7
4 changed files with 10 additions and 7 deletions
|
|
@ -90,6 +90,7 @@
|
|||
blahaj
|
||||
];
|
||||
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
|
|
|
|||
3
home.nix
3
home.nix
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
# Cursor
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
sway.enable = true;
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Classic";
|
||||
size = 24;
|
||||
|
|
@ -23,6 +21,7 @@
|
|||
audacity
|
||||
beluga
|
||||
bitwarden
|
||||
brightnessctl
|
||||
gimp
|
||||
godot
|
||||
hledger
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
bright=`cat /sys/class/backlight/amdgpu_bl1/brightness`
|
||||
bright=$(brightnessctl get)
|
||||
state=-1
|
||||
thresh=(1 2 3 4 5 6 8 10 13 16 21 27 34 44 57 73 94 120 155 199 255)
|
||||
thresh=(0 1 2 3 5 9 15 27 46 80 139 240 415 717 1240 2145 3710 6418 11100 19200)
|
||||
|
||||
for i in ${!thresh[@]}; do
|
||||
if [ $bright -ge ${thresh[$i]} ]
|
||||
|
|
@ -12,5 +12,5 @@ done
|
|||
new=$(($1 + $state))
|
||||
if [ $new -ge 0 ] && [ $new -le 20 ]
|
||||
then
|
||||
echo ${thresh[$new]} | tee /sys/class/backlight/amdgpu_bl1/brightness
|
||||
echo $(brightnessctl set ${thresh[$new]})
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ let
|
|||
mod = "Mod4";
|
||||
chvol = pkgs.writeShellScript "chvol"
|
||||
(builtins.readFile ./chvol.sh);
|
||||
chbright = pkgs.writeShellScript "chbrights"
|
||||
(builtins.readFile ./chbright.sh);
|
||||
|
||||
|
||||
in {
|
||||
wayland.windowManager.sway = {
|
||||
|
|
@ -28,8 +31,8 @@ in {
|
|||
XF86AudioMicMute = "exec bash ${chvol} source mute";
|
||||
|
||||
# brightness
|
||||
# XF86MonBrightnessUp = "exec bash ${chbright} 1";
|
||||
# XF86MonBrightnessDown = "exec bash ${chbright} -1";
|
||||
XF86MonBrightnessUp = "exec bash ${chbright} 1";
|
||||
XF86MonBrightnessDown = "exec bash ${chbright} -1";
|
||||
|
||||
# media
|
||||
XF86AudioPlay = "exec playerctl play-pause";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue