Lots of scripts

This commit is contained in:
2026-03-06 22:33:30 +00:00
parent b1863b545a
commit 3740b69b53
29 changed files with 601 additions and 207 deletions

View File

@@ -0,0 +1,63 @@
Name = "stationBackgroundSelector"
NamePretty = "Station Background Selector"
Cache = false
HideFromProviderlist = true
SearchName = true
local function ShellEscape(s)
return "'" .. s:gsub("'", "'\\''") .. "'"
end
function FormatName(filename)
-- Remove leading number and dash
local name = filename:gsub("^%d+", ""):gsub("^%-", "")
-- Remove extension
name = name:gsub("%.[^%.]+$", "")
-- Replace dashes with spaces
name = name:gsub("-", " ")
-- Capitalize each word
name = name:gsub("%S+", function(word)
return word:sub(1, 1):upper() .. word:sub(2):lower()
end)
return name
end
function GetEntries()
local entries = {}
local home = os.getenv("HOME")
-- Directories to search
local dirs = {
home .. "/Tower/Library/Pictures/Wallpapers/3840x2160",
}
-- Track added files to avoid duplicates
local seen = {}
for _, wallpaper_dir in ipairs(dirs) do
local handle = io.popen(
"find " .. ShellEscape(wallpaper_dir)
.. " -maxdepth 1 -type f \\( -name '*.jpg' -o -name '*.jpeg' -o -name '*.png' -o -name '*.gif' -o -name '*.bmp' -o -name '*.webp' \\) 2>/dev/null | sort"
)
if handle then
for background in handle:lines() do
local filename = background:match("([^/]+)$")
if filename and not seen[filename] then
seen[filename] = true
table.insert(entries, {
Text = FormatName(filename),
Value = background,
Actions = {
activate = "station-bg-set " .. ShellEscape(background),
},
Preview = background,
PreviewType = "file",
})
end
end
handle:close()
end
end
return entries
end

View File

@@ -169,7 +169,7 @@ bindd = SUPER ALT, code:14, Switch to group window 5, changegroupactive, 5
# ==========================
# Utilities
# ==========================
# bindd = SUPER, Slash, Cycle monitor scaling, exec, omarchy-hyprland-monitor-scaling-cycle
bindd = SUPER, Slash, Cycle monitor scaling, exec, station-hyprland-monitor-scaling-cycle
# Menus
bindd = SUPER, SPACE, Launch apps, exec, station-launch-walker

