diff --git a/lemonbar/.local/bin/lemonbar/lemonbar_config b/lemonbar/.local/bin/lemonbar/lemonbar_config index 6b4a9352b..a706acf88 100755 --- a/lemonbar/.local/bin/lemonbar/lemonbar_config +++ b/lemonbar/.local/bin/lemonbar/lemonbar_config @@ -12,7 +12,7 @@ #Created: # Tue 07 December 2021, 02:36:45 PM [GMT+1] #Modified: -# Sun 16 October 2022, 12:37:19 AM [GMT+1] +# Sun 06 November 2022, 05:24:52 PM [GMT] # #Description: # @@ -22,8 +22,11 @@ # # shellcheck disable=all +first=$(xrandr | grep -w connected | awk '{print $1}' | sed -n '1p') +second=$(xrandr | grep -w connected | awk '{print $1}' | sed -n '2p') + topleft() { - echo -e "%{l}$(lemonbar_workspaces)%{r}$(lemonbar_keyboard)$(lemonbar_sep)$(lemonbar_updates)$(lemonbar_sep)$(lemonbar_volume)$(lemonbar_sep)$(lemonbar_battery)$(lemonbar_sep)$(lemonbar_network)$(lemonbar_sep)$(lemonbar_clock)" + echo -e "%{l}$(lemonbar_workspaces $first)%{r}$(lemonbar_keyboard)$(lemonbar_sep)$(lemonbar_updates)$(lemonbar_sep)$(lemonbar_volume)$(lemonbar_sep)$(lemonbar_battery)$(lemonbar_sep)$(lemonbar_network)$(lemonbar_sep)$(lemonbar_clock)" } bottomleft() { @@ -31,7 +34,7 @@ bottomleft() { } topright() { - echo -e "%{l}$(lemonbar_workspaces)%{r}$(lemonbar_keyboard)$(lemonbar_sep)$(lemonbar_updates)$(lemonbar_sep)$(lemonbar_volume)$(lemonbar_sep)$(lemonbar_battery)$(lemonbar_sep)$(lemonbar_network)$(lemonbar_sep)$(lemonbar_clock)" + echo -e "%{l}$(lemonbar_workspaces $second)%{r}$(lemonbar_keyboard)$(lemonbar_sep)$(lemonbar_updates)$(lemonbar_sep)$(lemonbar_volume)$(lemonbar_sep)$(lemonbar_battery)$(lemonbar_sep)$(lemonbar_network)$(lemonbar_sep)$(lemonbar_clock)" } bottomright() { diff --git a/lemonbar/.local/bin/lemonbar/lemonbar_launch b/lemonbar/.local/bin/lemonbar/lemonbar_launch index 87701fe2a..667056445 100755 --- a/lemonbar/.local/bin/lemonbar/lemonbar_launch +++ b/lemonbar/.local/bin/lemonbar/lemonbar_launch @@ -13,23 +13,19 @@ killall -q lemonbar killall -q lemonbar_config topleft() { - lemonbar_config -tl | lemonbar -p -g 1920x18+0+0 -F "#C4C7C5" -B "#282A36" -U "#268bd2" -o eDP-1 -f "SauceCodePro Nerd Font" | $SHELL - #succade -s topleft + lemonbar_config -tl | lemonbar -p -g 1920x18+0+0 -F "#e5e9f0" -B "#283036" -U "#434c5e" -o -3 -f "Hack Nerd Font:size=10" -o -2 -f "Noto Sans CJK JP" | $SHELL } bottomleft() { - lemonbar_config -bl | lemonbar -p -b -g 1920x18+0+0 -F "#C4C7C5" -B "#282A36" -U "#268bd2" -o eDP-1 -f "SauceCodePro Nerd Font" | $SHELL - #succade -s bottomleft + lemonbar_config -bl | lemonbar -p -b -g 1920x18+0+0 -F "#e5e9f0" -B "#283036" -U "#434c5e" -o -3 -f "Hack Nerd Font:size=10" -o -2 -f "Noto Sans CJK JP" | $SHELL } topright() { - lemonbar_config -tr | lemonbar -p -g 1920x18+1920+0 -F "#C4C7C5" -B "#282A36" -U "#268bd2" -o HDMI-1-0 -f "SauceCodePro Nerd Font" | $SHELL - #succade -s topright + lemonbar_config -tr | lemonbar -p -g 1920x18+1920+0 -F "#e5e9f0" -B "#283036" -U "#434c5e" -o -3 -f "Hack Nerd Font:size=10" -o -2 -f "Noto Sans CJK JP" | $SHELL } bottomright() { - lemonbar_config -br | lemonbar -p -b -g 1920x18+1920+0 -F "#C4C7C5" -B "#282A36" -U "#268bd2" -o HDMI-1-0 -f "SauceCodePro Nerd Font" | $SHELL - #succade -s bottomright + lemonbar_config -br | lemonbar -p -b -g 1920x18+1920+0 -F "#e5e9f0" -B "#283036" -U "#434c5e" -o -3 -f "Hack Nerd Font:size=10" -o -2 -f "Noto Sans CJK JP" | $SHELL } if [ "$1" ]; then diff --git a/lemonbar/.local/bin/lemonbar/lemonbar_workspaces b/lemonbar/.local/bin/lemonbar/lemonbar_workspaces index 2610c01f3..3b6879436 100755 --- a/lemonbar/.local/bin/lemonbar/lemonbar_workspaces +++ b/lemonbar/.local/bin/lemonbar/lemonbar_workspaces @@ -1,51 +1,37 @@ #!/usr/bin/env bash -MON_IDX="0" -mapfile -t MONITOR_LIST < <(herbstclient list_monitors | cut -d":" -f1) -for ((i = 0; i < $((${#MONITOR_LIST[@]})); i++)); do - [[ ${MONITOR_LIST[${i}]} == "$MONITOR" ]] && MON_IDX="$i" -done +monitor=$1 -# Read tags into $tags as array -IFS=$'\t' read -ra tags <<<"$(herbstclient tag_status "${MON_IDX}")" -{ - for i in "${tags[@]}"; do - # Read the prefix from each tag and render them according to that prefix - case ${i:0:1} in - '.') - # the tag is empty - echo "%{B#283036}%{F#e5e9f0}" - ;; - ':') - # the tag is not empty - echo "%{B#59ff59}" - ;; - '+') - # the tag is viewed on the specified MONITOR, but this monitor is not focused. - echo "%{B#ff9c59}" - ;; - '#') - # the tag is viewed on the specified MONITOR and it is focused. - echo "%{B#ff59f9}" - ;; - '-') - # the tag is viewed on a different MONITOR, but this monitor is not focused. - echo "%{B#b56727}" - ;; - '%') - # the tag is viewed on a different MONITOR and it is focused. - echo "%{B#9059ff}" - ;; - '!') - # the tag contains an urgent window - echo "%{B#ff5959}" - ;; - esac - # focus the monitor of the current bar before switching tags - echo "%{A1:herbstclient focus_monitor ${MON_IDX}; herbstclient use ${i:1}:} ${i:1} %{A -u -o F- B-}" +workspaces() { + coloractive='%{F#283036}%{B#a6fffc}' + colorurgent='%{F#283036}%{B#ff5959}' + colorinactive='%{F#283036}%{B#59fff9}' + workspace_list="" + + length="$(i3-msg -t get_workspaces | jq -r '. | length')" + for i in $(seq "$length"); do + workspace=$(i3-msg -t get_workspaces | jq -j '.['"($i - 1)"']') + if [ "$(echo "$workspace" | jq -r '.output')" == "${monitor}" ]; then + if [ "$(echo "$workspace" | jq -r '.urgent')" = true ]; then + workspace_list+="$colorurgent" + elif [ "$(echo "$workspace" | jq -r '.focused')" != true ]; then + workspace_list+="$colorinactive" + else + workspace_list+="$coloractive" + fi + if [ "$(echo "$workspace" | jq -r '.num')" == "1" ]; then + workspace_list+=" δΈ€" + fi + ws=$(echo "$workspace" | jq -r '.name' | awk '{print $1,$2}') + workspace_list+=" ${ws} " + fi done - # reset foreground and background color to default - echo "%{F-}%{B-}" -} | tr -d "\n" + echo "$workspace_list" +} -echo +runme() { + printf "%s\r" "$(workspaces)" + sleep .1s +} + +runme diff --git a/lemonbar/.local/bin/lemonbar/succade b/lemonbar/.local/bin/lemonbar/succade deleted file mode 100755 index d4748f1ce..000000000 Binary files a/lemonbar/.local/bin/lemonbar/succade and /dev/null differ