Add gentoo helper scripts

This commit is contained in:
Sravan Balaji
2025-07-30 09:42:30 -04:00
parent 1a16f07640
commit fd713d24a7
4 changed files with 135 additions and 0 deletions

View File

@@ -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
;;

58
gentoo/.scripts/gentoo.sh Executable file
View File

@@ -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 $@

View File

@@ -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
;;

View File

@@ -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 \