Add settings script

This commit is contained in:
Stephan Raabe 2023-11-23 10:57:16 +01:00
parent d0b82d85c7
commit 9a69133dbb
5 changed files with 123 additions and 1 deletions

View File

@ -1 +1 @@
source = ~/dotfiles/hypr/conf/monitor/default.conf
source = ~/dotfiles/hypr/conf/monitors/default.conf

122
hypr/settings/settings.sh Executable file
View File

@ -0,0 +1,122 @@
#!/bin/sh
_settingsDecoration() {
clear
cat <<"EOF"
____ _ _
| _ \ ___ ___ ___ _ __ __ _| |_(_) ___ _ __ ___
| | | |/ _ \/ __/ _ \| '__/ _` | __| |/ _ \| '_ \/ __|
| |_| | __/ (_| (_) | | | (_| | |_| | (_) | | | \__ \
|____/ \___|\___\___/|_| \__,_|\__|_|\___/|_| |_|___/
EOF
cur=$(cat ~/dotfiles/hypr/conf/decoration.conf)
echo "In use: ${cur##*/}"
echo ""
echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):"
sel=$(gum file ~/dotfiles/hypr/conf/decorations/)
if [ ! -z $sel ] ;then
echo "source = $sel" > ~/dotfiles/hypr/conf/decoration.conf
_settingsDecoration
fi
_settingsMenu
}
_settingsWindow() {
clear
cat <<"EOF"
__ ___ _
\ \ / (_)_ __ __| | _____ _____
\ \ /\ / /| | '_ \ / _` |/ _ \ \ /\ / / __|
\ V V / | | | | | (_| | (_) \ V V /\__ \
\_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ |___/
EOF
cur=$(cat ~/dotfiles/hypr/conf/window.conf)
echo "In use: ${cur##*/}"
echo ""
echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):"
sel=$(gum file ~/dotfiles/hypr/conf/windows/)
if [ ! -z $sel ] ;then
echo "source = $sel" > ~/dotfiles/hypr/conf/window.conf
_settingsWindow
fi
_settingsMenu
}
_settingsAnimation() {
clear
cat <<"EOF"
_ _ _ _
/ \ _ __ (_)_ __ ___ __ _| |_(_) ___ _ __ ___
/ _ \ | '_ \| | '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
/ ___ \| | | | | | | | | | (_| | |_| | (_) | | | \__ \
/_/ \_\_| |_|_|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
EOF
cur=$(cat ~/dotfiles/hypr/conf/animation.conf)
echo "In use: ${cur##*/}"
echo ""
echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):"
sel=$(gum file ~/dotfiles/hypr/conf/animations/)
if [ ! -z $sel ] ;then
echo "source = $sel" > ~/dotfiles/hypr/conf/animation.conf
_settingsAnimation
fi
_settingsMenu
}
_settingsMonitor() {
clear
cat <<"EOF"
__ __ _ _
| \/ | ___ _ __ (_) |_ ___ _ __
| |\/| |/ _ \| '_ \| | __/ _ \| '__|
| | | | (_) | | | | | || (_) | |
|_| |_|\___/|_| |_|_|\__\___/|_|
EOF
cur=$(cat ~/dotfiles/hypr/conf/monitor.conf)
echo "In use: ${cur##*/}"
echo ""
echo "Select a file to load (RETURN = Confirm, ESC = Cancel/Back):"
sel=$(gum file ~/dotfiles/hypr/conf/monitors/)
if [ ! -z $sel ] ;then
echo "source = $sel" > ~/dotfiles/hypr/conf/monitor.conf
fi
_settingsMenu
}
_settingsMenu() {
clear
cat <<"EOF"
____ _ _ _
/ ___| ___| |_| |_(_)_ __ __ _ ___
\___ \ / _ \ __| __| | '_ \ / _` / __|
___) | __/ |_| |_| | | | | (_| \__ \
|____/ \___|\__|\__|_|_| |_|\__, |___/
|___/
EOF
menu=$(gum choose "Decorations" "Windows" "Animations" "Monitors" "EXIT")
case $menu in
[Decorations]* )
_settingsDecoration
break;;
[Windows]* )
_settingsWindow
break;;
[Animations]* )
_settingsAnimation
break;;
[Monitors]* )
_settingsMonitor
break;;
* )
exit
;;
esac
}
_settingsMenu