-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.sh
More file actions
executable file
·34 lines (29 loc) · 1.13 KB
/
scripts.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# __ __ __
# .-----.----.----.|__|.-----.| |_.-----. .-----.| |--.
# |__ --| __| _|| || _ || _|__ --|__|__ --|| |
# |_____|____|__| |__|| __||____|_____|__|_____||__|__|
# rofi hub for |__| launching scripts
# deps:
# * global: rofi, notify-send, nerd font
# * color temperature: wlsunset
# * clipboard history: wl-clipboard, cliphist
source "$HOME/scripts/.env"
SCRIPT_DIR="$HOME/scripts"
declare -A HUB
HUB=(
["$TEMPERATURE_TITLE"]="$SCRIPT_DIR/color_temperature.sh"
["$RESTART_TITLE"]="$SCRIPT_DIR/restart_service.sh"
["$CLIPBOARD_TITLE"]="$SCRIPT_DIR/clipboard_history.sh"
["$EXIT_TITLE"]="$SCRIPT_DIR/exit_hyprland.sh"
)
LIST=$(printf "%s\n" "${!HUB[@]}" | sort)
CHOICE=$(echo -e "$LIST" | rofi -dmenu -i -p "$SCRIPTS_ICON scripts" -l "${#HUB[@]}" -no-custom -matching fuzzy)
if [[ -n "$CHOICE" ]]; then
SCRIPT_PATH="${HUB[$CHOICE]}"
if [[ -x "$SCRIPT_PATH" ]]; then
bash "$SCRIPT_PATH" &
else
notify-send "$SCRIPTS_TITLE" "Script not found or not executable at $SCRIPT_PATH" -a "Error"
fi
fi