48
.local/bin/station-bg-next Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
# Cycles through the background images available
BACKGROUNDS_PATH="$HOME/Tower/Library/Pictures/Wallpapers/3840x2160/"
CURRENT_BACKGROUND_LINK="$HOME/.local/state/station/background"
mapfile -d '' -t BACKGROUNDS < <(find -L "$BACKGROUNDS_PATH" -maxdepth 1 -type f -print0 2>/dev/null | sort -z)
TOTAL=${#BACKGROUNDS[@]}
if (( TOTAL == 0 )); then
notify-send "No background was found" -t 2000
pkill -x swaybg
setsid uwsm-app -- swaybg --color '#000000' >/dev/null 2>&1 &
else
# Get current background from symlink
if [[ -L $CURRENT_BACKGROUND_LINK ]]; then
CURRENT_BACKGROUND=$(readlink "$CURRENT_BACKGROUND_LINK")
else
# Default to first background if no symlink exists
CURRENT_BACKGROUND=""
fi
# Find current background index
INDEX=-1
for i in "${!BACKGROUNDS[@]}"; do
if [[ ${BACKGROUNDS[$i]} == $CURRENT_BACKGROUND ]]; then
INDEX=$i
break
fi
done
# Get next background (wrap around)
if (( INDEX == -1 )); then
# Use the first background when no match was found
NEW_BACKGROUND="${BACKGROUNDS[0]}"
else
NEXT_INDEX=$(((INDEX + 1) % TOTAL))
NEW_BACKGROUND="${BACKGROUNDS[$NEXT_INDEX]}"
fi
# Set new background symlink
ln -nsf "$NEW_BACKGROUND" "$CURRENT_BACKGROUND_LINK"
# Relaunch swaybg
pkill -x swaybg
setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 &
fi

18
.local/bin/station-bg-set Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# Sets the specified image as the current background
if [[ -z $1 ]]; then
echo "Usage: station-bg-set <path-to-image>" >&2
exit 1
fi
BACKGROUND="$1"
CURRENT_BACKGROUND_LINK="$HOME/.local/state/station/background"
# Create symlink to the new background
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"
# Kill existing swaybg and start new one
pkill -x swaybg
setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 &

46
.local/bin/station-cmd-share Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
# Share clipboard, file, or folder using LocalSend. Bound to Super + Ctrl + S by default.
if (($# == 0)); then
echo "Usage: station-cmd-share [clipboard|file|folder]"
exit 1
fi
MODE="$1"
shift
if [[ $MODE == "clipboard" ]]; then
TEMP_FILE=$(mktemp --suffix=.txt)
wl-paste >"$TEMP_FILE"
FILES="$TEMP_FILE"
else
if (($# > 0)); then
FILES="$*"
else
if [[ $MODE == "folder" ]]; then
# Pick a single folder from home directory
FILES=$(find "$HOME" -type d 2>/dev/null | fzf)
else
# Pick one or more files from home directory
FILES=$(find "$HOME" -type f 2>/dev/null | fzf --multi)
fi
[[ -z $FILES ]] && exit 0
fi
fi
# Run LocalSend in its own systemd service (detached from terminal)
# Convert newline-separated files to space-separated arguments
if [[ $MODE != "clipboard" ]] && echo "$FILES" | grep -q $'\n'; then
# Multiple files selected - convert newlines to array
readarray -t FILE_ARRAY <<<"$FILES"
systemd-run --user --quiet --collect localsend --headless send "${FILE_ARRAY[@]}"
else
# Single file or clipboard mode
systemd-run --user --quiet --collect localsend --headless send "$FILES"
fi
# Note: Temporary file will remain until system cleanup for clipboard mode
# This ensures the file content is available for the LocalSend GUI
exit 0

View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Set a new encryption password for a drive selected.
encrypted_drives=$(blkid -t TYPE=crypto_LUKS -o device)
if [[ -n $encrypted_drives ]]; then
if (( $(wc -l <<<encrypted_drives) == 1 )); then
drive_to_change="$encrypted_drives"
else
drive_to_change="$(omarchy-drive-select "$encrypted_drives")"
fi
if [[ -n $drive_to_change ]]; then
echo "Changing full-disk encryption password for $drive_to_change"
sudo cryptsetup luksChangeKey --pbkdf argon2id --iter-time 2000 "$drive_to_change"
else
echo "No drive selected."
fi
else
echo "No encrypted drives available."
exit 1
fi

View File

@@ -0,0 +1,18 @@
#!/bin/bash
# Check if hibernation is supported
if [[ ! -f /sys/power/image_size ]]; then
exit 1
fi
# Sum all swap sizes (excluding zram)
SWAPSIZE_KB=$(awk '!/Filename|zram/ {sum += $3} END {print sum+0}' /proc/swaps)
SWAPSIZE=$(( 1024 * ${SWAPSIZE_KB:-0} ))
HIBERNATION_IMAGE_SIZE=$(cat /sys/power/image_size)
if (( SWAPSIZE > HIBERNATION_IMAGE_SIZE )) ; then
exit 0
else
exit 1
fi

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Get the active monitor (the one with the cursor)
MONITOR_INFO=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)')
ACTIVE_MONITOR=$(echo "$MONITOR_INFO" | jq -r '.name')
CURRENT_SCALE=$(echo "$MONITOR_INFO" | jq -r '.scale')
WIDTH=$(echo "$MONITOR_INFO" | jq -r '.width')
HEIGHT=$(echo "$MONITOR_INFO" | jq -r '.height')
REFRESH_RATE=$(echo "$MONITOR_INFO" | jq -r '.refreshRate')
# Cycle through scales: 1 → 1.6 → 2 → 3 → 1
CURRENT_INT=$(awk -v s="$CURRENT_SCALE" 'BEGIN { printf "%.0f", s * 10 }')
case "$CURRENT_INT" in
10) NEW_SCALE=1.6 ;;
16) NEW_SCALE=2 ;;
20) NEW_SCALE=3 ;;
*) NEW_SCALE=1 ;;
esac
hyprctl keyword misc:disable_scale_notification true
hyprctl keyword monitor "$ACTIVE_MONITOR,${WIDTH}x${HEIGHT}@${REFRESH_RATE},auto,$NEW_SCALE"
hyprctl keyword misc:disable_scale_notification false
notify-send "󰍹 Display scaling set to ${NEW_SCALE}x"

