Skip to content

Instantly share code, notes, and snippets.

@kRHYME7
Created November 15, 2023 20:39
Show Gist options
  • Save kRHYME7/8c64f94fcbf7d123bdc95ab10a85d2fb to your computer and use it in GitHub Desktop.
Save kRHYME7/8c64f94fcbf7d123bdc95ab10a85d2fb to your computer and use it in GitHub Desktop.
A command line interface for scripts on Hyprdots
#!/bin/bash
source ~/.config/hypr/scripts/globalcontrol.sh
HyprDir="$HOME/.config/hypr/scripts"
ScriptDir="$CloneDir/Scripts"
help() {
grep -P -A1 '^\s*\w+\s*\(\)\s*{' -o $0
#for func in $(declare -F | cut -d " " -f 3); do
# echo "Function: $func"
# declare -f $func
#done
}
restore() {
cd $ScriptDir || exit
./install.sh -r
}
install() {
cd $ScriptDir || exit
./install.sh
}
theme() {
# Function for managing themes
echo "Setting theme with parameters: $@"
case $1 in
set)
$HyprDir/themeswitch.sh -s
;;
next)
$HyprDir/themeswitch.sh -n
;;
prev)
$HyprDir/themeswitch.sh -p
;;
select)
$HyprDir/themeselect.sh
;;
patch)
shift
cd $ScriptDir
./themepatcher.sh "$@"
;;
*)
echo ""Error""
;;
esac
}
wallpaper() {
# Function for managing wallpapers
echo "Setting wallpaper with parameters: $@"
case $1 in
set)
shift
if [ -z "$@" ]; then echo "Missing: /Path/to/Wallpaper" ; exit 1 ; fi
$HyprDir/swwwallpaper.sh -s "$@"
;;
next)
$HyprDir/swwwallpaper.sh -n
;;
prev)
$HyprDir/sswwwallpaper.sh -p
;;
select)
$HyprDir/swwwallselect.sh
;;
*)
echo ""Error""
;;
esac
}
sddm() {
# Function for managing SDDM settings
echo "Setting SDDM with parameters: $@"
case $1 in
set)
$HyprDir/sddmwall.sh
;;
esac
}
wallbash(){
case $1 in
toggle)
$HyprDir/wallbashtoggle.sh
;;
esac
}
if [ -z "$@" ]; then help ; exit 1 ; fi
# Call the appropriate function based on the first argument
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment