7 Commits
Author SHA1 Message Date
gk 43152b2837 Don't overwrite $wm with another DE variable if the first one worked 2020-09-18 09:04:44 +10:00
gk 0d8ab196c4 add better support for GNOME
also known as the foot DE
2020-08-31 19:03:39 +10:00
gk ea9abc7ffb Don't detect sandbox as WM (Closes #23)
Check if string starts with 'b', 'f', or 'o' and ends with 'box' (blackbox, fluxbox, openbox)
2020-08-27 04:52:50 +10:00
gk accf87f751 Add debian package support 2020-08-27 04:37:25 +10:00
gk 7d2097cf00 Merge pull request #21 from aosync/master
Added package info for KISS Linux
2020-08-25 18:58:59 +10:00
Alejandro Sior 1a4ecf462b Added KISS package 2020-08-25 08:58:19 +00:00
GaugeK 81d4666525 Make sure not to do an infinite loop 2020-08-25 12:45:18 +10:00
2 changed files with 13 additions and 5 deletions

No files matched your search

+1
View File
@@ -9,6 +9,7 @@ fetch written in POSIX shell with no external commands
**Arch:** [fet.sh-git](https://aur.archlinux.org/packages/fet.sh-git/) (AUR) **Arch:** [fet.sh-git](https://aur.archlinux.org/packages/fet.sh-git/) (AUR)
**Nix:** [fet-sh](https://search.nixos.org/packages?show=fet-sh&query=fet-sh&channel=unstable) (nixpkgs-unstable) **Nix:** [fet-sh](https://search.nixos.org/packages?show=fet-sh&query=fet-sh&channel=unstable) (nixpkgs-unstable)
**Gentoo:** [app-misc/fetsh](https://gpo.zugaina.org/Overlays/guru/app-misc/fetsh) (GURU overlay) **Gentoo:** [app-misc/fetsh](https://gpo.zugaina.org/Overlays/guru/app-misc/fetsh) (GURU overlay)
**KISS:** [fetsh](https://github.com/kisslinux/community/tree/master/community/fetsh) (Community)
**Other Distros:** copy `fet.sh` to somewhere in $PATH **Other Distros:** copy `fet.sh` to somewhere in $PATH
### Customization ### Customization
+12 -5
View File
@@ -17,7 +17,7 @@ eq() { # equals | [ a = b ] with globbing
## DE ## DE
wm="$XDG_CURRENT_DESKTOP" wm="$XDG_CURRENT_DESKTOP"
wm="$DESKTOP_SESSION" [ "$wm" ] || wm="$DESKTOP_SESSION"
## Distro ## Distro
# freedesktop.org/software/systemd/man/os-release.html # freedesktop.org/software/systemd/man/os-release.html
@@ -36,8 +36,13 @@ if [ -e /proc/$$/comm ]; then
eq "$line" "PPid*" && ppid=${line##*:?} && break eq "$line" "PPid*" && ppid=${line##*:?} && break
done < "/proc/${ppid:-$PPID}/status" done < "/proc/${ppid:-$PPID}/status"
# Make sure not to do an infinite loop
[ "$pppid" = "$ppid" ] && break
pppid="$ppid"
# get name of binary # get name of binary
read -r name < "/proc/$ppid/comm" read -r name < "/proc/$ppid/comm"
case $name in case $name in
*sh|"${0##*/}") ;; # skip shells *sh|"${0##*/}") ;; # skip shells
*[Ll]ogin*|*init*) break;; # exit when the top is reached *[Ll]ogin*|*init*) break;; # exit when the top is reached
@@ -46,14 +51,12 @@ if [ -e /proc/$$/comm ]; then
done done
## WM/DE ## WM/DE
# standard variables, mostly used for DEs [ ! "$wm" ] &&
[ "$DISPLAY" ] && [ ! "$wm" ] &&
# non-standard WMs
# loop over all processes and check the binary name # loop over all processes and check the binary name
for i in /proc/*/comm; do for i in /proc/*/comm; do
read -r c < "$i" read -r c < "$i"
case $c in case $c in
awesome|xmonad*|qtile|sway|i3|*box*|*wm*) wm="${c%%-*}"; break;; awesome|xmonad*|qtile|sway|i3|[bfo]*box|*wm*) wm="${c%%-*}"; break;;
esac esac
done done
@@ -94,6 +97,7 @@ if [ -e /proc/$$/comm ]; then
set -- set --
[ -d /var/db/kiss/installed ] && set -- /var/db/kiss/installed/* [ -d /var/db/kiss/installed ] && set -- /var/db/kiss/installed/*
[ -d /var/lib/pacman/local ] && set -- /var/lib/pacman/local/[0-9a-z]* [ -d /var/lib/pacman/local ] && set -- /var/lib/pacman/local/[0-9a-z]*
[ -d /var/lib/dpkg/info ] && set -- /var/lib/dpkg/info/*.list
[ -d /var/db/xbps ] && set -- /var/db/xbps/.* [ -d /var/db/xbps ] && set -- /var/db/xbps/.*
[ -d /var/db/pkg ] && set -- /var/db/pkg/*/* # gentoo [ -d /var/db/pkg ] && set -- /var/db/pkg/*/* # gentoo
pkgs=${###0} pkgs=${###0}
@@ -198,6 +202,9 @@ fi
eq "$0" "*fetish" && printf 'Step on me daddy\n' && exit eq "$0" "*fetish" && printf 'Step on me daddy\n' && exit
# help i dont know if it's a capital consistently
eq "$wm" "*[Gg][Nn][Oo][Mm][Ee]*" && wm="foot DE"
## GTK ## GTK
while read -r line; do while read -r line; do
eq "$line" "gtk-theme*" && gtk="${line##*=}" && break eq "$line" "gtk-theme*" && gtk="${line##*=}" && break