mirror of
				https://github.com/tiyn/dotfiles.git
				synced 2025-10-31 20:41:16 +01:00 
			
		
		
		
	dwmblocks/statusbar: starting to add clickable buttons
LukeSmith made a guide on how to set this up. I did it analog to him. - clock shows the calendar - internet shows nmtui
This commit is contained in:
		| @@ -1,8 +1,5 @@ | |||||||
| #!/usr/bin/env sh | #!/usr/bin/env sh | ||||||
|  |  | ||||||
| # Give a battery name (e.g. BAT0) as an argument. |  | ||||||
| # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice |  | ||||||
|  |  | ||||||
| capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit | capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit | ||||||
| time=$(acpi | awk '{ print $5 }') | time=$(acpi | awk '{ print $5 }') | ||||||
| status=$(cat /sys/class/power_supply/"$1"/status) | status=$(cat /sys/class/power_supply/"$1"/status) | ||||||
|   | |||||||
| @@ -1,5 +1,7 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  |  | ||||||
| # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice |  | ||||||
|  |  | ||||||
| date +" %d %b %H:%M" | date +" %d %b %H:%M" | ||||||
|  |  | ||||||
|  | case $BLOCK_BUTTON in | ||||||
|  | 	1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" ;; | ||||||
|  | esac | ||||||
|   | |||||||
| @@ -1,5 +1,3 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  |  | ||||||
| # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice |  | ||||||
|  |  | ||||||
| sensors | awk '/Core 0/ {print " " $3}' | sensors | awk '/Core 0/ {print " " $3}' | ||||||
|   | |||||||
| @@ -2,13 +2,10 @@ | |||||||
|  |  | ||||||
| # Status bar module for disk space | # Status bar module for disk space | ||||||
| # $1 should be drive mountpoint | # $1 should be drive mountpoint | ||||||
| # $2 is optional icon, otherwise mountpoint will displayed |  | ||||||
| # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice |  | ||||||
|  |  | ||||||
| disk="/" | disk="/" | ||||||
| [ ! -z "$1" ] && disk="$1" | [ ! -z "$1" ] && disk="$1" | ||||||
|  |  | ||||||
| icon="$2" | icon="$disk" | ||||||
| [ -z "$2" ] && icon="$disk" |  | ||||||
|  |  | ||||||
| printf " %s %s\n" "$icon" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')" | printf " %s %s\n" "$icon" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')" | ||||||
|   | |||||||
| @@ -1,9 +1,11 @@ | |||||||
| #!/usr/bin/env sh | #!/usr/bin/env sh | ||||||
|  |  | ||||||
| # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice |  | ||||||
|  |  | ||||||
| [ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="" | [ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="" | ||||||
|  |  | ||||||
| [ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70) "%" }') | [ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70) "%" }') | ||||||
|  |  | ||||||
| printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down//;s/up//")" "$wifiicon" | printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down//;s/up//")" "$wifiicon" | ||||||
|  |  | ||||||
|  | case $BLOCK_BUTTON in | ||||||
|  | 	1) $TERMINAL -e "nmtui" ;; | ||||||
|  | esac | ||||||
|   | |||||||
| @@ -1,5 +1,3 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  |  | ||||||
| # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice |  | ||||||
|  |  | ||||||
| free -h | awk '/^Mem:/ {print " " $3 "/" $2}' | free -h | awk '/^Mem:/ {print " " $3 "/" $2}' | ||||||
|   | |||||||
| @@ -1,7 +1,5 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  |  | ||||||
| # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice |  | ||||||
|  |  | ||||||
| [ "$(pulsemixer --get-mute)" = "1" ] && printf "\\n" && exit | [ "$(pulsemixer --get-mute)" = "1" ] && printf "\\n" && exit | ||||||
|  |  | ||||||
| vol=$(pulsemixer --get-volume | awk '{print $1}') | vol=$(pulsemixer --get-volume | awk '{print $1}') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user