From 5f679b475b3d25aa889d9121f64bc80b91e3bbea Mon Sep 17 00:00:00 2001 From: The-Repo-Club Date: Wed, 30 Aug 2023 19:23:42 +0100 Subject: [PATCH] Updated qTile config --- dconf/.config/dconf/user | Bin 8622 -> 8622 bytes pkgbrowser/.config/pkgbrowser/pkgbrowser.conf | 2 +- qtile/.config/qtile/colors.py | 53 ++++++---- qtile/.config/qtile/ext/multiColorTag.py | 96 ++++++++++++++++++ qtile/.config/qtile/widgets.py | 14 ++- 5 files changed, 139 insertions(+), 26 deletions(-) create mode 100644 qtile/.config/qtile/ext/multiColorTag.py diff --git a/dconf/.config/dconf/user b/dconf/.config/dconf/user index 90f87141fdb18c9b8efada0cd365a107af1aaaed..d0559a685a289d8d5fbcc594d2bb8f55b38ccdd5 100644 GIT binary patch delta 14 VcmZ4Iyv})pg*c<(W=ru>E&wQ71eO2* delta 14 VcmZ4Iyv})pg*cE&wQD1eX8+ diff --git a/pkgbrowser/.config/pkgbrowser/pkgbrowser.conf b/pkgbrowser/.config/pkgbrowser/pkgbrowser.conf index 442c9512b..85549c285 100644 --- a/pkgbrowser/.config/pkgbrowser/pkgbrowser.conf +++ b/pkgbrowser/.config/pkgbrowser/pkgbrowser.conf @@ -12,6 +12,6 @@ strings=bat, pkgbrowser, ly, zap, i3-gaps, microsoft edge, python3, python, pama [window] central-splitter=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\x1\0\0\0\x1>\0\xff\xff\xff\xff\x1\0\0\0\x1\0) -geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\ag\0\0\x3\xff\0\0\0\0\0\0\0\0\0\0\aq\0\0\x3\xdd\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\ag\0\0\x3\xff) +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x4\xa5\0\0\0)\0\0\ax\0\0\x4\n\0\0\0\0\0\0\0\x14\0\0\aq\0\0\x3\xf1\0\0\0\0\x2\0\0\0\a\x80\0\0\x4\xa7\0\0\0+\0\0\av\0\0\x4\b) left-splitter=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\0\xc0\0\0\x1\f\0\xff\xff\xff\xff\x1\0\0\0\x2\0) right-splitter=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\0\xc0\0\0\0\xee\0\xff\xff\xff\xff\x1\0\0\0\x2\0) diff --git a/qtile/.config/qtile/colors.py b/qtile/.config/qtile/colors.py index 1362864d6..3bac6052e 100644 --- a/qtile/.config/qtile/colors.py +++ b/qtile/.config/qtile/colors.py @@ -1,25 +1,38 @@ colorScheme = [ - ["283036", "283036"], # 0 - ["ff5959", "ff5959"], # 1 - ["59ff59", "59ff59"], # 2 - ["ffff59", "ffff59"], # 3 - ["9059ff", "9059ff"], # 4 - ["ff59f9", "ff59f9"], # 5 - ["59fff9", "59fff9"], # 6 - ["e5e9f0", "e5e9f0"], # 7 - ["43515e", "43515e"], # 8 - ["ffa6a6", "ffa6a6"], # 9 - ["a6ffa6", "a6ffa6"], # 10 - ["ffffa6", "ffffa6"], # 11 - ["c5a6ff", "c5a6ff"], # 12 - ["ffa6fc", "ffa6fc"], # 13 - ["a6fffc", "a6fffc"], # 14 - ["e5e9f0", "e5e9f0"], # 15 - ["e5e9f0", "e5e9f0"], # foregroundColor - ["283036", "283036"], # backgroundColor - ["434c5e", "434c5e"], # backgroundColor + "283036", # 0 + "ff5959", # 1 + "59ff59", # 2 + "ffff59", # 3 + "9059ff", # 4 + "ff59f9", # 5 + "59fff9", # 6 + "e5e9f0", # 7 + "43515e", # 8 + "ffa6a6", # 9 + "a6ffa6", # 10 + "ffffa6", # 11 + "c5a6ff", # 12 + "ffa6fc", # 13 + "a6fffc", # 14 + "e5e9f0", # 15 + "e5e9f0", # foregroundColor + "283036", # backgroundColor + "434c5e", # backgroundColor +] + +widgetColors = [ + "ff5959", # 1 + "59ff59", # 2 + "ffff59", # 3 + "9059ff", # 4 + "ff59f9", # 5 + "59fff9", # 6 + "e5e9f0", # 7 + "43515e", # 8 + "ffa6a6", # 9 + "a6ffa6", # 10 ] foregroundColor = colorScheme[16] backgroundColor = colorScheme[17] -currentColor = colorScheme[18] \ No newline at end of file +currentColor = colorScheme[18] diff --git a/qtile/.config/qtile/ext/multiColorTag.py b/qtile/.config/qtile/ext/multiColorTag.py new file mode 100644 index 000000000..5fa5e19af --- /dev/null +++ b/qtile/.config/qtile/ext/multiColorTag.py @@ -0,0 +1,96 @@ +# Copyright (c) 2023 The-Repo-Club +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from libqtile import widget +from libqtile.confreader import ConfigError + + +class MultiColorTag(widget.GroupBox): + def __init__(self, **config): + super().__init__(**config) + self.tag_colors = config.get("tag_colors", []) + self.this_current_screen_border = config.get("this_current_screen_border", []) + + if not isinstance(self.tag_colors, list): + raise ConfigError("MultiColorTag: tag_colors must be a list") + if not isinstance(self.this_current_screen_border, list): + raise ConfigError( + "MultiColorTag: this_current_screen_border must be a list" + ) + + def draw(self): + self.drawer.clear(self.background or self.bar.background) + + offset = self.margin_x + num_tag_colors = len(self.tag_colors) + num_this_current_screen_border = len(self.this_current_screen_border) + + for i, g in enumerate(self.groups): + effective_tag_colors_index = i % num_tag_colors + effective_this_current_screen_border_index = ( + i % num_this_current_screen_border + ) + + bw = self.box_width([g]) + + if self.group_has_urgent(g): + text_color = self.urgent_text + elif g.windows: + text_color = self.active + else: + text_color = self.inactive + + if effective_tag_colors_index < len(self.tag_colors): + text_color = self.tag_colors[effective_tag_colors_index] + + if g.screen: + if self.block_highlight_text_color: + text_color = self.block_highlight_text_color + if self.bar.screen.group.name == g.name: + if self.qtile.current_screen == self.bar.screen: + border = self.this_current_screen_border[ + effective_this_current_screen_border_index + ] + else: + border = self.this_screen_border + else: + if self.qtile.current_screen == g.screen: + border = self.other_current_screen_border + else: + border = self.other_screen_border + elif self.group_has_urgent(g): + border = self.urgent_border + else: + border = None + + self.drawbox( + offset, + g.label, + border, + text_color, + highlight_color=self.highlight_color, + width=bw, + rounded=self.rounded, + block=False, + line=True, + highlighted=False, + ) + offset += bw + self.spacing + self.drawer.draw(offsetx=self.offset, offsety=self.offsety, width=self.width) diff --git a/qtile/.config/qtile/widgets.py b/qtile/.config/qtile/widgets.py index a8e2192b5..a963e27b7 100644 --- a/qtile/.config/qtile/widgets.py +++ b/qtile/.config/qtile/widgets.py @@ -3,7 +3,9 @@ from libqtile.lazy import lazy from os.path import expanduser import subprocess -from colors import colorScheme, foregroundColor, backgroundColor +from ext.multiColorTag import MultiColorTag + +from colors import colorScheme, widgetColors, foregroundColor, backgroundColor class Widgets(object): @@ -35,7 +37,7 @@ class Widgets(object): ], ) - groupBox1 = widget.GroupBox( + groupBox1 = MultiColorTag( margin_y=4, margin_x=4, padding_y=6, @@ -48,7 +50,8 @@ class Widgets(object): rounded=False, highlight_method="line", highlight_color=backgroundColor, - this_current_screen_border=colorScheme[2], + tag_colors=widgetColors, + this_current_screen_border=widgetColors, this_screen_border=colorScheme[1], other_screen_border=colorScheme[6], other_current_screen_border=colorScheme[6], @@ -60,7 +63,7 @@ class Widgets(object): use_mouse_wheel=True, ) - groupBox2 = widget.GroupBox( + groupBox2 = MultiColorTag( margin_y=4, margin_x=4, padding_y=6, @@ -73,7 +76,8 @@ class Widgets(object): rounded=False, highlight_method="line", highlight_color=backgroundColor, - this_current_screen_border=colorScheme[2], + tag_colors=widgetColors, + this_current_screen_border=widgetColors, this_screen_border=colorScheme[1], other_screen_border=colorScheme[6], other_current_screen_border=colorScheme[6],