diff options
| author | Andrew <saintruler@gmail.com> | 2020-06-07 17:43:45 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2020-06-07 17:43:45 +0400 |
| commit | 4b43dedb78c7a0b956015c833e96460ffe1fd18c (patch) | |
| tree | 64d44e1892aecaf0dcbf3a1ba935699ee6caa419 | |
| parent | 8b7ceb75e293ce8229666e405aea6aa6b1dbd616 (diff) | |
added host-specific configuration
| -rwxr-xr-x | .local/bin/statusbar/disk | 7 | ||||
| -rwxr-xr-x | .local/bin/statusbar/volume | 6 |
2 files changed, 10 insertions, 3 deletions
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 = "🔊" |