Initial commit: Moonarch reproduzierbares Arch-Linux-Setup
Niri-basierter Wayland-Desktop mit greetd/regreet, Catppuccin Mocha Theming, Rofi-Menus, Waybar und vollstaendiger Post-Install-Automatisierung. Archinstall-Config klont das Repo automatisch via custom-commands, danach genuegt ein einzelner Befehl fuer die komplette Einrichtung.
This commit is contained in:
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
# ABOUTME: Rofi-based CPU governor switcher using auto-cpufreq.
|
||||
# ABOUTME: Allows switching between performance, powersave, and reset modes.
|
||||
|
||||
declare -A LABELS
|
||||
declare -A COMMANDS
|
||||
|
||||
###
|
||||
# List of defined 'bangs'
|
||||
|
||||
COMMANDS[""]="pkexec auto-cpufreq --force=performance"
|
||||
LABELS[""]="Performance"
|
||||
|
||||
COMMANDS[""]='pkexec auto-cpufreq --force=powersave'
|
||||
LABELS[""]="Powersave"
|
||||
|
||||
COMMANDS[""]='pkexec auto-cpufreq --force=reset'
|
||||
LABELS[""]="Reset"
|
||||
|
||||
|
||||
################################################################################
|
||||
# do not edit below
|
||||
################################################################################
|
||||
##
|
||||
# Generate menu
|
||||
##
|
||||
function print_menu()
|
||||
{
|
||||
for key in ${!LABELS[@]}
|
||||
do
|
||||
# echo "$key ${LABELS}"
|
||||
echo "$key ${LABELS[$key]}"
|
||||
# my top version just shows the first field in labels row, not two words side by side
|
||||
done
|
||||
}
|
||||
##
|
||||
# Show rofi.
|
||||
##
|
||||
function start()
|
||||
{
|
||||
# print_menu | rofi -dmenu -p "?=>"
|
||||
print_menu | sort | rofi -theme /etc/xdg/rofi/cpugov/rofi-cpugov.rasi -show "CPU Modes" -dmenu -mesg " CPU Modes" -i -p "rofi-bangs: "
|
||||
}
|
||||
|
||||
|
||||
# Run it
|
||||
value="$(start)"
|
||||
|
||||
# Split input.
|
||||
# grab upto first space.
|
||||
choice=${value%%\ *}
|
||||
# graph remainder, minus space.
|
||||
input=${value:$((${#choice}+1))}
|
||||
|
||||
##
|
||||
# Cancelled? bail out
|
||||
##
|
||||
if test -z ${choice}
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
# check if choice exists
|
||||
if test ${COMMANDS[$choice]+isset}
|
||||
then
|
||||
# Execute the choice
|
||||
${COMMANDS[$choice]}
|
||||
|
||||
dunstify --replace 553 -i "/usr/share/icons/zafiro-dark/devices/48/cpu.svg" "CPU Mode" "Set to $choice ${LABELS[$choice]}"
|
||||
else
|
||||
echo "Unknown command: ${choice}" | rofi -dmenu -p "error"
|
||||
fi
|
||||
Reference in New Issue
Block a user