Cursor theme/size handling
This commit is contained in:
41
usr/bin/jgcursor
Executable file
41
usr/bin/jgcursor
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# jgcursor pipemenu to configure cursor theme and size
|
||||
# To hook it into some menu use:
|
||||
# Cursor,^pipe(jgcursor)
|
||||
GTK3RC="$HOME/.config/gtk-3.0/settings.ini"
|
||||
|
||||
case $LANG in
|
||||
pl*)
|
||||
_CURSOR="Kursor"
|
||||
_THEME="motyw"
|
||||
_SIZE="rozmiar"
|
||||
;;
|
||||
*)
|
||||
_CURSOR="Cursor"
|
||||
_THEME="theme"
|
||||
_SIZE="size"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
read CURTHEME <<< "$(rg gtk-cursor-theme-name ${GTK3RC} | cut -d'=' -f2)"
|
||||
read CURSIZE <<< "$(rg gtk-cursor-theme-size ${GTK3RC} | cut -d'=' -f2)"
|
||||
|
||||
o+=("<big> </big> $_CURSOR: <b>$CURTHEME</b> $_SIZE: <b>$CURSIZE</b>")
|
||||
o+=("^sep($_THEME)")
|
||||
while read -r line; do
|
||||
|
||||
lin=${line::-8}
|
||||
li=${lin##*/}
|
||||
[[ "${CURTHEME}" = "${li}" ]] && o+=("<big>綠</big> <b>${li}</b>") || o+=("<big>祿</big> ${li},mb-cursor theme ${li}")
|
||||
|
||||
done < <(find /usr/share/icons ~/.local/share/icons ~/.icons -type d -name "cursors")
|
||||
|
||||
o+=("^sep($_SIZE)")
|
||||
for c in 16 24 32 48 64;do
|
||||
[[ "${CURSIZE}" == "${c}" ]] && o+=("<big>綠</big> <b>${c}</b>") || o+=("<big>祿</big> ${c},mb-cursor size ${c}")
|
||||
done
|
||||
|
||||
printf "%s\n" "${o[@]}"
|
||||
|
||||
Reference in New Issue
Block a user