From d6d2323b0f89db61ba30c57b057359917623b7cd Mon Sep 17 00:00:00 2001 From: flifloo Date: Wed, 12 Feb 2020 07:57:30 +0100 Subject: [PATCH] Some good empty last line of files and add steam to hook --- config.py | 1 + modules/groups.py | 1 + modules/hook.py | 3 +- modules/keys.py | 1 + modules/layouts.py | 1 + modules/main.py | 1 + qtile-venv-entry | 1 - widget_custom/notify.py | 118 ---------------------------------------- 8 files changed, 7 insertions(+), 120 deletions(-) delete mode 100644 widget_custom/notify.py diff --git a/config.py b/config.py index 324294b..f65c9d6 100644 --- a/config.py +++ b/config.py @@ -23,3 +23,4 @@ cursor_warp = False auto_fullscreen = True focus_on_window_activation = "smart" wmname = "LG3D" + diff --git a/modules/groups.py b/modules/groups.py index 98b77ce..c4c8dd8 100644 --- a/modules/groups.py +++ b/modules/groups.py @@ -13,3 +13,4 @@ for i in [["F1", "\N{globe with meridians}"], ["F2", "\N{incoming envelope}"], [ Key([mod], i[0], lazy.group[i[1]].toscreen()), Key([mod, "shift"], i[0], lazy.window.togroup(i[1], switch_group=True)) ]) + diff --git a/modules/hook.py b/modules/hook.py index 64a477a..3eb640e 100644 --- a/modules/hook.py +++ b/modules/hook.py @@ -13,10 +13,11 @@ def auto_group(c): c.togroup("\N{floppy disk}") elif c.name == "docs": c.togroup("\N{bookmark tabs}") - elif c.name in ["Lutris", "Shadow"]: + elif c.name in ["Lutris", "Shadow", "Steam"]: c.togroup("\N{video game}") @hook.subscribe.screen_change def restart_on_randr(qtile, ev): qtile.cmd_restart() + diff --git a/modules/keys.py b/modules/keys.py index 4ea2ec8..8a3914b 100644 --- a/modules/keys.py +++ b/modules/keys.py @@ -125,3 +125,4 @@ mouse = [ Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()), Click([mod], "Button2", lazy.window.toggle_floating()), ] + diff --git a/modules/layouts.py b/modules/layouts.py index fe8699f..765b8cc 100644 --- a/modules/layouts.py +++ b/modules/layouts.py @@ -35,3 +35,4 @@ floating_layout = layout.Floating(float_rules=[ {"wname": "win0"}, {"wmclass": "ssh-askpass"}, # ssh-askpass ]) + diff --git a/modules/main.py b/modules/main.py index faa701a..f0bc981 100644 --- a/modules/main.py +++ b/modules/main.py @@ -43,3 +43,4 @@ def main(q): 24, ) )) + diff --git a/qtile-venv-entry b/qtile-venv-entry index c1a983f..04eeffb 100755 --- a/qtile-venv-entry +++ b/qtile-venv-entry @@ -9,7 +9,6 @@ pulseaudio -D feh --bg-fill ~/Nextcloud/Images/Furry/Commis/Kat-LUK.J_/poster_etha.png -xbrightness 0.5 # Fix touchscreen diff --git a/widget_custom/notify.py b/widget_custom/notify.py deleted file mode 100644 index 2d6b7e0..0000000 --- a/widget_custom/notify.py +++ /dev/null @@ -1,118 +0,0 @@ -from . import base -from .. import bar, utils, pangocffi -from libqtile.notify import notifier -from os import path - - -class Notify(base._TextBox): - """A notify widget""" - orientations = base.ORIENTATION_HORIZONTAL - defaults = [ - ("foreground_urgent", "ff0000", "Foreground urgent priority colour"), - ("foreground_low", "dddddd", "Foreground low priority colour"), - ( - "default_timeout", - None, - "Default timeout (seconds) for notifications" - ), - ("audiofile", None, "Audiofile played during notifications"), - ] - - def __init__(self, width=bar.CALCULATED, **config): - base._TextBox.__init__(self, "", width, **config) - self.add_defaults(Notify.defaults) - notifier.register(self.update) - self.current_id = 0 - - def _configure(self, qtile, bar): - base._TextBox._configure(self, qtile, bar) - self.layout = self.drawer.textlayout( - self.text, - self.foreground, - self.font, - self.fontsize, - self.fontshadow, - markup=True - ) - - def set_notif_text(self, notif): - self.text = pangocffi.markup_escape_text(notif.summary) - urgency = notif.hints.get('urgency', 1) - if urgency != 1: - self.text = '%s' % ( - utils.hex( - self.foreground_urgent if urgency == 2 - else self.foreground_low - ), - self.text - ) - if notif.body: - self.text = '%s - %s' % ( - self.text, pangocffi.markup_escape_text(notif.body) - ) - if self.audiofile and path.exists(self.audiofile): - self.qtile.cmd_spawn("aplay -q '%s'" % self.audiofile) - - def update(self, notif): - self.qtile.call_soon_threadsafe(self.real_update, notif) - - def real_update(self, notif): - self.set_notif_text(notif) - self.current_id = notif.id - 1 - if notif.timeout and notif.timeout > 0: - self.timeout_add(notif.timeout / 1000, self.clear) - elif self.default_timeout: - self.timeout_add(self.default_timeout, self.clear) - self.bar.draw() - return True - - def display(self): - self.set_notif_text(notifier.notifications[self.current_id]) - self.bar.draw() - - def clear(self): - self.text = '' - self.current_id = len(notifier.notifications) - 1 - self.bar.draw() - - def prev(self): - if self.current_id > 0: - self.current_id -= 1 - self.display() - - def next(self): - if self.current_id < len(notifier.notifications) - 1: - self.current_id += 1 - self.display() - - def button_press(self, x, y, button): - if button == 1: - self.clear() - elif button == 4: - self.prev() - elif button == 5: - self.next() - - def cmd_display(self): - """Display the notifcication""" - self.display() - - def cmd_clear(self): - """Clear the notification""" - self.clear() - - def cmd_toggle(self): - """Toggle showing/clearing the notification""" - if self.text == '': - self.display() - else: - self.clear() - - def cmd_prev(self): - """Show previous notification""" - self.prev() - - def cmd_next(self): - """Show next notification""" - self.next() -