View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Toggles the window gaps globally between no gaps and the default 10/5/2.
gaps=$(hyprctl getoption general:gaps_out -j | jq -r '.custom' | awk '{print $1}')
if [[ $gaps == "0" ]]; then
hyprctl keyword general:gaps_out 10
hyprctl keyword general:gaps_in 5
hyprctl keyword general:border_size 2
else
hyprctl keyword general:gaps_out 0
hyprctl keyword general:gaps_in 0
hyprctl keyword general:border_size 0
fi

View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Check current single_window_aspect_ratio setting
CURRENT_VALUE=$(hyprctl getoption "layout:single_window_aspect_ratio" 2>/dev/null | head -1)
# Parse vec2 output: "vec2: [1, 1]" or "vec2: [0, 0]"
if [[ $CURRENT_VALUE == *"[1, 1]"* ]]; then
hyprctl keyword layout:single_window_aspect_ratio "0 0"
notify-send " Disable single-window square aspect ratio"
else
hyprctl keyword layout:single_window_aspect_ratio "1 1"
notify-send " Enable single-window square aspect"
fi

View File

@@ -57,11 +57,10 @@ open_in_editor() {
}
show_trigger_menu() {
case $(menu "Trigger" " Capture\n Share\n󰔎 Toggle\n Hardware") in
case $(menu "Trigger" " Capture\n Share\n󰔎 Toggle") in
*Capture*) show_capture_menu ;;
*Share*) show_share_menu ;;
*Toggle*) show_toggle_menu ;;
*Hardware*) show_hardware_menu ;;
*) show_main_menu ;;
esac
}
@@ -120,200 +119,135 @@ show_screenrecord_menu() {
esac
}
# show_share_menu() {
# case $(menu "Share" " Clipboard\n File \n Folder") in
# *Clipboard*) station-cmd-share clipboard ;;
# *File*) terminal bash -c "station-cmd-share file" ;;
# *Folder*) terminal bash -c "station-cmd-share folder" ;;
# *) back_to show_trigger_menu ;;
# esac
# }
#
# show_toggle_menu() {
# case $(menu "Toggle" "󱄄 Screensaver\n󰔎 Nightlight\n󱫖 Idle Lock\n󰍜 Top Bar\n󱂬 Workspace Layout\n Window Gaps\n 1-Window Ratio\n󰍹 Display Scaling") in
#
# *Screensaver*) station-toggle-screensaver ;;
# *Nightlight*) station-toggle-nightlight ;;
# *Idle*) station-toggle-idle ;;
# *Bar*) station-toggle-waybar ;;
# *Layout*) station-hyprland-workspace-layout-toggle ;;
# *Ratio*) station-hyprland-window-single-square-aspect-toggle ;;
# *Gaps*) station-hyprland-window-gaps-toggle ;;
# *Scaling*) station-hyprland-monitor-scaling-cycle ;;
# *) back_to show_trigger_menu ;;
# esac
# }
#
# show_hardware_menu() {
# case $(menu "Toggle" " Hybrid GPU") in
# *"Hybrid GPU"*) present_terminal station-toggle-hybrid-gpu ;;
# *) show_trigger_menu ;;
# esac
# }
#
# show_style_menu() {
# case $(menu "Style" " Background\n Hyprland\n󱄄 Screensaver") in
# *Background*) show_background_menu ;;
# *Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;;
# *Screensaver*) open_in_editor ~/.config/station/branding/screensaver.txt ;;
# *) show_main_menu ;;
# esac
# }
#
# show_background_menu() {
# station-launch-walker -m menus:stationBackgroundSelector --width 800 --minheight 400
# }
#
# show_setup_menu() {
# local options=" Audio\n Wifi\n󰂯 Bluetooth\n󱐋 Power Profile\n System Sleep\n󰍹 Monitors"
# [[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings"
# [[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input"
# options="$options\n󰱔 DNS\n Security\n Config"
#
# case $(menu "Setup" "$options") in
# *Audio*) station-launch-audio ;;
# *Wifi*) station-launch-wifi ;;
# *Bluetooth*) station-launch-bluetooth ;;
# *Power*) show_setup_power_menu ;;
# *System*) show_setup_system_menu ;;
# *Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;;
# *Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;;
# *Input*) open_in_editor ~/.config/hypr/input.conf ;;
# *DNS*) present_terminal station-setup-dns ;;
# *Security*) show_setup_security_menu ;;
# *Config*) show_setup_config_menu ;;
# *) show_main_menu ;;
# esac
# }
#
# show_setup_power_menu() {
# profile=$(menu "Power Profile" "$(station-powerprofiles-list)" "" "$(powerprofilesctl get)")
#
# if [[ $profile == "CNCLD" || -z $profile ]]; then
# back_to show_setup_menu
# else
# powerprofilesctl set "$profile"
# fi
# }
#
# show_setup_security_menu() {
# case $(menu "Setup" "󰈷 Fingerprint\n Fido2") in
# *Fingerprint*) present_terminal station-setup-fingerprint ;;
# *Fido2*) present_terminal station-setup-fido2 ;;
# *) show_setup_menu ;;
# esac
# }
#
# show_setup_config_menu() {
# case $(menu "Setup" " Defaults\n Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar\n󰞅 XCompose") in
# *Defaults*) open_in_editor ~/.config/uwsm/default ;;
# *Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
# *Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && station-restart-hypridle ;;
# *Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
# *Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && station-restart-hyprsunset ;;
# *Swayosd*) open_in_editor ~/.config/swayosd/config.toml && station-restart-swayosd ;;
# *Walker*) open_in_editor ~/.config/walker/config.toml && station-restart-walker ;;
# *Waybar*) open_in_editor ~/.config/waybar/config.jsonc && station-restart-waybar ;;
# *XCompose*) open_in_editor ~/.config/xcompose && station-restart-xcompose ;;
# *) show_setup_menu ;;
# esac
# }
#
# show_setup_system_menu() {
# local options=""
#
# if [[ -f ~/.local/state/station/toggles/suspend-off ]]; then
# options="$options󰒲 Enable Suspend"
# else
# options="$options󰒲 Disable Suspend"
# fi
#
# if station-hibernation-available; then
# options="$options\n󰤁 Disable Hibernate"
# else
# options="$options\n󰤁 Enable Hibernate"
# fi
#
# case $(menu "System" "$options") in
# *Suspend*) station-toggle-suspend ;;
# *"Enable Hibernate"*) present_terminal station-hibernation-setup ;;
# *"Disable Hibernate"*) present_terminal station-hibernation-remove ;;
# *) show_setup_menu ;;
# esac
# }
#
# show_update_menu() {
# case $(menu "Update" " Config\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in
# *Config*) show_update_config_menu ;;
# *Process*) show_update_process_menu ;;
# *Hardware*) show_update_hardware_menu ;;
# *Firmware*) present_terminal station-update-firmware ;;
# *Timezone*) present_terminal station-tz-select ;;
# *Time*) present_terminal station-update-time ;;
# *Password*) show_update_password_menu ;;
# *) show_main_menu ;;
# esac
# }
#
# show_update_process_menu() {
# case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in
# *Hypridle*) station-restart-hypridle ;;
# *Hyprsunset*) station-restart-hyprsunset ;;
# *Swayosd*) station-restart-swayosd ;;
# *Walker*) station-restart-walker ;;
# *Waybar*) station-restart-waybar ;;
# *) show_update_menu ;;
# esac
# }
#
# show_update_config_menu() {
# case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n󱣴 Plymouth\n Swayosd\n Tmux\n󰌧 Walker\n󰍜 Waybar") in
# *Hyprland*) present_terminal station-refresh-hyprland ;;
# *Hypridle*) present_terminal station-refresh-hypridle ;;
# *Hyprlock*) present_terminal station-refresh-hyprlock ;;
# *Hyprsunset*) present_terminal station-refresh-hyprsunset ;;
# *Plymouth*) present_terminal station-refresh-plymouth ;;
# *Swayosd*) present_terminal station-refresh-swayosd ;;
# *Tmux*) present_terminal station-refresh-tmux ;;
# *Walker*) present_terminal station-refresh-walker ;;
# *Waybar*) present_terminal station-refresh-waybar ;;
# *) show_update_menu ;;
# esac
# }
#
# show_update_hardware_menu() {
# case $(menu "Restart" " Audio\n󱚾 Wi-Fi\n󰂯 Bluetooth") in
# *Audio*) present_terminal station-restart-pipewire ;;
# *Wi-Fi*) present_terminal station-restart-wifi ;;
# *Bluetooth*) present_terminal station-restart-bluetooth ;;
# *) show_update_menu ;;
# esac
# }
#
# show_update_password_menu() {
# case $(menu "Update Password" " Drive Encryption\n User") in
# *Drive*) present_terminal station-drive-set-password ;;
# *User*) present_terminal passwd ;;
# *) show_update_menu ;;
# esac
# }
#
# show_system_menu() {
# local options="󱄄 Screensaver\n Lock\n󰒲 Suspend"
# station-hibernation-available && options="$options\n󰤁 Hibernate"
# options="$options\n󰍃 Logout\n󰜉 Restart\n󰐥 Shutdown"
#
# case $(menu "System" "$options") in
# *Screensaver*) station-launch-screensaver force ;;
# *Lock*) station-lock-screen ;;
# *Suspend*) systemctl suspend ;;
# *Hibernate*) systemctl hibernate ;;
# *Logout*) station-system-logout ;;
# *Restart*) station-system-reboot ;;
# *Shutdown*) station-system-shutdown ;;
# *) back_to show_main_menu ;;
# esac
# }
show_share_menu() {
case $(menu "Share" " Clipboard\n File \n Folder") in
*Clipboard*) station-cmd-share clipboard ;;
*File*) terminal bash -c "station-cmd-share file" ;;
*Folder*) terminal bash -c "station-cmd-share folder" ;;
*) back_to show_trigger_menu ;;
esac
}
show_toggle_menu() {
case $(menu "Toggle" "󱄄 Screensaver\n󰔎 Nightlight\n󱫖 Idle Lock\n󰍜 Top Bar\n󱂬 Workspace Layout\n Window Gaps\n 1-Window Ratio\n󰍹 Display Scaling") in
*Screensaver*) station-toggle-screensaver ;;
*Nightlight*) station-toggle-nightlight ;;
*Idle*) station-toggle-idle ;;
*Bar*) station-toggle-waybar ;;
*Layout*) station-hyprland-workspace-layout-toggle ;;
*Ratio*) station-hyprland-window-single-square-aspect-toggle ;;
*Gaps*) station-hyprland-window-gaps-toggle ;;
*Scaling*) station-hyprland-monitor-scaling-cycle ;;
*) back_to show_trigger_menu ;;
esac
}
show_background_menu() {
station-launch-walker -m menus:stationBackgroundSelector --width 800 --minheight 400
}
show_setup_menu() {
local options=" Audio\n Wifi\n󰂯 Bluetooth\n󱐋 Power Profile\n󰍹 Monitors"
[[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings"
[[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input"
options="$options\n Config"
case $(menu "Setup" "$options") in
*Audio*) station-launch-audio ;;
*Wifi*) station-launch-wifi ;;
*Bluetooth*) station-launch-bluetooth ;;
*Power*) show_setup_power_menu ;;
*Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;;
*Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;;
*Input*) open_in_editor ~/.config/hypr/input.conf ;;
*Config*) show_setup_config_menu ;;
*) show_main_menu ;;
esac
}
show_setup_power_menu() {
profile=$(menu "Power Profile" "$(station-powerprofiles-list)" "" "$(powerprofilesctl get)")
if [[ $profile == "CNCLD" || -z $profile ]]; then
back_to show_setup_menu
else
powerprofilesctl set "$profile"
fi
}
show_setup_config_menu() {
case $(menu "Setup" " Defaults\n Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar\n󰞅 XCompose") in
*Defaults*) open_in_editor ~/.config/uwsm/default ;;
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
*Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && station-restart-app hypridle ;;
*Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
*Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && station-restart-app hyprsunset ;;
*Swayosd*) open_in_editor ~/.config/swayosd/config.toml && station-restart-app swayosd-server ;;
*Walker*) open_in_editor ~/.config/walker/config.toml && station-restart-walker ;;
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && station-restart-app waybar ;;
*XCompose*) open_in_editor ~/.config/xcompose && station-restart-app fcitx5 --disable notificationitem ;;
*) show_setup_menu ;;
esac
}
show_update_menu() {
case $(menu "Update" "  Station\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in
*Station*) present_terminal station-update-system ;;
*Process*) show_update_process_menu ;;
*Hardware*) show_update_hardware_menu ;;
*Firmware*) present_terminal station-update-firmware ;;
*Timezone*) present_terminal station-tz-select ;;
*Time*) present_terminal station-update-time ;;
*Password*) show_update_password_menu ;;
*) show_main_menu ;;
esac
}
show_update_process_menu() {
case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in
*Hypridle*) station-restart-app hypridle ;;
*Hyprsunset*) station-restart-app hyprsunset ;;
*Swayosd*) station-restart-app swayosd-server ;;
*Walker*) station-restart-walker ;;
*Waybar*) station-restart-app waybar ;;
*) show_update_menu ;;
esac
}
show_update_hardware_menu() {
case $(menu "Restart" " Audio\n󱚾 Wi-Fi\n󰂯 Bluetooth") in
*Audio*) present_terminal station-restart-pipewire ;;
*Wi-Fi*) present_terminal station-restart-wifi ;;
*Bluetooth*) present_terminal station-restart-bluetooth ;;
*) show_update_menu ;;
esac
}
show_update_password_menu() {
case $(menu "Update Password" " Drive Encryption\n User") in
*Drive*) present_terminal station-drive-set-password ;;
*User*) present_terminal passwd ;;
*) show_update_menu ;;
esac
}
show_system_menu() {
local options="󱄄 Screensaver\n Lock\n󰒲 Suspend"
station-hibernation-available && options="$options\n󰤁 Hibernate"
options="$options\n󰍃 Logout\n󰜉 Restart\n󰐥 Shutdown"
case $(menu "System" "$options") in
*Screensaver*) station-launch-screensaver force ;;
*Lock*) station-lock-screen ;;
*Suspend*) systemctl suspend ;;
*Hibernate*) systemctl hibernate ;;
*Logout*) station-system-logout ;;
*Restart*) station-system-reboot ;;
*Shutdown*) station-system-shutdown ;;
*) back_to show_main_menu ;;
esac
}
show_main_menu() {
go_to_menu "$(menu "Go" "󰀻 Apps\n󱓞 Trigger\n Setup\n Update\n About\n System")"
@@ -323,16 +257,10 @@ go_to_menu() {
case "${1,,}" in
*apps*) walker -p "Launch…" ;;
*trigger*) show_trigger_menu ;;
# *toggle*) show_toggle_menu ;;
# *share*) show_share_menu ;;
# *background*) show_background_menu ;;
# *capture*) show_capture_menu ;;
# *theme*) show_theme_menu ;;
# *screenrecord*) show_screenrecord_menu ;;
# *setup*) show_setup_menu ;;
# *power*) show_setup_power_menu ;;
# *update*) show_update_menu ;;
# *system*) show_system_menu ;;
*background*) show_background_menu ;;
*setup*) show_setup_menu ;;
*update*) show_update_menu ;;
*system*) show_system_menu ;;
esac
}

