fix #10 and #13. Various other fixes and small changes

This commit is contained in:
Kievits Rene
2022-05-25 11:27:03 +02:00
parent b5f513a344
commit ff202de163
28 changed files with 1664 additions and 1280 deletions

48
awesome/src/scripts/pfp.sh Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
case $1 in
"userPfp")
iconPath="/var/lib/AccountsService/icons/$USER"
userIconPath="$HOME/.config/awesome/src/assets/userpfp/"
if [[ -f "$userIconPath" ]];
then
if [[ -f "$iconPath" ]];
then
if ! cmp --silent "$userIconPath.png" "$iconPath";
then
cp "$iconPath" "$userIconPath$USER.png"
fi
printf "$userIconPath.png"
else
printf "$userIconPath.png"
fi
exit;
else
if [[ -f "$iconPath" ]];
then
cp "$iconPath" "$userIconPath$USER.png"
printf "$userIconPath$USER.png"
exit;
fi
fi
;;
"userName")
fullname="$(getent passwd `whoami` | cut -d ':' -f 5)"
user="$(whoami)"
host="$(hostname)"
if [[ "$2" == "userhost" ]];
then
printf "$user@$host"
elif [[ "$2" == "fullname" ]];
then
printf "$fullname"
else
printf "Rick Astley"
fi
;;
esac