Add KuroWMII layout that manages new windows in a way I like, add some more shortcuts, improve battery icon, automatically open programs on workspaces and remove the GroupRules for them after they spawn so that new instances of that app don't open on that workspace any more.
This commit is contained in:
parent
b9224b667d
commit
9a3fdf1b65
5 changed files with 176 additions and 14 deletions
|
@ -1,10 +1,12 @@
|
|||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from time import sleep
|
||||
|
||||
import cairocffi
|
||||
import notify2
|
||||
from libqtile import widget, bar
|
||||
from libqtile.window import Internal
|
||||
from libqtile.bar import Bar
|
||||
from libqtile.utils import catch_exception_and_warn, UnixCommandNotFound
|
||||
from libqtile.widget import base
|
||||
|
@ -13,6 +15,7 @@ from libqtile.widget.check_updates import CheckUpdates
|
|||
from libqtile.widget.image import Image
|
||||
from libqtile.widget.sensors import ThermalSensor
|
||||
from libqtile.widget.volume import Volume
|
||||
from libqtile.widget.battery import BatteryIcon
|
||||
from libqtile.widget.wlan import get_status
|
||||
from libqtile.log_utils import logger
|
||||
from notify2 import Notification, URGENCY_NORMAL
|
||||
|
@ -80,13 +83,45 @@ def notify(title, content, urgency=URGENCY_NORMAL, timeout=5000, image=None):
|
|||
|
||||
|
||||
def spawn_popup(qtile, x, y, text):
|
||||
"""
|
||||
:param qtile: The main qtile instance
|
||||
:type qtile: Qtile
|
||||
:param x: x-coordinate
|
||||
:type x: int
|
||||
:param y: y-coordinate
|
||||
:type y: int
|
||||
:param text: String to display
|
||||
:type text: str
|
||||
:return: The popup instance
|
||||
:rtype: Internal
|
||||
"""
|
||||
popup = Internal.create(
|
||||
qtile, x, y, 100, 100, opacity=1
|
||||
)
|
||||
|
||||
# Create textwidget for in window
|
||||
pass
|
||||
popup.bordercolor = "#000000"
|
||||
popup.borderwidth = 1
|
||||
|
||||
popup.focus(False)
|
||||
|
||||
#popup.
|
||||
|
||||
return popup
|
||||
|
||||
|
||||
# window.Internal.create(
|
||||
# qtile, x, y, width, height, opacity=1
|
||||
# )
|
||||
def despawn_popup(popup):
|
||||
"""
|
||||
:type popup: Internal
|
||||
:param popup: The popup to despawn
|
||||
"""
|
||||
popup.kill()
|
||||
|
||||
|
||||
def test_popups(qtile):
|
||||
popup = spawn_popup(qtile, 10, 10, "Hello World!")
|
||||
sleep(3)
|
||||
despawn_popup(popup)
|
||||
|
||||
|
||||
def display_wm_class(qtile):
|
||||
|
@ -218,6 +253,17 @@ class CheckUpdatesYaourt(CheckUpdates):
|
|||
elif button == BUTTON_MIDDLE and self.execute is not None:
|
||||
subprocess.Popen(self.execute, shell=True)
|
||||
|
||||
class KuroBatteryIcon(BatteryIcon):
|
||||
status_cmd = "acpi"
|
||||
|
||||
def button_press(self, x, y, button):
|
||||
if button == BUTTON_LEFT:
|
||||
output = subprocess.check_output(self.status_cmd).decode('utf-8')
|
||||
|
||||
notify(
|
||||
"Battery Status",
|
||||
output
|
||||
)
|
||||
|
||||
class PulseVolumeWidget(Volume):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue