Files
glassMxrph/scripts/glassmxrph
T
mxandClaude Opus 5.5 fc272e45b2 Open the equalizer from the notch's album art, and add notch view commands
Clicking the artwork on the notch's Media page swaps in the dashboard's
EasyEffects equalizer as a full view, the way Performance opens
"Your computer". `glassmxrph notch equalizer|computer` opens the notch
straight onto either view (or the matching dashboard tab with the full bar).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 00:52:59 +01:00

85 lines
3.7 KiB
Bash
Executable File

#!/bin/sh
set -eu
project_dir=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
case "${1:-run}" in
doctor)
exec python3 "$project_dir/scripts/doctor.py"
;;
run)
for glassmxrph_dependency in quickshell python3; do
command -v "$glassmxrph_dependency" >/dev/null 2>&1 || { echo "glassMxrph requires $glassmxrph_dependency on PATH" >&2; exit 127; }
done
# Qt may need the database root when /etc/localtime points outside /usr/share.
# Honor an explicit TZDIR and derive only from an existing zoneinfo symlink.
if [ -z "${TZDIR:-}" ]; then
glassmxrph_timezone_path=$(readlink -f /etc/localtime 2>/dev/null || true)
case "$glassmxrph_timezone_path" in
*/zoneinfo/*) TZDIR="${glassmxrph_timezone_path%/zoneinfo/*}/zoneinfo"; export TZDIR ;;
esac
fi
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/glassMxrph" "${XDG_STATE_HOME:-$HOME/.local/state}/glassMxrph"
# Portable Omarchy helper commands that shell plugins call.
export PATH="$project_dir/quickshell/compat/omarchy/bin:$PATH"
exec quickshell --no-duplicate --path "$project_dir/quickshell"
;;
wallpaper)
exec quickshell ipc --path "$project_dir/quickshell" call wallpaper picker
;;
controlcenter)
exec quickshell ipc --path "$project_dir/quickshell" call controlcenter toggle
;;
launcher)
exec quickshell ipc --path "$project_dir/quickshell" call launcher toggle
;;
overview)
exec quickshell ipc --path "$project_dir/quickshell" call overview toggle
;;
clipboard|emoji)
exec quickshell ipc --path "$project_dir/quickshell" call launcher "$1"
;;
plugin)
# glassmxrph plugin [list|install SOURCE|remove ID|enable ID|disable ID|summon ID|toggle ID]
action=${2:-list}
case "$action" in
summon|toggle) exec quickshell ipc --path "$project_dir/quickshell" call plugins "$action" "${3:?plugin id}" "${4:-}" ;;
list|status) exec quickshell ipc --path "$project_dir/quickshell" call plugins "$action" ;;
*) exec quickshell ipc --path "$project_dir/quickshell" call plugins "$action" "${3:?argument required}" ;;
esac
;;
dashboard)
# glassmxrph dashboard [dashboard|media|performance|power]
exec quickshell ipc --path "$project_dir/quickshell" call dashboard toggle "${2:-}"
;;
notch)
# glassmxrph notch [toggle|open|close|mode|computer|equalizer]; mode swaps notch mode and the full bar,
# computer/equalizer open the notch straight onto that view (or the dashboard tab with the full bar)
action=${2:-toggle}
[ "$action" = mode ] && action=toggleMode
exec quickshell ipc --path "$project_dir/quickshell" call notch "$action"
;;
lock)
exec quickshell ipc --path "$project_dir/quickshell" call lock lock
;;
widgets)
exec quickshell ipc --path "$project_dir/quickshell" call widgets toggle
;;
osd)
# glassmxrph osd [volumeUp|volumeDown|mute|micMute|brightnessUp|brightnessDown|open KIND]
action=${2:-open}
if [ "$action" = open ] || [ "$action" = show ]; then
exec quickshell ipc --path "$project_dir/quickshell" call osd open "${3:-volume}"
fi
exec quickshell ipc --path "$project_dir/quickshell" call osd "$action"
;;
notifications)
# glassmxrph notifications [dismiss|clear|dnd|status]
action=${2:-status}
[ "$action" = dnd ] && action=toggleDnd
exec quickshell ipc --path "$project_dir/quickshell" call notifications "$action"
;;
settings|close|status)
exec quickshell ipc --path "$project_dir/quickshell" call shell "$1"
;;
*) echo 'Usage: glassmxrph [run|wallpaper|launcher|overview|clipboard|emoji|dashboard [TAB]|notch [toggle|mode|computer|equalizer]|plugin ACTION|controlcenter|lock|widgets|osd ACTION|notifications ACTION|settings|close|status|doctor]' >&2; exit 2 ;;
esac