mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2024-11-24 16:28:41 -05:00
Fix bars
This commit is contained in:
parent
d0616195a4
commit
c018284023
@ -1,2 +1,2 @@
|
||||
LastUsed=1692532332
|
||||
LastUsed=1692536262
|
||||
Message='Fully Updated'
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user