View File

@@ -0,0 +1,8 @@
#!/bin/bash
# Returns a list of all the available power profiles on the system.
# Used by the Station Menu under Setup > Power Profile.
powerprofilesctl list |
awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }' |
tac

View File

@@ -0,0 +1,4 @@
#!/bin/bash
echo "Rebuilding system..."
sudo nixos rebuild switch --flake ~/.config/nixos/

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Unblock and restart the bluetooth service.
echo -e "Unblocking bluetooth...\n"
rfkill unblock bluetooth
rfkill list bluetooth

View File

@@ -0,0 +1,6 @@
#!/bin/bash
# Restart the PipeWire audio service to fix audio issues or apply new configuration.
echo -e "Restarting pipewire audio service...\n"
systemctl --user restart pipewire.service

View File

@@ -0,0 +1,22 @@
#!/bin/bash
restart_services() {
if systemctl --user is-enabled elephant.service &>/dev/null; then
systemctl --user restart elephant.service
fi
if systemctl --user is-enabled app-walker@autostart.service &>/dev/null; then
systemctl --user restart app-walker@autostart.service
else
echo -e "\e[31mUnable to restart Walker -- RESTART MANUALLY\e[0m"
fi
}
if (( EUID == 0 )); then
SCRIPT_OWNER=$(stat -c '%U' "$0")
USER_UID=$(id -u "$SCRIPT_OWNER")
systemd-run --uid="$SCRIPT_OWNER" --setenv=XDG_RUNTIME_DIR="/run/user/$USER_UID" \
bash -c "$(declare -f restart_services); restart_services"
else
restart_services
fi

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Unblock and restart the Wi-Fi service.
echo -e "Unblocking wifi...\n"
rfkill unblock wifi
rfkill list wifi

