mirror of
https://github.com/zedsalim/debian-z.git
synced 2025-12-15 07:39:30 +00:00
Initial Commit
This commit is contained in:
parent
f18da1cc25
commit
a5bc6b13c5
96 changed files with 6936 additions and 0 deletions
35
config/scripts/themes.sh
Executable file
35
config/scripts/themes.sh
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd ~/.config/scripts/themes
|
||||
|
||||
# List all the themes
|
||||
themes=(*.sh)
|
||||
theme_names=()
|
||||
|
||||
# Loop through the themes and collect their names
|
||||
for theme in "${themes[@]}"; do
|
||||
theme_names+=("${theme%.sh}")
|
||||
done
|
||||
|
||||
# Prompt the user to select a theme using dmenu
|
||||
selected_theme=$(printf '%s\n' "${theme_names[@]}" | rofi -dmenu -p "Select a theme:")
|
||||
|
||||
# Find the selected theme
|
||||
selected_index=-1
|
||||
for index in "${!theme_names[@]}"; do
|
||||
if [[ "${theme_names[$index]}" == "$selected_theme" ]]; then
|
||||
selected_index=$index
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if a valid theme was selected
|
||||
if [ "$selected_index" -eq -1 ]; then
|
||||
echo "Invalid theme"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the name of the selected theme
|
||||
selected_theme_file="${themes[$selected_index]}"
|
||||
source "$selected_theme_file"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue