From af120ab348f2e1a5a39dec035ed9dcf84189a64e Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Mon, 3 Oct 2022 21:42:20 +0530 Subject: dotfiles --- eww/scripts/fetch | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 eww/scripts/fetch (limited to 'eww/scripts/fetch') 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 +} + +"$@" -- cgit v1.2.3-59-g8ed1b