commit d427693f43ba211e35f18adc877f5df48e4724db
parent eec12916e3b113825420c3e6731f87b770487245
Author: Benjamin Chausse <benjamin@chausse.xyz>
Date:   Sat, 17 Oct 2020 02:01:11 -0400

Add clickable elements to dwmblocks scripts

Diffstat:
M.local/bin/dwmbar/dwmb-date | 4++++
M.local/bin/dwmbar/dwmb-dotfiles | 4++++
M.local/bin/dwmbar/dwmb-layout | 4++++
M.local/bin/dwmbar/dwmb-news | 4++++
M.local/bin/dwmbar/dwmb-test | 4++++
M.local/bin/dwmbar/dwmb-vpn | 8++++++--
6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/.local/bin/dwmbar/dwmb-date b/.local/bin/dwmbar/dwmb-date @@ -1,3 +1,7 @@ #!/bin/sh date +"  %a %b %d " + +case $BLOCK_BUTTON in + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac diff --git a/.local/bin/dwmbar/dwmb-dotfiles b/.local/bin/dwmbar/dwmb-dotfiles @@ -13,3 +13,6 @@ fi echo " $warn " +case $BLOCK_BUTTON in + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac+ \ No newline at end of file diff --git a/.local/bin/dwmbar/dwmb-layout b/.local/bin/dwmbar/dwmb-layout @@ -1,3 +1,6 @@ #!/bin/sh echo "  $(cat $HOME/.cache/layout) " +case $BLOCK_BUTTON in + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac+ \ No newline at end of file diff --git a/.local/bin/dwmbar/dwmb-news b/.local/bin/dwmbar/dwmb-news @@ -2,3 +2,7 @@ nb=$(cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print " " $1}')$(cat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null) ") echo " $nb" +case $BLOCK_BUTTON in + 1) "$TERMINAL" -e newsboat ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac diff --git a/.local/bin/dwmbar/dwmb-test b/.local/bin/dwmbar/dwmb-test @@ -1,3 +1,6 @@ #!/bin/sh cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 99 | head -n 1 +case $BLOCK_BUTTON in + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac+ \ No newline at end of file diff --git a/.local/bin/dwmbar/dwmb-vpn b/.local/bin/dwmbar/dwmb-vpn @@ -6,9 +6,9 @@ vpnstatus=$(expressvpn status | head -n 1) case "$vpnstatus" in *"Not"*) icon="" ;; - *"Connected"*) icon="" + *"Connected"*) icon="" ;; - *"Connecting"*) icon=" " + *"Connecting"*) icon=" " ;; *) icon="" esac @@ -23,3 +23,7 @@ echo " $icon " # \033]01;34\] # blue # \033]01;33\] # bold yellow # s/onnected\sto\s//; +case $BLOCK_BUTTON in + 1) ~/.local/bin/vpnmenu ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac