- GTK-Style-Script und Template-System entfernt (Catppuccin fest) - 15 tote/inkompatible Scripts gelöscht (Hyprland, X11, Duplikate) - Rasi-Themes von Einzelordnern in themes/ konsolidiert - Waybar: Timezone fix, BAT0, JSON-Struktur, Icons restored - Waybar: GTK-Menu durch wlogout on-click ersetzt - Alle Script-Pfade auf /etc/xdg/rofi/themes/ aktualisiert - moonarch-session als Rofi-basierte Übergangslösung hinzugefügt - moonarch-dnd: broken pipe bei Waybar-Restart behoben - Style.css vom System übernommen
67 lines
1.6 KiB
Bash
Executable File
67 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# ABOUTME: Rofi script mode that lists desktop files from /usr/share/settings-menu/.
|
|
# ABOUTME: Used with rofi -show fb -modes "fb:moonarch-setmen" for a settings launcher.
|
|
|
|
####
|
|
# @author moonarch.de (nevaforget)
|
|
# script used with rofi to list desktop files of specific dir
|
|
# dir: /usr/share/settings-menu/
|
|
# @example rofi -show fb -modes "fb:moonarch-setmen" -theme /etc/xdg/rofi/themes/settings-menu.rasi
|
|
# @dependencies glib >= 2.67.2
|
|
####
|
|
|
|
function get_name {
|
|
local lang=$(locale | grep LANG | cut -d= -f2 | cut -d_ -f1)
|
|
local find="Name\[$lang\]="
|
|
|
|
local name=$(grep "^$find" $1 | tail -1 | sed "s/^$find//" | sed 's/%.//' | sed 's/^"//g' | sed 's/" *$//g')
|
|
|
|
if [ "${name}" = "" ]
|
|
then
|
|
find="Name="
|
|
name=$(grep "^$find" $1 | tail -1 | sed "s/^$find//" | sed 's/%.//' | sed 's/^"//g' | sed 's/" *$//g')
|
|
fi
|
|
|
|
echo "$name"
|
|
}
|
|
|
|
if [ "$ROFI_RETV" = "1" ]
|
|
then
|
|
for deskfile in /usr/share/settings-menu/*
|
|
do
|
|
match=$(grep "^Name" $deskfile | grep "$@" )
|
|
|
|
if [ -n "$match" ]
|
|
then
|
|
#gio launch $deskfile
|
|
|
|
# old way
|
|
app=$(grep '^Exec' $deskfile | tail -1 | sed 's/^Exec=//' | sed 's/%.//' | sed 's/^"//g' | sed 's/" *$//g')
|
|
coproc ( $app > /dev/null 2>&1 )
|
|
|
|
break
|
|
fi
|
|
|
|
done
|
|
exit 0
|
|
fi
|
|
|
|
function init {
|
|
for file in /usr/share/settings-menu/*
|
|
do
|
|
local name=$(get_name "$file")
|
|
|
|
local iconline=$(sed -n -e '/^Icon=/p' "$file")
|
|
local icon=${iconline/Icon=/""}
|
|
|
|
if [ -n "$name" ]
|
|
then
|
|
echo -en "$name\0icon\x1f$icon\n"
|
|
|
|
fi
|
|
|
|
done
|
|
}
|
|
|
|
init
|