Skip to content

Commit

Permalink
show only username if fullname not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
reorr committed Nov 7, 2018
1 parent f662055 commit 0f56275
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mantablockscreen
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ cachepath=$HOME/.cache/mantablockscreen
cropuser=$cachepath/$USER-pic-crop.png
fullname=`getent passwd $USER | cut -d ":" -f 5`
full_alias="${fullname} (${USER})"
if [[ -n $fullname ]]; then
full_alias="${fullname} (${USER})"
else
full_alias=$USER
fi

width=$(xrandr --query | grep ' connected' | grep -o '[0-9][0-9]*x[0-9][0-9]*[^ ]*' | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' |cut -d "x" -f 1)
height=$(xrandr --query | grep ' connected' | grep -o '[0-9][0-9]*x[0-9][0-9]*[^ ]*' | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' |cut -d "x" -f 2)
Expand Down

0 comments on commit 0f56275

Please sign in to comment.