Brightness script fix/Not using XF86 keys in SXHKD
This commit is contained in:
parent
c061646f9b
commit
970806080d
3 changed files with 38 additions and 13 deletions
|
|
@ -113,6 +113,14 @@
|
|||
};
|
||||
|
||||
# Misc services
|
||||
services.udev = {
|
||||
# Allows member of the "video" group to change system backlight
|
||||
extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video %S%p/brightness", RUN+="${pkgs.coreutils}/bin/chmod g+w %S%p/brightness"
|
||||
'';
|
||||
path = [ pkgs.coreutils ]; # For chgrp
|
||||
};
|
||||
services.autorandr.enable = true;
|
||||
services.udisks2.enable = true; # USB Mounting
|
||||
# services.printing.enable = true; # CUPS
|
||||
|
||||
|
|
@ -155,11 +163,13 @@
|
|||
killall # Easy way to kill a process
|
||||
libnotify # Send messages to notification daemon
|
||||
libreoffice # MSOffice btfo
|
||||
maim # Screenshot utility
|
||||
neofetch # Aesthetic sysinfo
|
||||
pass-nodmenu # CLI password store (without dmenu dependency)
|
||||
picom # X Compositor
|
||||
pinentry-curses # Terminal-based pinentry program
|
||||
pinentry-rofi # Rofi frontend for pinentry program
|
||||
python311 # Python
|
||||
rofi # Menu prompt program
|
||||
rofi-pass # Rofi frontend for password store
|
||||
st # Suckless terminal
|
||||
|
|
@ -200,6 +210,7 @@
|
|||
perl536Packages.FileMimeInfo # Provides mimeopen, to ask what program to open files in
|
||||
poppler_utils # Provides pdftoppm, to turn pdfs into images
|
||||
ueberzugpp # Terminal image overlayer
|
||||
unrar-wrapper # Extract .rar files
|
||||
xclip # Copy file name to clip
|
||||
zathura # PDF viewer
|
||||
|
||||
|
|
@ -208,9 +219,10 @@
|
|||
xclip
|
||||
|
||||
# Silly programs
|
||||
sl # Choo choo
|
||||
asciiquarium # Good to throw on an extra monitor
|
||||
bsdgames # Fun collection of command-line games
|
||||
neo-cowsay # The cow says moo
|
||||
sl # Choo choo
|
||||
|
||||
# Some nix specific stuff
|
||||
nix-index
|
||||
|
|
@ -258,8 +270,6 @@
|
|||
nix-shell -p ${make-shell} --run "make $*"
|
||||
'')
|
||||
)
|
||||
|
||||
|
||||
];
|
||||
|
||||
#nixpkgs.overlays = [
|
||||
|
|
|
|||
|
|
@ -30,10 +30,16 @@ super + e
|
|||
# Implementing basic control hotkeys
|
||||
super + l
|
||||
xsecurelock
|
||||
super + Print
|
||||
dmenu -p "Screenshot filename:" < /dev/null | xargs -I "name" maim -s ~/name
|
||||
super + shift + Print
|
||||
dmenu -p "Screenshot filename:" < /dev/null | xargs -I "name" maim ~/name
|
||||
# Print
|
||||
F10
|
||||
rofi -dmenu -l 0 -p "Screenshot filename" < /dev/null | xargs -I "name" maim -s ~/name
|
||||
# shift + Print
|
||||
shift + F10
|
||||
rofi -dmenu -l 0 -p "Screenshot filename" < /dev/null | xargs -I "name" maim ~/name
|
||||
super + p
|
||||
rofi -dmenu -l 0 -p "Screenshot filename" < /dev/null | xargs -I "name" maim -s ~/name
|
||||
super + P
|
||||
rofi -dmenu -l 0 -p "Screenshot filename" < /dev/null | xargs -I "name" maim ~/name
|
||||
super + minus
|
||||
wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-; notify-send -r 44 "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||
super + shift + minus
|
||||
|
|
@ -42,8 +48,10 @@ super + equal
|
|||
wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; notify-send -r 44 "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||
super + shift + equal
|
||||
wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+; notify-send -r 44 "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||
XF86MonBrightnessUp
|
||||
# XF86MonBrightnessUp
|
||||
F7
|
||||
change-brightness up
|
||||
XF86MonBrightnessDown
|
||||
# XF86MonBrightnessDown
|
||||
F6
|
||||
change-brightness down
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,14 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
# Simple script to change the system backlight. Requires a udev rules that gives the user permission
|
||||
# to the backlight folder.
|
||||
# $ change-brightness up # Increases brightness
|
||||
# $ change-brightness down # Decreases brightness
|
||||
|
||||
max_brightness=`cat /sys/class/backlight/intel_backlight/max_brightness`
|
||||
brightness=`cat /sys/class/backlight/intel_backlight/brightness`
|
||||
kernel="$(ls /sys/class/backlight/ | head -n 1)"
|
||||
dir="/sys/class/backlight/$kernel"
|
||||
|
||||
max_brightness="$(cat $dir/max_brightness)"
|
||||
brightness="$(cat $dir/brightness)"
|
||||
increment=12000
|
||||
|
||||
if [ "$1" = "down" ]; then
|
||||
|
|
@ -16,7 +23,7 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
echo $new_brightness > /sys/class/backlight/intel_backlight/brightness
|
||||
echo $new_brightness > $dir/brightness
|
||||
ratio=$(( (new_brightness * 100) / max_brightness ))
|
||||
notify-send -r 43 "Brightness: ${ratio}%"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue