Skip to content

Commit

Permalink
try new method to get term #69
Browse files Browse the repository at this point in the history
  • Loading branch information
wick3dr0se committed Dec 24, 2021
1 parent 0684952 commit 4ecb274
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sys/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ is "$distro" *"Arch"* && distro="$distro (btw)"
# taken from uname

# /TERM/ get terminal from 2nd field of pstree output (need new method)
comm pstree && term=$(pstree -sA $$ | awk -F--- '{print $2 ; exit}')
term=${term/-/ }
shell=${SHELL##*/}
while read -r line ; do
case $line in
'`-'*) line=${line#\`-*} ; term=${line%%-+-*} ;;
esac
done < <(pstree | grep "$shell")

# /SHELL/ check shell environment variable
var $SHELL && shell=${SHELL##*/}
# taken above in /TERM/

# /DE/WM/ get desktop environment or window manager
if var $XDG_CURRENT_DESKTOP ; then
Expand Down

0 comments on commit 4ecb274

Please sign in to comment.