From c018284023294b80f25a5f7a6021fd5b4915fc1d Mon Sep 17 00:00:00 2001 From: The-Repo-Club Date: Sun, 20 Aug 2023 13:57:43 +0100 Subject: [PATCH] Fix bars --- .../flexiflow/flexiflow_bar/bar_updates.ini | 2 +- .../.local/bin/flexiflow_bar/bar_desktop | 16 +++++++++------- .../.local/bin/flexiflow_bar/bar_updates | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/flexiflow/.config/flexiflow/flexiflow_bar/bar_updates.ini b/flexiflow/.config/flexiflow/flexiflow_bar/bar_updates.ini index 8d50f4303..fdd198a35 100644 --- a/flexiflow/.config/flexiflow/flexiflow_bar/bar_updates.ini +++ b/flexiflow/.config/flexiflow/flexiflow_bar/bar_updates.ini @@ -1,2 +1,2 @@ -LastUsed=1692532332 +LastUsed=1692536262 Message='Fully Updated' diff --git a/flexiflow_bar/.local/bin/flexiflow_bar/bar_desktop b/flexiflow_bar/.local/bin/flexiflow_bar/bar_desktop index 1a6116868..eff17d3b6 100755 --- a/flexiflow_bar/.local/bin/flexiflow_bar/bar_desktop +++ b/flexiflow_bar/.local/bin/flexiflow_bar/bar_desktop @@ -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 diff --git a/flexiflow_bar/.local/bin/flexiflow_bar/bar_updates b/flexiflow_bar/.local/bin/flexiflow_bar/bar_updates index a66e6f39c..6d77d7eb8 100755 --- a/flexiflow_bar/.local/bin/flexiflow_bar/bar_updates +++ b/flexiflow_bar/.local/bin/flexiflow_bar/bar_updates @@ -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 }