mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-24 01:41:00 +01:00
chore(home/linux/gui/hyprland): remove script for brightness adjustment
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
$term = foot
|
||||
$app_launcher = ~/.config/hypr/scripts/menu
|
||||
$volume = ~/.config/hypr/scripts/volume
|
||||
$backlight = ~/.config/hypr/scripts/brightness
|
||||
$lockscreen = ~/.config/hypr/scripts/lockscreen
|
||||
$wlogout = ~/.config/hypr/scripts/wlogout
|
||||
$colorpicker = ~/.config/hypr/scripts/colorpicker
|
||||
@@ -33,8 +32,8 @@ bindm=SUPER,mouse:272,movewindow
|
||||
bindm=SUPER,mouse:273,resizewindow
|
||||
|
||||
# -- Function keys --
|
||||
bind=,XF86MonBrightnessUp,exec,$backlight --inc
|
||||
bind=,XF86MonBrightnessDown,exec,$backlight --dec
|
||||
# bind=,XF86MonBrightnessUp,exec,$backlight --inc
|
||||
# bind=,XF86MonBrightnessDown,exec,$backlight --dec
|
||||
bind=,XF86AudioRaiseVolume,exec,$volume --inc
|
||||
bind=,XF86AudioLowerVolume,exec,$volume --dec
|
||||
bind=,XF86AudioMute,exec,$volume --toggle
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Script To Manage Brightness (in Wayland).
|
||||
|
||||
iDIR="$HOME/.config/hypr/mako/icons"
|
||||
|
||||
# Get brightness
|
||||
get_backlight() {
|
||||
LIGHT=$(printf "%.0f\n" $(light -G))
|
||||
echo "${LIGHT}%"
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
backlight="$(get_backlight)"
|
||||
current="${backlight%%%}"
|
||||
if [[ ("$current" -ge "0") && ("$current" -le "20") ]]; then
|
||||
icon="$iDIR/brightness-20.png"
|
||||
elif [[ ("$current" -ge "20") && ("$current" -le "40") ]]; then
|
||||
icon="$iDIR/brightness-40.png"
|
||||
elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then
|
||||
icon="$iDIR/brightness-60.png"
|
||||
elif [[ ("$current" -ge "60") && ("$current" -le "80") ]]; then
|
||||
icon="$iDIR/brightness-80.png"
|
||||
elif [[ ("$current" -ge "80") && ("$current" -le "100") ]]; then
|
||||
icon="$iDIR/brightness-100.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify
|
||||
notify_user() {
|
||||
notify-send -h string:x-canonical-private-synchronous:sys-notify -u low -i "$icon" "Brightness : $(get_backlight)"
|
||||
}
|
||||
|
||||
# Increase brightness
|
||||
inc_backlight() {
|
||||
light -A 5 && get_icon && notify_user
|
||||
}
|
||||
|
||||
# Decrease brightness
|
||||
dec_backlight() {
|
||||
light -U 5 && get_icon && notify_user
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
if [[ "$1" == "--get" ]]; then
|
||||
get_backlight
|
||||
elif [[ "$1" == "--inc" ]]; then
|
||||
inc_backlight
|
||||
elif [[ "$1" == "--dec" ]]; then
|
||||
dec_backlight
|
||||
else
|
||||
get_backlight
|
||||
fi
|
||||
Reference in New Issue
Block a user