mirror of
https://github.com/eepykate/fet.sh.git
synced 2026-11-28 20:58:16 +00:00
support more wms & a fair bit of DEs
This commit is contained in:
1 parent
0df4d1b969
commit
7e43f12610
1 file changed
+11
-5
@@ -27,25 +27,31 @@ done
|
|||||||
## WM
|
## WM
|
||||||
# requires the WM to include 'wm' or 'monad' (for you leon)
|
# requires the WM to include 'wm' or 'monad' (for you leon)
|
||||||
pg() {
|
pg() {
|
||||||
|
# i hate myself for this
|
||||||
|
[ $# = 1 ] && set -- $1 $1 $1 $1 $1
|
||||||
ab=
|
ab=
|
||||||
for i in /proc/[0-9]*; do
|
for i in /proc/[0-9]*; do
|
||||||
ab="$ab ${i##*/}"
|
ab="$ab ${i##*/}"
|
||||||
read -r a < "$i"/comm
|
read -r a < "$i"/comm
|
||||||
case $a in
|
case $a in
|
||||||
*$1*|*${2:-$1}*) echo "$a" "${i##*/}"; break;;
|
*$1*|*$2*|*$3*|*$4*|*$5*) echo "$a" "${i##*/}"; break;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "$DISPLAY" ] && {
|
if [ "$XDG_CURRENT_DESKTOP" ]; then
|
||||||
|
wm="$XDG_CURRENT_DESKTOP"
|
||||||
|
elif [ "$DESKTOP_SESSION" ]; then
|
||||||
|
wm="$DESKTOP_SESSION"
|
||||||
|
elif [ "$DISPLAY" ]; then
|
||||||
xorg="$(pg Xorg)"
|
xorg="$(pg Xorg)"
|
||||||
xorg="${xorg##* }"
|
xorg="${xorg##* }"
|
||||||
aa="$(pg wm monad)"
|
aa="$(pg wm monad box i3 tile)"
|
||||||
# make sure it was started near enough after the X server
|
# make sure it was started near enough after the X server
|
||||||
[ "${aa##* }" -gt "$xorg" ] &&
|
[ "${aa##* }" -gt "$xorg" ] &&
|
||||||
[ "${aa##* }" -lt "$((xorg + 20))" ] &&
|
[ "${aa##* }" -lt "$((xorg + 30))" ] &&
|
||||||
wm="${aa%% *}"
|
wm="${aa%% *}"
|
||||||
}
|
fi
|
||||||
|
|
||||||
## Distro
|
## Distro
|
||||||
. /etc/os-release # lol EZ
|
. /etc/os-release # lol EZ
|
||||||
|
|||||||
Reference in new issue
Block a user