From 2812ed9f2a7ef485244c7b871470de22bf4010e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Mon, 15 Jan 2024 22:41:58 +0300 Subject: [PATCH] hyprland power mode based switcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ferit Yiğit BALABAN --- utility/change_hyprland_mode.sh | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 utility/change_hyprland_mode.sh diff --git a/utility/change_hyprland_mode.sh b/utility/change_hyprland_mode.sh new file mode 100755 index 0000000..3a3518b --- /dev/null +++ b/utility/change_hyprland_mode.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# +# Ferit Yiğit BALABAN, +# 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 +