Changes to Celestia
This commit is contained in:
parent
f4c6430eb4
commit
a033bde573
24
kuro/base.py
24
kuro/base.py
|
@ -1,6 +1,6 @@
|
||||||
from libqtile import layout as libqtile_layout, layout, bar, widget
|
from libqtile import layout as libqtile_layout, layout, bar, widget
|
||||||
from libqtile.command import lazy
|
from libqtile.command import lazy
|
||||||
from libqtile.config import Key, Group, Screen, Drag, Click
|
from libqtile.config import Key, Group, Screen, Drag, Click, Match
|
||||||
|
|
||||||
|
|
||||||
class BaseConfig:
|
class BaseConfig:
|
||||||
|
@ -29,20 +29,14 @@ class BaseTheme:
|
||||||
bring_front_click = False
|
bring_front_click = False
|
||||||
cursor_warp = False
|
cursor_warp = False
|
||||||
floating_layout = libqtile_layout.Floating(float_rules=[
|
floating_layout = libqtile_layout.Floating(float_rules=[
|
||||||
{'wmclass': 'confirm'},
|
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||||
{'wmclass': 'dialog'},
|
*layout.Floating.default_float_rules,
|
||||||
{'wmclass': 'download'},
|
Match(wm_class='confirmreset'), # gitk
|
||||||
{'wmclass': 'error'},
|
Match(wm_class='makebranch'), # gitk
|
||||||
{'wmclass': 'file_progress'},
|
Match(wm_class='maketag'), # gitk
|
||||||
{'wmclass': 'notification'},
|
Match(wm_class='ssh-askpass'), # ssh-askpass
|
||||||
{'wmclass': 'splash'},
|
Match(title='branchdialog'), # gitk
|
||||||
{'wmclass': 'toolbar'},
|
Match(title='pinentry'), # GPG key password entry
|
||||||
{'wmclass': 'confirmreset'}, # gitk
|
|
||||||
{'wmclass': 'makebranch'}, # gitk
|
|
||||||
{'wmclass': 'maketag'}, # gitk
|
|
||||||
{'wname': 'branchdialog'}, # gitk
|
|
||||||
{'wname': 'pinentry'}, # GPG key password entry
|
|
||||||
{'wmclass': 'ssh-askpass'}, # ssh-askpass
|
|
||||||
])
|
])
|
||||||
auto_fullscreen = True
|
auto_fullscreen = True
|
||||||
focus_on_window_activation = "smart"
|
focus_on_window_activation = "smart"
|
||||||
|
|
|
@ -122,7 +122,8 @@ class Config(BaseConfig):
|
||||||
volume_font = "Noto Sans"
|
volume_font = "Noto Sans"
|
||||||
volume_fontsize = 11
|
volume_fontsize = 11
|
||||||
volume_theme_path = "/home/kevin/.config/qtile/kuro/resources/volume"
|
volume_theme_path = "/home/kevin/.config/qtile/kuro/resources/volume"
|
||||||
volume_pulse_sink = "alsa_output.pci-0000_00_1f.3.analog-stereo"
|
volume_pulse_sink = "alsa_output.pci-0000_04_00.0.pro-output-0"
|
||||||
|
volume_pulse_sink2 = "alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.pro-output-0"
|
||||||
|
|
||||||
volume_is_bluetooth_icon = False
|
volume_is_bluetooth_icon = False
|
||||||
volume_update_interval = 0.2
|
volume_update_interval = 0.2
|
||||||
|
@ -151,12 +152,18 @@ class Config(BaseConfig):
|
||||||
do_keyboard_updates = False
|
do_keyboard_updates = False
|
||||||
|
|
||||||
# Show audio visualizer
|
# Show audio visualizer
|
||||||
show_audio_visualizer = True
|
show_audio_visualizer = False
|
||||||
kill_unnecessary_glava_processes = True
|
kill_unnecessary_glava_processes = True
|
||||||
|
|
||||||
# Show thermal widget
|
# Show thermal widget
|
||||||
show_temperature = True
|
show_temperature = True
|
||||||
|
|
||||||
|
# Show GPU widget
|
||||||
|
show_gpu_widget = False
|
||||||
|
|
||||||
|
# Show battery widget
|
||||||
|
show_battery_widget = False
|
||||||
|
|
||||||
# Audio control applications
|
# Audio control applications
|
||||||
# apps_audio = ["pavucontrol"]
|
# apps_audio = ["pavucontrol"]
|
||||||
apps_audio_afterstart = "/home/kevin/bin/start_jack_audio_chain.sh"
|
apps_audio_afterstart = []
|
||||||
|
|
|
@ -7,7 +7,7 @@ from libqtile.log_utils import logger
|
||||||
|
|
||||||
logger.error("Importing qtile theme requirements...")
|
logger.error("Importing qtile theme requirements...")
|
||||||
|
|
||||||
from libqtile.config import Key, Screen, Group, Drag, Click
|
from libqtile.config import Key, Screen, Group, Drag, Click, Match
|
||||||
from libqtile.command import lazy
|
from libqtile.command import lazy
|
||||||
from libqtile import layout, bar, widget
|
from libqtile import layout, bar, widget
|
||||||
|
|
||||||
|
@ -75,20 +75,14 @@ class Kuro(BaseTheme):
|
||||||
|
|
||||||
# Floating layout override
|
# Floating layout override
|
||||||
floating_layout = kuro_layouts.KuroFloating(float_rules=[
|
floating_layout = kuro_layouts.KuroFloating(float_rules=[
|
||||||
{'wmclass': 'confirm'},
|
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||||
{'wmclass': 'dialog'},
|
*layout.Floating.default_float_rules,
|
||||||
{'wmclass': 'download'},
|
Match(wm_class='confirmreset'), # gitk
|
||||||
{'wmclass': 'error'},
|
Match(wm_class='makebranch'), # gitk
|
||||||
{'wmclass': 'file_progress'},
|
Match(wm_class='maketag'), # gitk
|
||||||
{'wmclass': 'notification'},
|
Match(wm_class='ssh-askpass'), # ssh-askpass
|
||||||
{'wmclass': 'splash'},
|
Match(title='branchdialog'), # gitk
|
||||||
{'wmclass': 'toolbar'},
|
Match(title='pinentry'), # GPG key password entry
|
||||||
{'wmclass': 'confirmreset'}, # gitk
|
|
||||||
{'wmclass': 'makebranch'}, # gitk
|
|
||||||
{'wmclass': 'maketag'}, # gitk
|
|
||||||
{'wname': 'branchdialog'}, # gitk
|
|
||||||
{'wname': 'pinentry'}, # GPG key password entry
|
|
||||||
{'wmclass': 'ssh-askpass'}, # ssh-askpass
|
|
||||||
])
|
])
|
||||||
|
|
||||||
def set_debug_text(self, text):
|
def set_debug_text(self, text):
|
||||||
|
@ -245,14 +239,7 @@ class Kuro(BaseTheme):
|
||||||
groups.append(Group(""))
|
groups.append(Group(""))
|
||||||
groups.append(Group(""))
|
groups.append(Group(""))
|
||||||
groups.append(Group(""))
|
groups.append(Group(""))
|
||||||
groups.append(Group("", spawn=Config.get('apps_audio', "true"), layout='verticaltile', layouts=[
|
groups.append(Group("", spawn=Config.get('apps_audio', "true")))
|
||||||
layout.VerticalTile(
|
|
||||||
border_focus=Config.get('colour_border_focus', "#ffffff"),
|
|
||||||
border_normal=Config.get('colour_border_normal', "#777777"),
|
|
||||||
border_width=Config.get('width_border', "1"),
|
|
||||||
margin=Config.get('margin_layout', "0"),
|
|
||||||
)
|
|
||||||
]))
|
|
||||||
groups.append(Group("", layout='floating', layouts=[
|
groups.append(Group("", layout='floating', layouts=[
|
||||||
layout.Floating(
|
layout.Floating(
|
||||||
border_focus="#990000",
|
border_focus="#990000",
|
||||||
|
@ -360,19 +347,34 @@ class Kuro(BaseTheme):
|
||||||
kuro.utils.widgets.CPUInfoWidget(fontsize_left=16, fontsize_right=11),
|
kuro.utils.widgets.CPUInfoWidget(fontsize_left=16, fontsize_right=11),
|
||||||
kuro.utils.widgets.MemoryInfoWidget(fontsize_left=18, fontsize_right=11),
|
kuro.utils.widgets.MemoryInfoWidget(fontsize_left=18, fontsize_right=11),
|
||||||
kuro.utils.widgets.DiskIOInfoWidget(fontsize_left=16, fontsize_right=11),
|
kuro.utils.widgets.DiskIOInfoWidget(fontsize_left=16, fontsize_right=11),
|
||||||
kuro.utils.widgets.BatteryInfoWidget(fontsize_left=16, fontsize_right=11),
|
])
|
||||||
|
if Config.get('show_battery_widget', False):
|
||||||
|
widgets.extend([
|
||||||
|
kuro.utils.widgets.BatteryInfoWidget(fontsize_left=16, fontsize_right=11),
|
||||||
|
])
|
||||||
|
widgets.extend([
|
||||||
kuro.utils.widgets.VolumeInfoWidget(
|
kuro.utils.widgets.VolumeInfoWidget(
|
||||||
pulse_sink=Config.get('volume_pulse_sink', None),
|
pulse_sink=Config.get('volume_pulse_sink', None),
|
||||||
fontsize_left=18,
|
fontsize_left=18,
|
||||||
fontsize_right=11,
|
fontsize_right=11,
|
||||||
),
|
),
|
||||||
|
kuro.utils.widgets.VolumeInfoWidget(
|
||||||
|
pulse_sink=Config.get('volume_pulse_sink2', None),
|
||||||
|
fontsize_left=18,
|
||||||
|
fontsize_right=11,
|
||||||
|
),
|
||||||
kuro.utils.widgets.TextSpacerWidget(fontsize=14),
|
kuro.utils.widgets.TextSpacerWidget(fontsize=14),
|
||||||
kuro.utils.widgets.NetworkInfoWidget(fontsize_left=16, fontsize_right=14),
|
kuro.utils.widgets.NetworkInfoWidget(fontsize_left=16, fontsize_right=14),
|
||||||
kuro.utils.widgets.GPUStatusWidget(
|
])
|
||||||
theme_path=Config.get('gpu_theme_path', '/home/docs/checkouts/readthedocs.org/user_builds/qtile'
|
if Config.get('show_gpu_widget', False):
|
||||||
'/checkouts/latest/libqtile/resources/battery-icons'),
|
widgets.extend([
|
||||||
padding=0,
|
kuro.utils.widgets.GPUStatusWidget(
|
||||||
),
|
theme_path=Config.get('gpu_theme_path', '/home/docs/checkouts/readthedocs.org/user_builds/qtile'
|
||||||
|
'/checkouts/latest/libqtile/resources/battery-icons'),
|
||||||
|
padding=0,
|
||||||
|
)
|
||||||
|
])
|
||||||
|
widgets.extend([
|
||||||
kuro.utils.widgets.TextSpacerWidget(fontsize=14),
|
kuro.utils.widgets.TextSpacerWidget(fontsize=14),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -388,6 +390,7 @@ class Kuro(BaseTheme):
|
||||||
colour_have_updates=Config.get('updates_colour_available', '#ff0000'),
|
colour_have_updates=Config.get('updates_colour_available', '#ff0000'),
|
||||||
display_format=Config.get('updates_display_format', 'Updates: {updates}'),
|
display_format=Config.get('updates_display_format', 'Updates: {updates}'),
|
||||||
execute=Config.get('updates_execute_command', None),
|
execute=Config.get('updates_execute_command', None),
|
||||||
|
update_interval=Config.get('updates_interval', 600),
|
||||||
**self.widget_defaults
|
**self.widget_defaults
|
||||||
),
|
),
|
||||||
widget.TextBox("#{}".format(x), name="default", **self.widget_defaults),
|
widget.TextBox("#{}".format(x), name="default", **self.widget_defaults),
|
||||||
|
@ -481,7 +484,6 @@ class Kuro(BaseTheme):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def update_screens(qtile):
|
def update_screens(qtile):
|
||||||
out = utils.call_process(["xrandr", "--current"])
|
out = utils.call_process(["xrandr", "--current"])
|
||||||
#mode_out = utils.call_process(["optimus-manager", "--print-mode"])
|
|
||||||
video_mode = "nvidia"
|
video_mode = "nvidia"
|
||||||
#if "nvidia" in mode_out:
|
#if "nvidia" in mode_out:
|
||||||
# video_mode = "nvidia"
|
# video_mode = "nvidia"
|
||||||
|
@ -600,11 +602,14 @@ class Kuro(BaseTheme):
|
||||||
p.wait()
|
p.wait()
|
||||||
|
|
||||||
self.log_info("Starting compositor...")
|
self.log_info("Starting compositor...")
|
||||||
utils.execute_once("compton -b")
|
utils.execute_once("picom -b")
|
||||||
|
|
||||||
self.log_info("Starting clipboard manager...")
|
self.log_info("Starting clipboard manager...")
|
||||||
utils.execute_once("xfce4-clipman")
|
utils.execute_once("xfce4-clipman")
|
||||||
|
|
||||||
|
self.log_info("Starting notification daemon...")
|
||||||
|
utils.execute_once("dunst")
|
||||||
|
|
||||||
# Update color scheme
|
# Update color scheme
|
||||||
self.initialize_colorscheme()
|
self.initialize_colorscheme()
|
||||||
|
|
||||||
|
@ -636,9 +641,9 @@ class Kuro(BaseTheme):
|
||||||
for r in dg.rules:
|
for r in dg.rules:
|
||||||
pid = -1
|
pid = -1
|
||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
for r2 in r.match._rules:
|
for m in r.matchlist:
|
||||||
if r2[0] == "net_wm_pid":
|
if m._rules.get('net_wm_pid', None) is not None:
|
||||||
pid = r2[1]
|
pid = m._rules.get('net_wm_pid')
|
||||||
break
|
break
|
||||||
if pid != -1:
|
if pid != -1:
|
||||||
self.initial_windows.append((pid, r.group))
|
self.initial_windows.append((pid, r.group))
|
||||||
|
|
|
@ -12,7 +12,10 @@ from libqtile.bar import Bar
|
||||||
from notify2 import Notification, URGENCY_NORMAL
|
from notify2 import Notification, URGENCY_NORMAL
|
||||||
from libqtile.log_utils import logger
|
from libqtile.log_utils import logger
|
||||||
|
|
||||||
notify2.init("QTileWM")
|
try:
|
||||||
|
notify2.init("QTileWM")
|
||||||
|
except DBusException as e:
|
||||||
|
logger.error("Could not initialize notify2: {}".format(e))
|
||||||
|
|
||||||
BUTTON_LEFT = 1
|
BUTTON_LEFT = 1
|
||||||
BUTTON_MIDDLE = 2
|
BUTTON_MIDDLE = 2
|
||||||
|
@ -100,6 +103,10 @@ def notify(title, content, urgency=URGENCY_NORMAL, timeout=5000, image=None):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return notification.show()
|
return notification.show()
|
||||||
|
except notify2.UninittedError:
|
||||||
|
logger.warning("Notify2 was uninitialized, initializing...")
|
||||||
|
notify2.init("qtile")
|
||||||
|
return notification.show()
|
||||||
except DBusException as e:
|
except DBusException as e:
|
||||||
logger.warning("Showing notification failed: {}".format(e))
|
logger.warning("Showing notification failed: {}".format(e))
|
||||||
logger.warning(traceback.format_exc())
|
logger.warning(traceback.format_exc())
|
||||||
|
|
|
@ -15,68 +15,53 @@ class KuroFloating(Floating):
|
||||||
super(KuroFloating, self).__init__(*args, **kwargs)
|
super(KuroFloating, self).__init__(*args, **kwargs)
|
||||||
self.add_defaults(KuroFloating.defaults)
|
self.add_defaults(KuroFloating.defaults)
|
||||||
|
|
||||||
def configure(self, client, screen):
|
def configure(self, client, screen_rect):
|
||||||
# 'sun-awt-X11-XWindowPeer' is a dropdown used in Java application,
|
|
||||||
# don't reposition it anywhere, let Java app to control it
|
|
||||||
cls = client.window.get_wm_class() or ''
|
|
||||||
is_java_dropdown = 'sun-awt-X11-XWindowPeer' in cls
|
|
||||||
if is_java_dropdown:
|
|
||||||
return
|
|
||||||
|
|
||||||
if hasattr(client, "is_static_window") and client.is_static_window:
|
if hasattr(client, "is_static_window") and client.is_static_window:
|
||||||
bc = client.group.qtile.color_pixel(self.border_static)
|
bc = self.border_static
|
||||||
elif client.has_focus:
|
elif client.has_focus:
|
||||||
bc = client.group.qtile.color_pixel(self.border_focus)
|
bc = self.border_focus
|
||||||
else:
|
else:
|
||||||
bc = client.group.qtile.color_pixel(self.border_normal)
|
bc = self.border_normal
|
||||||
|
|
||||||
if client.maximized:
|
if client.maximized:
|
||||||
bw = self.max_border_width
|
bw = self.max_border_width
|
||||||
elif client.fullscreen:
|
elif client.fullscreen:
|
||||||
bw = self.fullscreen_border_width
|
bw = self.fullscreen_border_width
|
||||||
else:
|
else:
|
||||||
bw = self.border_width
|
bw = self.border_width
|
||||||
above = False
|
|
||||||
|
|
||||||
# We definitely have a screen here, so let's be sure we'll float on screen
|
# 'sun-awt-X11-XWindowPeer' is a dropdown used in Java application,
|
||||||
try:
|
# don't reposition it anywhere, let Java app to control it
|
||||||
client.float_x
|
cls = client.window.get_wm_class() or ''
|
||||||
client.float_y
|
is_java_dropdown = 'sun-awt-X11-XWindowPeer' in cls
|
||||||
except AttributeError:
|
if is_java_dropdown:
|
||||||
# this window hasn't been placed before, let's put it in a sensible spot
|
client.paint_borders(bc, bw)
|
||||||
transient_for = client.window.get_wm_transient_for()
|
client.cmd_bring_to_front()
|
||||||
win = client.group.qtile.windows_map.get(transient_for)
|
|
||||||
if win is not None:
|
|
||||||
# if transient for a window, place in the center of the window
|
|
||||||
center_x = win.x + win.width / 2
|
|
||||||
center_y = win.y + win.height / 2
|
|
||||||
else:
|
|
||||||
center_x = screen.x + screen.width / 2
|
|
||||||
center_y = screen.y + screen.height / 2
|
|
||||||
above = True
|
|
||||||
|
|
||||||
x = center_x - client.width / 2
|
# alternatively, users may have asked us explicitly to leave the client alone
|
||||||
y = center_y - client.height / 2
|
elif any(m.compare(client) for m in self.no_reposition_rules):
|
||||||
|
client.paint_borders(bc, bw)
|
||||||
|
client.cmd_bring_to_front()
|
||||||
|
|
||||||
# don't go off the right...
|
else:
|
||||||
x = min(x, screen.x + screen.width)
|
above = False
|
||||||
# or left...
|
|
||||||
x = max(x, screen.x)
|
|
||||||
# or bottom...
|
|
||||||
y = min(y, screen.y + screen.height)
|
|
||||||
# or top
|
|
||||||
y = max(y, screen.y)
|
|
||||||
|
|
||||||
if not (self.no_reposition_match and self.no_reposition_match.compare(client)):
|
# We definitely have a screen here, so let's be sure we'll float on screen
|
||||||
client.x = int(round(x))
|
try:
|
||||||
client.y = int(round(y))
|
client.float_x
|
||||||
|
client.float_y
|
||||||
|
except AttributeError:
|
||||||
|
# this window hasn't been placed before, let's put it in a sensible spot
|
||||||
|
above = self.compute_client_position(client, screen_rect)
|
||||||
|
|
||||||
client.place(
|
|
||||||
client.x,
|
client.place(
|
||||||
client.y,
|
client.x,
|
||||||
client.width,
|
client.y,
|
||||||
client.height,
|
client.width,
|
||||||
bw,
|
client.height,
|
||||||
bc,
|
bw,
|
||||||
above,
|
bc,
|
||||||
)
|
above,
|
||||||
|
)
|
||||||
client.unhide()
|
client.unhide()
|
||||||
|
|
Loading…
Reference in a new issue