26
.local/bin/station-state Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Manage persistent state files for Station toggles and settings.
# Usage: station-state <set|clear> <state-name-or-pattern>
# Used to track whether features like suspend, idle lock, etc are enabled or disabled.
STATE_DIR="$HOME/.local/state/station"
mkdir -p "$STATE_DIR"
COMMAND="$1"
STATE_NAME="$2"
if [[ -z $COMMAND ]]; then
echo "Usage: station-state <set|clear> <state-name-or-pattern>"
exit 1
fi
if [[ -z $STATE_NAME ]]; then
echo "Usage: station-state $COMMAND <state-name>"
exit 1
fi
case "$COMMAND" in
set) touch "$STATE_DIR/$STATE_NAME" ;;
clear) find "$STATE_DIR" -maxdepth 1 -type f -name "$STATE_NAME" -delete ;;
esac

View File

@@ -0,0 +1,11 @@
#!/bin/bash
# Logout command that first closes all application windows (thus giving them a chance to save state),
# then stops the session, returning to the SDDM login screen.
# Schedule the session stop after closing windows (detached from terminal)
nohup bash -c "sleep 2 && uwsm stop" >/dev/null 2>&1 &
# Now close all windows
station-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly

View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Reboot command that first closes all application windows (thus giving them a chance to save state).
# This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly.
station-state clear re*-required
# Schedule the reboot to happen after closing windows (detached from terminal)
nohup bash -c "sleep 2 && systemctl reboot --no-wall" >/dev/null 2>&1 &
# Now close all windows
station-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly

