hyprland power mode based switcher

Signed-off-by: Ferit Yiğit BALABAN <fyb@fybx.dev>
This commit is contained in:
yigid balaban 2024-01-15 22:41:58 +03:00
parent 964ba649d2
commit 2812ed9f2a
Signed by: fyb
GPG Key ID: E21FEB2C244CB7EB

35
utility/change_hyprland_mode.sh Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
#
# Ferit Yiğit BALABAN, <fyb@fybx.dev>
# change_hyprland_mode.sh, 2024
#
path_mode="$HOME/.config/navi/power_mode"
dir_hypr="$HOME/.config/hypr"
path_save="$dir_hypr/hyprland.s.conf"
path_normal="$dir_hypr/hyprland.n.conf"
target="$dir_hypr/hyprland.conf"
powersave() {
cp "$path_save" "$target"
echo "powersave" > "$path_mode"
}
performance() {
cp "$path_normal" "$target"
echo "performance" > "$path_mode"
}
if [ "$1" == "save" ]; then
powersave
elif [ "$1" == "normal" ]; then
performance
else
current=$(cat "$path_mode")
if [ "$current" == "powersave" ]; then
performance
else
powersave
fi
fi