mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2024-11-28 10:18:46 -05:00
30 lines
757 B
Bash
Executable File
30 lines
757 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
desktop() {
|
|
icon=""
|
|
|
|
if [[ ! -z "$XDG_CURRENT_DESKTOP" ]]; then
|
|
desktop="$XDG_CURRENT_DESKTOP"
|
|
elif [[ ! -z "$XDG_SESSION_DESKTOP" ]]; then
|
|
desktop="$XDG_SESSION_DESKTOP"
|
|
elif [[ ! -z "$DESKTOP_SESSION" ]]; then
|
|
desktop="$DESKTOP_SESSION"
|
|
fi
|
|
|
|
if [[ -z $desktop ]] ; then
|
|
id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)
|
|
id=${id##* }
|
|
desktop=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)
|
|
desktop=${desktop/*WM_NAME = }
|
|
desktop=${desktop/\"}
|
|
desktop=${desktop/\"*}
|
|
desktop=$(echo $desktop | sed 's/[\].*$//')
|
|
else
|
|
desktop="Can not detech desktop"
|
|
fi
|
|
|
|
printf " %s %s \n" "$icon" "$desktop"
|
|
}
|
|
|
|
desktop
|