diff --git a/qtile/.config/qtile/config.py b/qtile/.config/qtile/config.py index 8109d9bed..450bf6dfd 100644 --- a/qtile/.config/qtile/config.py +++ b/qtile/.config/qtile/config.py @@ -267,6 +267,8 @@ screens = [ Widgets.space, Widgets.picom, Widgets.sep, + Widgets.github1, + Widgets.sep, Widgets.chords, ], 24, @@ -314,6 +316,11 @@ screens = [ [ Widgets.weather, Widgets.sep, + Widgets.space, + Widgets.picom, + Widgets.sep, + Widgets.github2, + Widgets.sep, Widgets.chords, ], 24, diff --git a/qtile/.config/qtile/groups.py b/qtile/.config/qtile/groups.py index 98ba6b79c..e8cf72f0e 100644 --- a/qtile/.config/qtile/groups.py +++ b/qtile/.config/qtile/groups.py @@ -1,5 +1,6 @@ from libqtile.config import Group, Match + class Groups(object): groups = [ # first group that hold the terminals @@ -7,7 +8,7 @@ class Groups(object): # label='', init=True, exclusive=False, - persist=False, + persist=True, matches=[Match(wm_class=['Alacritty', 'kitty'])], position=1, screen_affinity=1, @@ -17,7 +18,7 @@ class Groups(object): # label='', init=True, exclusive=False, - persist=False, + persist=True, matches=[Match(wm_class=['Code'])], position=2, screen_affinity=1, @@ -27,7 +28,7 @@ class Groups(object): # label='', init=True, exclusive=False, - persist=False, + persist=True, matches=[Match(wm_class=['Nemo'])], position=3, screen_affinity=1, @@ -37,8 +38,8 @@ class Groups(object): # label='', init=True, exclusive=False, - persist=False, - matches=[Match(wm_class=['Nemo'])], + persist=True, + # matches=[Match(wm_class=['Nemo'])], position=4, screen_affinity=1, name='4', @@ -47,8 +48,8 @@ class Groups(object): # label='ﱘ', init=True, exclusive=False, - persist=False, - matches=[Match(wm_class=['Nemo'])], + persist=True, + # matches=[Match(wm_class=['Nemo'])], position=5, screen_affinity=1, name='5', @@ -56,7 +57,7 @@ class Groups(object): Group( # label='', init=True, - persist=False, + persist=True, exclusive=False, matches=[Match(wm_class=['firefox'], role=['browser'])], position=6, @@ -66,7 +67,7 @@ class Groups(object): Group( # label='', init=True, - persist=False, + persist=True, exclusive=False, # matches=[Match(wm_class=['firefox'])], position=7, @@ -76,9 +77,9 @@ class Groups(object): Group( # label='調', init=True, - persist=False, + persist=True, exclusive=False, - # matches=[Match(wm_class=['firefox'])], + matches=[Match(wm_class=['Steam'])], position=8, screen_affinity=2, name='8', @@ -86,9 +87,9 @@ class Groups(object): Group( # label='', init=True, - persist=False, + persist=True, exclusive=False, - # matches=[Match(wm_class=['firefox'])], + matches=[Match(wm_class=['discord'])], position=9, screen_affinity=2, name='9', @@ -96,7 +97,7 @@ class Groups(object): Group( # label='', init=True, - persist=False, + persist=True, exclusive=False, matches=[Match(wm_class=['PkgBrowser'])], position=10, diff --git a/qtile/.config/qtile/scripts/picom-toggle.sh b/qtile/.config/qtile/scripts/picom-toggle.sh new file mode 100755 index 000000000..8cd342d97 --- /dev/null +++ b/qtile/.config/qtile/scripts/picom-toggle.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# https://github.com/jaagr/polybar/wiki/User-contributed-modules + +#The command for starting compton +#always keep the -b argument! + +if pgrep -x "picom" > /dev/null +then + killall picom +else + picom -CGb --experimental-backend --config ~/.config/i3/picom.conf +fi diff --git a/qtile/.config/qtile/scripts/picom.sh b/qtile/.config/qtile/scripts/picom.sh new file mode 100755 index 000000000..f54cea0c8 --- /dev/null +++ b/qtile/.config/qtile/scripts/picom.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# https://github.com/jaagr/polybar/wiki/User-contributed-modules + +#The icon that would change color +if pgrep -x "picom" > /dev/null +then + echo -n "Loaded" +else + echo -n "UnLoaded" +fi diff --git a/qtile/.config/qtile/widgets.py b/qtile/.config/qtile/widgets.py index b76b19c33..c58d631ed 100644 --- a/qtile/.config/qtile/widgets.py +++ b/qtile/.config/qtile/widgets.py @@ -1,6 +1,7 @@ from colors import colorScheme, foregroundColor, backgroundColor from libqtile import widget from libqtile.lazy import lazy +import subprocess class Widgets(object): @@ -175,7 +176,62 @@ class Widgets(object): }, ) - picom = widget.Picom( + picom = widget.GenPollText( fmt='{}', + func=lambda: subprocess.check_output("/home/repo/.config/qtile/scripts/picom.sh").decode("utf-8"), + mouse_callbacks={ + 'Button1': lambda: subprocess.run("/home/repo/.config/qtile/scripts/picom-toggle.sh"), + }, + update_interval=1, padding=10, ) + + github1 = widget.WidgetBox( + widgets=[ + widget.GenPollText( + fmt='{}', + func=lambda: subprocess.check_output("/home/repo/.config/qtile/scripts/github/notifications").decode("utf-8"), + update_interval=10, + padding=10, + ), + widget.GenPollText( + fmt='{}', + func=lambda: subprocess.check_output("/home/repo/.config/qtile/scripts/github/gists").decode("utf-8"), + update_interval=10, + padding=10, + ), + widget.GenPollText( + fmt='{}', + func=lambda: subprocess.check_output("/home/repo/.config/qtile/scripts/github/repositories").decode("utf-8"), + update_interval=10, + padding=10, + ), + ], + text_closed='[Github <]', + text_open='[Github >]', + ) + + github2 = widget.WidgetBox( + widgets=[ + widget.GenPollText( + fmt='{}', + func=lambda: subprocess.check_output("/home/repo/.config/qtile/scripts/github/notifications").decode("utf-8"), + update_interval=10, + padding=10, + ), + widget.GenPollText( + fmt='{}', + func=lambda: subprocess.check_output("/home/repo/.config/qtile/scripts/github/gists").decode("utf-8"), + update_interval=10, + padding=10, + ), + widget.GenPollText( + fmt='{}', + func=lambda: subprocess.check_output("/home/repo/.config/qtile/scripts/github/repositories").decode("utf-8"), + update_interval=10, + padding=10, + ), + ], + text_closed='[Github <]', + text_open='[Github >]', + )