Update Qtile

Signed-off-by: The-Repo-Club <wayne6324@gmail.com>
This commit is contained in:
The-Repo-Club 2022-10-16 16:58:48 +01:00
parent 7c1fbc918e
commit ba3103220d
No known key found for this signature in database
GPG Key ID: E30EC2FBFB05C44F
5 changed files with 103 additions and 15 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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 >]',
)