View File

@@ -0,0 +1,13 @@
#,!/bin/bash
# Shutdown command that first closes all application windows (thus giving them a chance to save state).
# This is particularly helpful for applications like Chromium that otherwise won't shutdown cleanly.
station-state clear re*-required
# Schedule the shutdown to happen after closing windows (detached from terminal)
nohup bash -c "sleep 2 && systemctl poweroff --no-wall" >/dev/null 2>&1 &
# Now close all windows
station-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly!/bin/bash

11
.local/bin/station-toggle-idle Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
if pgrep -x hypridle >/dev/null; then
pkill -x hypridle
notify-send "󱫖 Stop locking computer when idle"
else
uwsm-app -- hypridle >/dev/null 2>&1 &
notify-send "󱫖 Now locking computer when idle"
fi
pkill -RTMIN+9 waybar

View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Default temperature values
ON_TEMP=4000
OFF_TEMP=6000
# Ensure hyprsunset is running
if ! pgrep -x hyprsunset; then
setsid uwsm-app -- hyprsunset &
sleep 1 # Give it time to register
fi
# Query the current temperature
CURRENT_TEMP=$(hyprctl hyprsunset temperature 2>/dev/null | grep -oE '[0-9]+')
restart_nightlighted_waybar() {
if grep -q "custom/nightlight" ~/.config/waybar/config.jsonc; then
station-restart-waybar # restart waybar in case user has waybar module for hyprsunset
fi
}
if [[ $CURRENT_TEMP == $OFF_TEMP ]]; then
hyprctl hyprsunset temperature $ON_TEMP
notify-send " Nightlight screen temperature"
restart_nightlighted_waybar
else
hyprctl hyprsunset temperature $OFF_TEMP
notify-send " Daylight screen temperature"
restart_nightlighted_waybar
fi

