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.command import lazy
|
||||
from libqtile.config import Key, Group, Screen, Drag, Click
|
||||
from libqtile.config import Key, Group, Screen, Drag, Click, Match
|
||||
|
||||
|
||||
class BaseConfig:
|
||||
|
@ -29,20 +29,14 @@ class BaseTheme:
|
|||
bring_front_click = False
|
||||
cursor_warp = False
|
||||
floating_layout = libqtile_layout.Floating(float_rules=[
|
||||
{'wmclass': 'confirm'},
|
||||
{'wmclass': 'dialog'},
|
||||
{'wmclass': 'download'},
|
||||
{'wmclass': 'error'},
|
||||
{'wmclass': 'file_progress'},
|
||||
{'wmclass': 'notification'},
|
||||
{'wmclass': 'splash'},
|
||||
{'wmclass': 'toolbar'},
|
||||
{'wmclass': 'confirmreset'}, # gitk
|
||||
{'wmclass': 'makebranch'}, # gitk
|
||||
{'wmclass': 'maketag'}, # gitk
|
||||
{'wname': 'branchdialog'}, # gitk
|
||||
{'wname': 'pinentry'}, # GPG key password entry
|
||||
{'wmclass': 'ssh-askpass'}, # ssh-askpass
|
||||
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||
*layout.Floating.default_float_rules,
|
||||
Match(wm_class='confirmreset'), # gitk
|
||||
Match(wm_class='makebranch'), # gitk
|
||||
Match(wm_class='maketag'), # gitk
|
||||
Match(wm_class='ssh-askpass'), # ssh-askpass
|
||||
Match(title='branchdialog'), # gitk
|
||||
Match(title='pinentry'), # GPG key password entry
|
||||
])
|
||||
auto_fullscreen = True
|
||||
focus_on_window_activation = "smart"
|
||||
|
|
|
@ -122,7 +122,8 @@ class Config(BaseConfig):
|
|||
volume_font = "Noto Sans"
|
||||
volume_fontsize = 11
|
||||
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_update_interval = 0.2
|
||||
|
@ -151,12 +152,18 @@ class Config(BaseConfig):
|
|||
do_keyboard_updates = False
|
||||
|
||||
# Show audio visualizer
|
||||
show_audio_visualizer = True
|
||||
show_audio_visualizer = False
|
||||
kill_unnecessary_glava_processes = True
|
||||
|
||||
# Show thermal widget
|
||||
show_temperature = True
|
||||
|
||||
# Show GPU widget
|
||||
show_gpu_widget = False
|
||||
|
||||
# Show battery widget
|
||||
show_battery_widget = False
|
||||
|
||||
# Audio control applications
|
||||
# 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...")
|
||||
|
||||
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 import layout, bar, widget
|
||||
|
||||
|
@ -75,20 +75,14 @@ class Kuro(BaseTheme):
|
|||
|
||||
# Floating layout override
|
||||
floating_layout = kuro_layouts.KuroFloating(float_rules=[
|
||||
{'wmclass': 'confirm'},
|
||||
{'wmclass': 'dialog'},
|
||||
{'wmclass': 'download'},
|
||||
{'wmclass': 'error'},
|
||||
{'wmclass': 'file_progress'},
|
||||
{'wmclass': 'notification'},
|
||||
{'wmclass': 'splash'},
|
||||
{'wmclass': 'toolbar'},
|
||||
{'wmclass': 'confirmreset'}, # gitk
|
||||
{'wmclass': 'makebranch'}, # gitk
|
||||
{'wmclass': 'maketag'}, # gitk
|
||||
{'wname': 'branchdialog'}, # gitk
|
||||
{'wname': 'pinentry'}, # GPG key password entry
|
||||
{'wmclass': 'ssh-askpass'}, # ssh-askpass
|
||||
# Run the utility of `xprop` to see the wm class and name of an X client.
|
||||
*layout.Floating.default_float_rules,
|
||||
Match(wm_class='confirmreset'), # gitk
|
||||
Match(wm_class='makebranch'), # gitk
|
||||
Match(wm_class='maketag'), # gitk
|
||||
Match(wm_class='ssh-askpass'), # ssh-askpass
|
||||
Match(title='branchdialog'), # gitk
|
||||
Match(title='pinentry'), # GPG key password entry
|
||||
])
|
||||
|
||||
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("", spawn=Config.get('apps_audio', "true"), layout='verticaltile', layouts=[
|
||||
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("", spawn=Config.get('apps_audio', "true")))
|
||||
groups.append(Group("", layout='floating', layouts=[
|
||||
layout.Floating(
|
||||
border_focus="#990000",
|
||||
|
@ -360,19 +347,34 @@ class Kuro(BaseTheme):
|
|||
kuro.utils.widgets.CPUInfoWidget(fontsize_left=16, 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.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(
|
||||
pulse_sink=Config.get('volume_pulse_sink', None),
|
||||
fontsize_left=18,
|
||||
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.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'
|
||||
'/checkouts/latest/libqtile/resources/battery-icons'),
|
||||
padding=0,
|
||||
),
|
||||
])
|
||||
if Config.get('show_gpu_widget', False):
|
||||
widgets.extend([
|
||||
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),
|
||||
])
|
||||
|
||||
|
@ -388,6 +390,7 @@ class Kuro(BaseTheme):
|
|||
colour_have_updates=Config.get('updates_colour_available', '#ff0000'),
|
||||
display_format=Config.get('updates_display_format', 'Updates: {updates}'),
|
||||
execute=Config.get('updates_execute_command', None),
|
||||
update_interval=Config.get('updates_interval', 600),
|
||||
**self.widget_defaults
|
||||
),
|
||||
widget.TextBox("#{}".format(x), name="default", **self.widget_defaults),
|
||||
|
@ -481,7 +484,6 @@ class Kuro(BaseTheme):
|
|||
@staticmethod
|
||||
def update_screens(qtile):
|
||||
out = utils.call_process(["xrandr", "--current"])
|
||||
#mode_out = utils.call_process(["optimus-manager", "--print-mode"])
|
||||
video_mode = "nvidia"
|
||||
#if "nvidia" in mode_out:
|
||||
# video_mode = "nvidia"
|
||||
|
@ -600,11 +602,14 @@ class Kuro(BaseTheme):
|
|||
p.wait()
|
||||
|
||||
self.log_info("Starting compositor...")
|
||||
utils.execute_once("compton -b")
|
||||
utils.execute_once("picom -b")
|
||||
|
||||
self.log_info("Starting clipboard manager...")
|
||||
utils.execute_once("xfce4-clipman")
|
||||
|
||||
self.log_info("Starting notification daemon...")
|
||||
utils.execute_once("dunst")
|
||||
|
||||
# Update color scheme
|
||||
self.initialize_colorscheme()
|
||||
|
||||
|
@ -636,9 +641,9 @@ class Kuro(BaseTheme):
|
|||
for r in dg.rules:
|
||||
pid = -1
|
||||
# noinspection PyProtectedMember
|
||||
for r2 in r.match._rules:
|
||||
if r2[0] == "net_wm_pid":
|
||||
pid = r2[1]
|
||||
for m in r.matchlist:
|
||||
if m._rules.get('net_wm_pid', None) is not None:
|
||||
pid = m._rules.get('net_wm_pid')
|
||||
break
|
||||
if pid != -1:
|
||||
self.initial_windows.append((pid, r.group))
|
||||
|
|
|
@ -12,7 +12,10 @@ from libqtile.bar import Bar
|
|||
from notify2 import Notification, URGENCY_NORMAL
|
||||
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_MIDDLE = 2
|
||||
|
@ -100,6 +103,10 @@ def notify(title, content, urgency=URGENCY_NORMAL, timeout=5000, image=None):
|
|||
|
||||
try:
|
||||
return notification.show()
|
||||
except notify2.UninittedError:
|
||||
logger.warning("Notify2 was uninitialized, initializing...")
|
||||
notify2.init("qtile")
|
||||
return notification.show()
|
||||
except DBusException as e:
|
||||
logger.warning("Showing notification failed: {}".format(e))
|
||||
logger.warning(traceback.format_exc())
|
||||
|
|
|
@ -15,68 +15,53 @@ class KuroFloating(Floating):
|
|||
super(KuroFloating, self).__init__(*args, **kwargs)
|
||||
self.add_defaults(KuroFloating.defaults)
|
||||
|
||||
def configure(self, client, screen):
|
||||
# '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
|
||||
|
||||
def configure(self, client, screen_rect):
|
||||
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:
|
||||
bc = client.group.qtile.color_pixel(self.border_focus)
|
||||
bc = self.border_focus
|
||||
else:
|
||||
bc = client.group.qtile.color_pixel(self.border_normal)
|
||||
bc = self.border_normal
|
||||
|
||||
if client.maximized:
|
||||
bw = self.max_border_width
|
||||
elif client.fullscreen:
|
||||
bw = self.fullscreen_border_width
|
||||
else:
|
||||
bw = self.border_width
|
||||
above = False
|
||||
|
||||
# We definitely have a screen here, so let's be sure we'll float on screen
|
||||
try:
|
||||
client.float_x
|
||||
client.float_y
|
||||
except AttributeError:
|
||||
# this window hasn't been placed before, let's put it in a sensible spot
|
||||
transient_for = client.window.get_wm_transient_for()
|
||||
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
|
||||
# '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:
|
||||
client.paint_borders(bc, bw)
|
||||
client.cmd_bring_to_front()
|
||||
|
||||
x = center_x - client.width / 2
|
||||
y = center_y - client.height / 2
|
||||
# alternatively, users may have asked us explicitly to leave the client alone
|
||||
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...
|
||||
x = min(x, screen.x + screen.width)
|
||||
# or left...
|
||||
x = max(x, screen.x)
|
||||
# or bottom...
|
||||
y = min(y, screen.y + screen.height)
|
||||
# or top
|
||||
y = max(y, screen.y)
|
||||
else:
|
||||
above = False
|
||||
|
||||
if not (self.no_reposition_match and self.no_reposition_match.compare(client)):
|
||||
client.x = int(round(x))
|
||||
client.y = int(round(y))
|
||||
# We definitely have a screen here, so let's be sure we'll float on screen
|
||||
try:
|
||||
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.y,
|
||||
client.width,
|
||||
client.height,
|
||||
bw,
|
||||
bc,
|
||||
above,
|
||||
)
|
||||
|
||||
client.place(
|
||||
client.x,
|
||||
client.y,
|
||||
client.width,
|
||||
client.height,
|
||||
bw,
|
||||
bc,
|
||||
above,
|
||||
)
|
||||
client.unhide()
|
||||
|
|
Loading…
Reference in a new issue