From 4b43dedb78c7a0b956015c833e96460ffe1fd18c Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 7 Jun 2020 17:43:45 +0400 Subject: added host-specific configuration --- .local/bin/statusbar/disk | 7 ++++++- .local/bin/statusbar/volume | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to '.local') diff --git a/.local/bin/statusbar/disk b/.local/bin/statusbar/disk index 7d6b84d..67085e5 100755 --- a/.local/bin/statusbar/disk +++ b/.local/bin/statusbar/disk @@ -8,4 +8,9 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e ncdu '/home/andrew' ;; esac -echo "💽$(getDiskSpace "/home")" +host=$(hostname -s) +if [ "$host" = "laptop1" ]; then + echo "💽$(getDiskSpace "/")" +else + echo "💽$(getDiskSpace "/home")" +fi diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume index 673e591..ade5b98 100755 --- a/.local/bin/statusbar/volume +++ b/.local/bin/statusbar/volume @@ -67,11 +67,12 @@ percent = re.compile("(\d+)%") vol = None mute = False for sink in sinks.values(): - if 'JBL' in sink['Description']: + if 'JBL' in sink['Description']: # Headphones vol = int(percent.findall(sink['Volume'][0])[0]) mute = sink["Mute"] == "yes" break - elif 'Built-in' in sink['Description'] and vol is None: + # desktop and laptop sinks respectively + elif 'Built-in' in sink['Description'] or 'Family 17h' in sink['Description'] and vol is None: vol = int(percent.findall(sink['Volume'][0])[0]) mute = sink["Mute"] == "yes" @@ -79,6 +80,7 @@ for sink in sinks.values(): if vol is None or mute: print("🔇") + quit(0) if vol > 70: icon = "🔊" -- cgit v1.2.3