View File

@@ -0,0 +1,12 @@
#!/bin/bash
STATE_FILE=~/.local/state/station/toggles/screensaver-off
if [[ -f $STATE_FILE ]]; then
rm -f $STATE_FILE
notify-send "󱄄 Screensaver enabled"
else
mkdir -p "$(dirname $STATE_FILE)"
touch $STATE_FILE
notify-send "󱄄 Screensaver disabled"
fi

View File

@@ -0,0 +1,7 @@
#!/bin/bash
if pgrep -x waybar >/dev/null; then
pkill -x waybar
else
uwsm-app -- waybar >/dev/null 2>&1 &
fi

6
.local/bin/station-tz-select Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
timezone=$(timedatectl list-timezones | gum filter --height 20 --header "Set timezone") || exit 1
sudo timedatectl set-timezone "$timezone"
echo "Timezone is now set to $timezone"
station-restart-app waybar

View File

@@ -0,0 +1,7 @@
#!/bin/bash
set -e
echo -e "\e[32mUpdate Firmware\e[0m"
fwupdmgr refresh --force
sudo fwupdmgr update

View File

@@ -0,0 +1,4 @@
#!/bin/bash
echo "Updating system..."
sudo nixos rebuild switch --flake ~/.config/nixos/ --update

4
.local/bin/station-update-time Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
echo "Updating time..."
sudo systemctl restart systemd-timesyncd