Switch to qtile.

This commit is contained in:
Bartek Stalewski 2022-07-30 01:02:25 +02:00
parent afdf3d4bcd
commit e06cbc44a9
34 changed files with 34 additions and 40 deletions

4
_desktop/_scripts/sb-emerge Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
icon='\ue20f '
[ $(pgrep -x emerge) ] && printf "$icon <span foreground='#ffffff'background='#9a37ff'>emerge</span>" || printf ""

10
_desktop/_scripts/sb-network Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
icon='\uf1eb '
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) printf "$icon <span background='#770000'>no wifi</span>" ;;
up)
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
&& printf "$icon $(iw dev wlan0 info | grep 'ssid ' | cut -d' ' -f2-)" \
|| printf "$icon <span background='#770000'>no ip</span>"
esac

5
_desktop/_scripts/sb-volume Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
icon='\uf028 '
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && printf "$icon <span foreground='#ffffff' background='#770000'>mute</span>" || printf "$icon ${vol}%%"

View file

@ -1,4 +1,5 @@
import psutil import psutil
import subprocess
from libqtile import bar, extension, hook, layout, widget from libqtile import bar, extension, hook, layout, widget
from libqtile.config import Click, Drag, DropDown, Group, Key, Match, ScratchPad, Screen from libqtile.config import Click, Drag, DropDown, Group, Key, Match, ScratchPad, Screen
from libqtile.dgroups import simple_key_binder from libqtile.dgroups import simple_key_binder
@ -20,7 +21,7 @@ groups = [
"spterm", "sh -c 'BROWSER=firefox st'", "spterm", "sh -c 'BROWSER=firefox st'",
on_focus_lost_hide=False, on_focus_lost_hide=False,
width=0.40, width=0.40,
height=0.50, height=0.20,
x=0.30, x=0.30,
y=0.25, y=0.25,
), ),
@ -28,7 +29,7 @@ groups = [
"spwork", "sh -c 'BROWSER=workfx st -n work'", "spwork", "sh -c 'BROWSER=workfx st -n work'",
on_focus_lost_hide=False, on_focus_lost_hide=False,
width=0.40, width=0.40,
height=0.50, height=0.20,
x=0.30, x=0.30,
y=0.25, y=0.25,
), ),
@ -119,42 +120,22 @@ screens = [
record_history=False, record_history=False,
), ),
widget.Spacer(), widget.Spacer(),
widget.Maildir( widget.GenPollText(
hide_when_empty=True, update_interval=0.2,
maildir_path='~/.local/share/mail/priv', func=lambda: subprocess.check_output("sb-emerge").decode(),
nonempty_color="#fff27f",
sub_folders=[{'label': 'priv', 'path': 'INBOX'}, {'label': 'sites', 'path': 'sites'}],
update_interval=5,
), ),
widget.Maildir( widget.GenPollText(
hide_when_empty=True, update_interval=0.2,
maildir_path='~/.local/share/mail/klub', func=lambda: subprocess.check_output("sb-mail").decode(),
nonempty_color="#fff27f",
total=True,
sub_folders=[{'label': 'klub', 'path': 'INBOX'}],
update_interval=5,
), ),
widget.Maildir( widget.GenPollText(
hide_when_empty=True, update_interval=0.2,
maildir_path='~/.local/share/mail/info', func=lambda: subprocess.check_output("sb-volume").decode(),
nonempty_color="#fff27f",
total=True,
sub_folders=[{'label': 'info', 'path': 'INBOX'}],
update_interval=5,
), ),
widget.Maildir( widget.GenPollText(
hide_when_empty=True, update_interval=0.2,
maildir_path='~/.local/share/mail/work', func=lambda: subprocess.check_output("sb-network").decode(),
nonempty_color="#fff27f",
total=True,
sub_folders=[{'label': 'work', 'path': 'INBOX'}],
update_interval=5,
), ),
widget.Wlan(
format='\uf1eb {essid}',
disconnected_message=' NO WIFI ',
),
widget.Sep(padding=15, size_percent=60),
widget.Battery( widget.Battery(
format='\uf241 {char} {percent:2.0%}', format='\uf241 {char} {percent:2.0%}',
charge_char="\uf077", charge_char="\uf077",
@ -162,16 +143,10 @@ screens = [
full_char="\uf102", full_char="\uf102",
unknown_char="\uf444", unknown_char="\uf444",
), ),
widget.Sep(padding=15, size_percent=60),
widget.Clock( widget.Clock(
format='\uf073 [%d] %I:%M:%S %p' format='\uf073 [%d] %I:%M:%S %p'
), ),
widget.Sep(padding=15, size_percent=60), widget.Sep(padding=15, size_percent=60),
widget.PulseVolume(
emoji=True,
step=5,
update_interval=0.1,
),
widget.Systray(), widget.Systray(),
], ],
24, 24,