summaryrefslogtreecommitdiffstats
path: root/eww/scripts/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'eww/scripts/fetch')
-rwxr-xr-xeww/scripts/fetch34
1 files changed, 34 insertions, 0 deletions
diff --git a/eww/scripts/fetch b/eww/scripts/fetch
new file mode 100755
index 0000000..931bf30
--- /dev/null
+++ b/eww/scripts/fetch
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+os() {
+ source /etc/os-release
+ echo $PRETTY_NAME | awk '{print $1;}'
+
+}
+
+wm() {
+ wm=$XDG_CURRENT_DESKTOP
+ [ "$wm" ] || wm=$DESKTOP_SESSION
+
+ ## WM/DE
+ [ ! "$wm" ] &&
+ # loop over all processes and check the binary name
+ for i in /proc/*/comm; do
+ read -r c <"$i"
+ case $c in
+ *bar*) ;;
+ awesome | xmonad* | qtile | sway | i3 | [bfo]*box | *wm*)
+ wm=${c%%-*}
+ break
+ ;;
+ esac
+ done
+
+ echo $wm
+}
+
+shell() {
+ basename $SHELL
+}
+
+"$@"