diff --git a/README.org b/README.org index 8bb0d2d..c95991d 100644 --- a/README.org +++ b/README.org @@ -121,6 +121,7 @@ - [[#cpu--gpu-control][CPU & GPU Control]] - [[#gaming-control][Gaming Control]] - [[#session-control][Session Control]] + - [[#gentoo][Gentoo]] - [[#control-center][Control Center]] - [[#acknowledgements][Acknowledgements]] @@ -9836,6 +9837,7 @@ stow-create: -S freecad \ -S gaming \ -S gammastep \ + -S gentoo \ -S geoclue \ -S ghostty \ -S gimp \ @@ -9893,6 +9895,7 @@ stow-delete: -D fuzzel \ -D gaming \ -D gammastep \ + -D gentoo \ -D geoclue \ -D ghostty \ -D gimp \ @@ -9951,6 +9954,7 @@ stow-recreate: -R freecad \ -R gaming \ -R gammastep \ + -R gentoo \ -R geoclue \ -R ghostty \ -R gimp \ @@ -10517,6 +10521,68 @@ main() { main $@ #+END_SRC +** Gentoo + +#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle gentoo/.scripts/gentoo.sh +help_menu() { + echo "Script to run common gentoo specific actions." + # echo " - Play / Pause: playerctl.sh --play-pause" + # echo " - Next: playerctl.sh --next" + # echo " - Previous: playerctl.sh --prev" + # echo " - Change Player: playerctl.sh --change" + # echo " - Rofi Menu: playerctl.sh --rofi" + # echo " - Help: playerctl.sh --help OR playerctl.sh -h" +} + +rofi_menu() { + declare -a options=( + "󰚰 Sync and Update Packages - sync-update" + " Spice Up Spotify - spicetify" + "󰌍 Back - back" + "󰗼 Quit - quit" + ) + + choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i) + option=$(printf '%s\n' "${choice}" | awk '{print $NF}') + + if [[ "$option" == "quit" ]]; then + pkill rofi + elif [[ "$option" != "back" ]]; then + main "--$option" && pkill rofi + fi +} + +main() { + if [ $# -eq 0 ]; then + # No arguments + help_menu + else + case $1 in + --help | -h) + help_menu + ;; + --sync-update) + notify-send "Gentoo" "Syncing repos" & + uwsm app -- foot -H sudo eix-sync -a + notify-send "Gentoo" "Updating Live Packages" & + uwsm app -- foot -H sudo emerge @smart-live-rebuild + notify-send "Gentoo" "Updating Versioned Packages" & + uwsm app -- foot -H sudo emerge --update --deep --newuse --with-bdeps=y --verbose-conflicts @world + ;; + --spicetify) + notify-send "Gentoo" "Spicing Up Spotify" & + uwsm app -- foot -H sudo emerge media-sound/spotify app-misc/spicetify-cli-bin::sravan-overlay && sudo chmod a+wr -R /opt/spotify && spicetify backup apply + ;; + --rofi) + rofi_menu + ;; + esac + fi +} + +main $@ +#+END_SRC + ** Control Center #+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle hyprland/.scripts/control-center.sh @@ -10540,6 +10606,7 @@ rofi_menu() { " Hardware - cpu-gpu" " Gaming - gaming" " Power Menu - session" + " Gentoo - gentoo" "󰌍 Back - back" "󰗼 Quit - quit" ) @@ -10587,6 +10654,9 @@ main() { --session) $HOME/.scripts/session.sh --rofi ;; + --gentoo) + $HOME/.scripts/gentoo.sh --rofi + ;; --rofi) rofi_menu ;; diff --git a/gentoo/.scripts/gentoo.sh b/gentoo/.scripts/gentoo.sh new file mode 100755 index 0000000..439a583 --- /dev/null +++ b/gentoo/.scripts/gentoo.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +help_menu() { + echo "Script to run common gentoo specific actions." + # echo " - Play / Pause: playerctl.sh --play-pause" + # echo " - Next: playerctl.sh --next" + # echo " - Previous: playerctl.sh --prev" + # echo " - Change Player: playerctl.sh --change" + # echo " - Rofi Menu: playerctl.sh --rofi" + # echo " - Help: playerctl.sh --help OR playerctl.sh -h" +} + +rofi_menu() { + declare -a options=( + "󰚰 Sync and Update Packages - sync-update" + " Spice Up Spotify - spicetify" + "󰌍 Back - back" + "󰗼 Quit - quit" + ) + + choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i) + option=$(printf '%s\n' "${choice}" | awk '{print $NF}') + + if [[ "$option" == "quit" ]]; then + pkill rofi + elif [[ "$option" != "back" ]]; then + main "--$option" && pkill rofi + fi +} + +main() { + if [ $# -eq 0 ]; then + # No arguments + help_menu + else + case $1 in + --help | -h) + help_menu + ;; + --sync-update) + notify-send "Gentoo" "Syncing repos" & + uwsm app -- foot -H sudo eix-sync -a + notify-send "Gentoo" "Updating Live Packages" & + uwsm app -- foot -H sudo emerge @smart-live-rebuild + notify-send "Gentoo" "Updating Versioned Packages" & + uwsm app -- foot -H sudo emerge --update --deep --newuse --with-bdeps=y --verbose-conflicts @world + ;; + --spicetify) + notify-send "Gentoo" "Spicing Up Spotify" & + uwsm app -- foot -H sudo emerge media-sound/spotify app-misc/spicetify-cli-bin::sravan-overlay && sudo chmod a+wr -R /opt/spotify && spicetify backup apply + ;; + --rofi) + rofi_menu + ;; + esac + fi +} + +main $@ diff --git a/hyprland/.scripts/control-center.sh b/hyprland/.scripts/control-center.sh index 346b491..db3f415 100755 --- a/hyprland/.scripts/control-center.sh +++ b/hyprland/.scripts/control-center.sh @@ -19,6 +19,7 @@ rofi_menu() { " Hardware - cpu-gpu" " Gaming - gaming" " Power Menu - session" + " Gentoo - gentoo" "󰌍 Back - back" "󰗼 Quit - quit" ) @@ -66,6 +67,9 @@ main() { --session) $HOME/.scripts/session.sh --rofi ;; + --gentoo) + $HOME/.scripts/gentoo.sh --rofi + ;; --rofi) rofi_menu ;; diff --git a/justfile b/justfile index caa4733..8bb98a2 100644 --- a/justfile +++ b/justfile @@ -35,6 +35,7 @@ stow-create: -S freecad \ -S gaming \ -S gammastep \ + -S gentoo \ -S geoclue \ -S ghostty \ -S gimp \ @@ -92,6 +93,7 @@ stow-delete: -D fuzzel \ -D gaming \ -D gammastep \ + -D gentoo \ -D geoclue \ -D ghostty \ -D gimp \ @@ -150,6 +152,7 @@ stow-recreate: -R freecad \ -R gaming \ -R gammastep \ + -R gentoo \ -R geoclue \ -R ghostty \ -R gimp \