New backup 2025-11-28 11:15:01

This commit is contained in:
Penelope Gwen 2025-11-28 11:15:01 -08:00
parent 745d748571
commit 355db9c28a
2 changed files with 33 additions and 32 deletions

View file

@ -39,32 +39,28 @@ get_hardcoded_icon() {
get_desktop() {
app="$1"
plist=("/usr/share/applications", "/var/lib/flatpak/exports/share/applications/")
p="/usr/share/applications"
f="/var/lib/flatpak/exports/share/applications"
[[ "$verbose" ]] && echo "searching for '$app'" >&2
# fast and easy cases first:
for p in "${plist[@]}";do
for prefix in "" org.kde. org.gnome. org.freedesktop.; do
d="$p/$prefix$app.desktop"
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
return
}
done
for prefix in "" org.kde. org.gnome. org.freedesktop.; do
d="$p/$prefix$app.desktop"
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
return
}
done
# maybe lowercase
for p in "${plist[@]}";do
for prefix in "" org.kde. org.gnome. org.freedesktop.; do
d="$p/$prefix${app,,}.desktop"
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
return
}
done
for prefix in "" org.kde. org.gnome. org.freedesktop.; do
d="$p/$prefix${app,,}.desktop"
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
return
}
done
# this is fairly reliable but slow:
# look for a .desktop file with Exec=$app eg
@ -72,7 +68,14 @@ get_desktop() {
# gnome-font-viewer
GREP='egrep -r'
type rg &>/dev/null && GREP=rg
d=$( $GREP -il "^exec=$app( %u)*[[:space:]]*$" ${p[@]} | head -n 1)
d=$( $GREP -il "^exec=$app( %u)*[[:space:]]*$" $p | head -n 1)
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
return
}
d=$( $GREP -il "^startupwmclass=$app.*$" ${f}/*.desktop | head -n 1)
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
@ -81,14 +84,12 @@ get_desktop() {
# desperation - weird apps like com.github.wwmm.pulseeffects.desktop!!
# shellcheck disable=SC2012
for p in "${plist[@]}";do
d=$( ls "$p/"*".$app.desktop" 2>/dev/null | head -n 1 )
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
return
}
done
d=$( ls "$p/"*".$app.desktop" 2>/dev/null | head -n 1 )
[[ -r "$d" ]] && {
echo "$d"
[[ "$verbose" ]] && echo "found '$d'" >&2
return
}
}
get_icon() {
@ -123,8 +124,8 @@ get_icon() {
/usr/share/icons/gnome/48x48/apps
/usr/share/icons/gnome/48x48/devices
/usr/share/pixmaps
/var/lib/flatpak/exports/share/icons/hicolor/scalable/apps/
/var/lib/flatpak/exports/share/icons/hicolor/48x48/apps/
/var/lib/flatpak/exports/share/icons/hicolor/scalable/apps
/var/lib/flatpak/exports/share/icons/hicolor/48x48/apps
# icons/hicolor/scalable/apps
# icons/hicolor/48x48/apps
# icons/gnome/48x48/apps

View file

@ -1,5 +1,5 @@
.powermenu {
margin: 0px 5px;
$module-color: mix($color9, $color5, 50%);
$module-color: mix($color0, $color5, 50%);
@import "./styles/revealer.scss"
}