This commit is contained in:
The-Repo-Club 2023-08-20 13:57:43 +01:00
parent d0616195a4
commit c018284023
No known key found for this signature in database
GPG Key ID: E30EC2FBFB05C44F
3 changed files with 13 additions and 11 deletions

View File

@ -1,2 +1,2 @@
LastUsed=1692532332
LastUsed=1692536262
Message='Fully Updated'

View File

@ -1,7 +1,9 @@
#!/usr/bin/env bash
desktop() {
icon=""
. $HOME/.config/flexiflow_bar/bar_themes/minimal-mistakes
icon="  "
if [[ -n "$XDG_CURRENT_DESKTOP" ]]; then
desktop="$XDG_CURRENT_DESKTOP"
@ -9,21 +11,21 @@ desktop() {
desktop="$XDG_SESSION_DESKTOP"
elif [[ -n "$DESKTOP_SESSION" ]]; then
desktop="$DESKTOP_SESSION"
fi
if [[ -z $desktop ]]; then
else
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=$(echo "$desktop" | sed 's/[\].*$//')
fi
if [[ -z $desktop ]]; then
desktop="Can not detech desktop"
fi
printf " %s %s \n" "$icon" "$desktop"
printf " %s %s \n" "^c$Foreground^^b$Red^$icon" "^c$Foreground^^b$Red_Bright^ $desktop"
}
desktop

View File

@ -18,17 +18,17 @@ get_updates() {
fi
[[ -f $configFile ]] && . $configFile
if [[ -z "$LastUsed" ]] || [[ -z "$Message" ]]; then
printf " %s %s \n" "^c$Foreground^^b$Red^$icon" "^c$Foreground^^b$Red_Bright^$updatecount"
printf " %s %s \n" "^c$Foreground^^b$Purple^$icon" "^c$Foreground^^b$Purple_Bright^$updatecount"
newtime=$(expr $timestamp + 900)
echo -e "LastUsed=${newtime}\nMessage='${updatecount}'" >$configFile
else
if [[ "$timestamp" -ge "$LastUsed" ]]; then
printf " %s %s \n" "^c$Foreground^^b$Red^$icon" "^c$Foreground^^b$Red_Bright^$updatecount"
printf " %s %s \n" "^c$Foreground^^b$Purple^$icon" "^c$Foreground^^b$Purple_Bright^$updatecount"
newtime=$(expr $timestamp + 900)
echo -e "LastUsed=${newtime}\nMessage='${updatecount}'" >$configFile
else
updatecount=" $Message"
printf " %s %s \n" "^c$Foreground^^b$Red^$icon" "^c$Foreground^^b$Red_Bright^$updatecount"
printf " %s %s \n" "^c$Foreground^^b$Purple^$icon" "^c$Foreground^^b$Purple_Bright^$updatecount"
fi
fi
}