mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-15 23:46:12 +00:00
DE/WM information has been converted to a Golang function
This commit is contained in:
@@ -11,11 +11,10 @@ if [ ! -z "$GPU_MODEL" ]; then
|
||||
fi
|
||||
echo -e "${C3}Memory: ${C4}${MEM_USED} MiB / ${MEM_TOTAL} MiB"
|
||||
if xhost >& /dev/null ; then
|
||||
if get_de_wm &> /dev/null; then
|
||||
echo -e "${C3}DE/WM: ${C4}$(get_de_wm)"
|
||||
if [ ! -z "$DE_WM" ]; then
|
||||
echo -e "${C3}DE/WM: ${C4}${DE_WM}"
|
||||
fi
|
||||
if command_exists xdpyinfo ; then
|
||||
echo -e "${C3}Screen Resolution: ${C4}$(get_screen_resolution)"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -34,32 +34,6 @@ get_shell() {
|
||||
esac
|
||||
}
|
||||
|
||||
get_de_wm() {
|
||||
if ps -e | grep "plasmashell" &> /dev/null ; then
|
||||
echo "KDE Plasma $(plasmashell --version | awk '{print $2}')"
|
||||
elif ps -e | grep "gnome-session" &> /dev/null ; then
|
||||
echo "Gnome $(gnome-shell --version | awk '{print $3}')"
|
||||
elif ps -e | grep "xfce4-session" &> /dev/null ; then
|
||||
echo "XFCE $(xfce4-session --version | grep xfce4-session | awk '{print $2}')"
|
||||
elif ps -e | grep "cinnamon" &> /dev/null ; then
|
||||
echo "Cinnamon $(cinnamon --version | awk '{print $2}')"
|
||||
elif ps -e | grep "mate-panel" &> /dev/null ; then
|
||||
echo "Mate $(mate-about --version | awk '{print $4}')"
|
||||
elif ps -e | grep "lxsession" &> /dev/null ; then
|
||||
echo "LXDE"
|
||||
elif ps -e | grep "sway" &> /dev/null ; then
|
||||
echo "Sway $(sway --version | awk '{print $2}')"
|
||||
elif ps -e | grep "bspwm" &> /dev/null ; then
|
||||
echo "Bspwm $(bspwm -v)"
|
||||
elif ps -e | grep "icewm-session" &> /dev/null ; then
|
||||
echo "IceWM $(icewm --version | awk '{print $2}' | sed 's/,//g')"
|
||||
elif [ ! -z $DESKTOP_SESSION ]; then
|
||||
echo "$DESKTOP_SESSION"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_screen_resolution() {
|
||||
if xhost >& /dev/null && command_exists xdpyinfo; then
|
||||
xdpyinfo | grep dimensions | tr -s ' ' | cut -d " " -f3
|
||||
|
||||
Reference in New Issue
Block a user