diff --git a/herbstluftwm/hl_constants.pyc b/herbstluftwm/hl_constants.pyc new file mode 100644 index 0000000..f2e7282 Binary files /dev/null and b/herbstluftwm/hl_constants.pyc differ diff --git a/herbstluftwm/hl_status_deamon.py b/herbstluftwm/hl_status_deamon.py index dfb8530..fc12564 100755 --- a/herbstluftwm/hl_status_deamon.py +++ b/herbstluftwm/hl_status_deamon.py @@ -74,7 +74,7 @@ def battery(): plain = int(bat.split('%')[0][-3:].rstrip('%').lstrip(',')) ## imediatelly return if full and on supply ## - if bat.startswith("Full") or bat.startswith('Unknown'): + if bat.startswith("Full") or bat.startswith('Unknown') or "Charging, 100%" in bat: return hl_utils.color_panel("On Supply and fully charged",GREEN) ## calculate average time remaining ## @@ -180,6 +180,7 @@ def ip_status(): last_ip = ip tmp = hl_utils.color_panel(ip,GREEN) except: + last_ip = "" tmp = hl_utils.color_panel("Offline",RED) with open(hl_utils.hlpath(IP_LOG),'w') as g: g.write(tmp) diff --git a/herbstluftwm/hl_utils.pyc b/herbstluftwm/hl_utils.pyc new file mode 100644 index 0000000..f7e4819 Binary files /dev/null and b/herbstluftwm/hl_utils.pyc differ diff --git a/herbstluftwm/panel_pid_atlantislaptop b/herbstluftwm/panel_pid_atlantislaptop new file mode 100644 index 0000000..0863ce1 --- /dev/null +++ b/herbstluftwm/panel_pid_atlantislaptop @@ -0,0 +1 @@ +30403 diff --git a/herbstluftwm/panel_right_side.sh b/herbstluftwm/panel_right_side.sh new file mode 100755 index 0000000..c399b24 --- /dev/null +++ b/herbstluftwm/panel_right_side.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +source uniq_linebuffered.sh + +### Generates the output for the rightside of the panel ### + +hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ;} + +hc pad $monitor $panel_height +{ + while true ; do + printf 'pystat\t%s\n' "$($HOME/.config/herbstluftwm/hl_panel_content.py)" + sleep 1 || break + done > >(uniq_linebuffered) & + + ## save pid and wait for signal ## + childpid=$! + hc --idle + kill $childpid +} diff --git a/herbstluftwm/t b/herbstluftwm/t new file mode 100644 index 0000000..e69de29 diff --git a/herbstluftwm/uniq_linebuffered.sh b/herbstluftwm/uniq_linebuffered.sh new file mode 100755 index 0000000..a2cd7da --- /dev/null +++ b/herbstluftwm/uniq_linebuffered.sh @@ -0,0 +1,10 @@ +#!/bin/bash +if awk -Wv 2>/dev/null | head -1 | grep -q '^mawk'; then + uniq_linebuffered() { + awk -W interactive '$0 != l { print ; l=$0 ; fflush(); }' "$@" + } +else + uniq_linebuffered() { + awk '$0 != l { print ; l=$0 ; fflush(); }' "$@" + } +fi