multiple backgrounds, translucent bar, bugfixes
This commit is contained in:
135
qtile/config.py
135
qtile/config.py
@@ -33,7 +33,8 @@ from qtile_extras.widget.decorations import PowerLineDecoration
|
||||
import subprocess
|
||||
import os
|
||||
import logging
|
||||
from libqtile import hook
|
||||
import random
|
||||
from libqtile import hook, qtile
|
||||
|
||||
@hook.subscribe.startup
|
||||
def dbus_register():
|
||||
@@ -61,6 +62,15 @@ def autostart_once():
|
||||
def autostart():
|
||||
subprocess.run('/home/danmac/.config/qtile/refresh.sh')
|
||||
|
||||
def get_random_wallpaper():
|
||||
wallpaper_folder = '/home/shared/Pictures/wallpapers/'
|
||||
wallpapers = os.listdir(wallpaper_folder)
|
||||
return f'{wallpaper_folder}{random.choice(wallpapers)}'
|
||||
|
||||
def change_wallpaper():
|
||||
for screen in screens:
|
||||
lazy.screen.set_background(get_random_wallpaper())
|
||||
|
||||
colors = {
|
||||
"orange": "F8954F",
|
||||
"teal": "34C2D4",
|
||||
@@ -82,7 +92,6 @@ keys = [
|
||||
Key([mod], "Right", lazy.layout.right(), desc="Move focus to right"),
|
||||
Key([mod], "Down", lazy.layout.down(), desc="Move focus down"),
|
||||
Key([mod], "Up", lazy.layout.up(), desc="Move focus up"),
|
||||
Key([mod], "space", lazy.layout.next(), desc="Move window focus to other window"),
|
||||
Key([mod, "shift"], "Left", lazy.next_screen(), desc="Move to next screen"),
|
||||
Key([mod, "shift"], "Right", lazy.prev_screen(), desc="Move to previous screen"),
|
||||
# Move windows between left/right columns or move up/down in current stack.
|
||||
@@ -119,12 +128,12 @@ keys = [
|
||||
Key([mod, "control"], "y", lazy.spawn("gtk-launch FFPWA-01HATKWJX09JCYK2HQ0E2MGSRY.desktop"), desc="Launch YouTube"),
|
||||
Key([mod, "control"], "v", lazy.spawn("VirtualBox"), desc="Launch VirtualBox"),
|
||||
Key([mod, "control"], "c", lazy.spawn("gtk launch arch-codium.dekstop"), desc="Launch VSCodium"),
|
||||
Key([mod, "control"], "j", lazy.spawn("gtk-launch arch-pycharm-professional.desktop"), desc="Launch PyCharm"),
|
||||
Key([], "Print", lazy.spawn("flatpak run org.flameshot.Flameshot gui"), desc="Screenshot"),
|
||||
# Toggle between different layouts as defined below
|
||||
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
|
||||
Key([mod, "shift"], "Tab", lazy.prev_layout(), desc="Toggle between layouts"),
|
||||
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
|
||||
Key([mod, "shift"], "b", lazy.screen.set_wallpaper(get_random_wallpaper()), desc="Change desktop wallpapers"),
|
||||
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
|
||||
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
|
||||
Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
|
||||
@@ -134,7 +143,7 @@ keys = [
|
||||
Key([], "XF86AudioRaiseVolume", lazy.spawn("amixer set Master 5%+"), desc="Increase volume"),
|
||||
Key([mod], "s", lazy.screen.next_group(skip_managed=True), desc="Switch to Next Group"),
|
||||
Key([mod], "w", lazy.screen.prev_group(skip_managed=True), desc="Switch to Previous Group"),
|
||||
Key([mod, "mod1"], "l", lazy.spawn("light-locker-command -l"), desc="Switch to Previous Group"),
|
||||
Key([mod, "mod1"], "l", lazy.spawn("light-locker-command -l"), desc="Lock Screen"),
|
||||
]
|
||||
|
||||
groups = [Group(i) for i in "123456789"]
|
||||
@@ -165,15 +174,15 @@ for i in groups:
|
||||
|
||||
layout_defaults = {
|
||||
"border_width": 2,
|
||||
"margin": 8,
|
||||
"border_focus": colors["red"],
|
||||
"margin": [0, 4, 4, 4],
|
||||
"border_focus": "#ffffff",
|
||||
}
|
||||
|
||||
layouts = [
|
||||
layout.Columns(border_focus_stack=["#3333cc", "#3366ff"], **layout_defaults),
|
||||
layout.Max(),
|
||||
# Try more layouts by unleashing below layouts.
|
||||
# layout.Stack(num_stacks=2),
|
||||
layout.Stack(num_stacks=1, **layout_defaults),
|
||||
# layout.Bsp(),
|
||||
# layout.Matrix(),
|
||||
layout.MonadTall(ratio=0.75, **layout_defaults),
|
||||
@@ -186,8 +195,10 @@ layouts = [
|
||||
# layout.Zoomy(),
|
||||
]
|
||||
|
||||
# defaults for groups
|
||||
groups[0].layout = "monadthreecol"
|
||||
# default layouts for groups
|
||||
groups[1].layout = "monadthreecol"
|
||||
groups[2].layout = "stack"
|
||||
|
||||
# groups[1].spawn = "flatpak run com.microsoft.Edge"
|
||||
|
||||
powerline = {
|
||||
@@ -221,6 +232,8 @@ app_launcher = widget.WidgetBox(
|
||||
shutdown_progs = [
|
||||
("Reboot", "systemctl reboot", "Reboot"),
|
||||
("Shutdown", "systemctl halt", "Shutdown"),
|
||||
("Logout", "qtile cmd-obj -o cmd -f shutdown", "Logout"),
|
||||
("Lock", "light-locker-command -l", "Lock"),
|
||||
]
|
||||
|
||||
widget_defaults = dict(
|
||||
@@ -228,17 +241,27 @@ widget_defaults = dict(
|
||||
fontsize=14,
|
||||
padding=3,
|
||||
)
|
||||
|
||||
extension_defaults = widget_defaults.copy()
|
||||
|
||||
groupbox_colors = {
|
||||
"highlight_method": "block",
|
||||
"block_highlight_text_color": "000000",
|
||||
"this_current_screen_border": "ffffff",
|
||||
"this_screen_border": "ffffff",
|
||||
"other_screen_border": "777777",
|
||||
"other_current_screen_border": "777777",
|
||||
"inactive": "777777",
|
||||
}
|
||||
|
||||
screens = [
|
||||
Screen(
|
||||
top=bar.Bar(
|
||||
[
|
||||
widget.CurrentLayoutIcon(scale=0.7, padding=14, background=colors["teal"], **powerline),
|
||||
widget.GroupBox(background=colors["purple"], this_current_screen_border="ffffff", this_screen_border="ffffff", **powerline),
|
||||
widget.CurrentLayoutIcon(scale=0.7, padding=14),
|
||||
widget.GroupBox(**groupbox_colors),
|
||||
# widget.Prompt(background="333333", **powerline),
|
||||
widget.WindowName(background=colors["blue"], **powerline),
|
||||
widget.WindowTabs(),
|
||||
widget.Chord(
|
||||
chords_colors={
|
||||
"launch": ("#ff0000", "#ffffff"),
|
||||
@@ -251,78 +274,84 @@ screens = [
|
||||
# widget.StatusNotifier(),
|
||||
# app_launcher,
|
||||
widget.WidgetBox(
|
||||
widgets=[widget.LaunchBar(progs=lb_progs, padding=12, background=colors["red"]),],
|
||||
background=colors["red"],
|
||||
widgets=[widget.LaunchBar(progs=lb_progs, padding=12),],
|
||||
text_closed=" ▶ ",
|
||||
text_open=" ◀ ",
|
||||
**powerline
|
||||
),
|
||||
# widget.Systray(background=colors["red"], **powerline),
|
||||
# widget.Spacer(background=colors["red"], length=2, **powerline),
|
||||
widget.Spacer(length=8),
|
||||
# widget.pulse_volume(),
|
||||
# widget.PulseVolume(background=colors["purple"], **powerline),
|
||||
widget.UPowerWidget(background=colors["purple"], **powerline),
|
||||
widget.CPUGraph(background=colors["purple"], border_width=0, **powerline),
|
||||
widget.NvidiaSensors(background=colors["purple"], threshold=85, **powerline),
|
||||
widget.Clock(format="%a %d %b %Y %I:%M %p", background=colors["orange"], **powerline),
|
||||
widget.UPowerWidget(),
|
||||
widget.CapsNumLockIndicator(),
|
||||
widget.CPUGraph(border_width=0),
|
||||
widget.ThermalSensor(tag_sensor='Package id 0', format='CPU: {temp}{unit}', threshold=85),
|
||||
widget.NvidiaSensors(threshold=85, format='GPU: {temp}°C'),
|
||||
widget.Wttr(location={'Adelaide, Australia':"Home"}),
|
||||
widget.Systray(),
|
||||
widget.Clock(format="%a %d %b %Y %I:%M %p"),
|
||||
# widget.Wallpaper(directory='/home/shared/Pictures/wallpapers/', random_selection=True, label="🖼️"),
|
||||
# widget.QuickExit(),
|
||||
widget.WidgetBox(
|
||||
widgets=[
|
||||
widget.LaunchBar(padding=12, background=colors["teal"], progs=shutdown_progs),
|
||||
widget.LaunchBar(padding=12, progs=shutdown_progs),
|
||||
],
|
||||
background=colors["teal"],
|
||||
text_closed=" ⏻ ▶ ",
|
||||
text_open=" ⏻ ◀ ",
|
||||
),
|
||||
],
|
||||
32,
|
||||
margin=4,
|
||||
background=["#00000099"],
|
||||
# border_width=[2, 0, 2, 0], # Draw top and bottom borders
|
||||
# border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
|
||||
),
|
||||
wallpaper="/home/shared/Pictures/wallhaven-39exm3.jpg",
|
||||
wallpaper=get_random_wallpaper(),
|
||||
wallpaper_mode="fill"
|
||||
),
|
||||
Screen(
|
||||
top=bar.Bar(
|
||||
[
|
||||
widget.CurrentLayoutIcon(scale=0.7,padding=14, background=colors["teal"], **powerline),
|
||||
widget.GroupBox(background=colors["purple"], this_current_screen_border="ffffff", this_screen_border="ffffff", **powerline),
|
||||
widget.Prompt(background=colors["purple"], **powerline),
|
||||
widget.WindowName(background=colors["blue"], **powerline),
|
||||
widget.Chord(
|
||||
chords_colors={
|
||||
"launch": ("#ff0000", "#ffffff"),
|
||||
},
|
||||
name_transform=lambda name: name.upper(),
|
||||
),
|
||||
# widget.TextBox("default config", name="default"),
|
||||
# widget.TextBox("Press <M-r> to spawn", foreground="#d75f5f"),
|
||||
# NB Systray is incompatible with Wayland, consider using StatusNotifier instead
|
||||
# widget.StatusNotifier(background="999999"),
|
||||
# app_launcher,
|
||||
widget.WidgetBox(
|
||||
widgets=[widget.LaunchBar(progs=lb_progs, padding=12, background=colors["red"]),],
|
||||
background=colors["red"],
|
||||
text_closed=" ▶",
|
||||
text_open=" ◀",
|
||||
**powerline
|
||||
),
|
||||
widget.Systray(background=colors["red"], **powerline),
|
||||
# widget.Systray(background=colors["red"]),
|
||||
# widget.ALSAWidget(background="999999", mode="both"),
|
||||
# widget.Spacer(length=2, background=colors["red"], **powerline),
|
||||
widget.Clock(format="%a %d %b %Y %I:%M %p", background=colors["orange"]),
|
||||
widget.CurrentLayoutIcon(scale=0.7,padding=14), # , background=colors["teal"], **powerline),
|
||||
widget.GroupBox(**groupbox_colors),
|
||||
widget.Prompt(), # background=colors["purple"], **powerline),
|
||||
widget.WindowTabs(), # background=colors["blue"], **powerline),
|
||||
widget.Spacer(), # background=colors["blue"], **powerline),
|
||||
widget.Clock(format="%a %d %b %Y %I:%M %p",), # background=colors["orange"]),
|
||||
],
|
||||
32,
|
||||
margin=4,
|
||||
background=["#00000099"],
|
||||
# border_width=[2, 0, 2, 0], # Draw top and bottom borders
|
||||
# border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
|
||||
),
|
||||
wallpaper="/home/shared/Pictures/wallhaven-39exm3.jpg",
|
||||
wallpaper=get_random_wallpaper(),
|
||||
wallpaper_mode="fill"
|
||||
),
|
||||
Screen(
|
||||
top=bar.Bar(
|
||||
[
|
||||
widget.CurrentLayoutIcon(scale=0.7,padding=14),
|
||||
widget.GroupBox(**groupbox_colors),
|
||||
widget.Prompt(),
|
||||
widget.WindowTabs(),
|
||||
widget.Spacer(),
|
||||
widget.Clock(format="%a %d %b %Y %I:%M %p"),
|
||||
],
|
||||
32,
|
||||
margin=4,
|
||||
background=["#00000099"],
|
||||
# border_width=[2, 0, 2, 0], # Draw top and bottom borders
|
||||
# border_color=["ff00ff", "000000", "ff00ff", "000000"] # Borders are magenta
|
||||
),
|
||||
wallpaper=get_random_wallpaper(),
|
||||
wallpaper_mode="fill"
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Drag floating layouts.
|
||||
mouse = [
|
||||
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
|
||||
@@ -332,7 +361,7 @@ mouse = [
|
||||
|
||||
dgroups_key_binder = None
|
||||
dgroups_app_rules = [] # type: list
|
||||
follow_mouse_focus = True
|
||||
follow_mouse_focus = False
|
||||
bring_front_click = True
|
||||
cursor_warp = False
|
||||
floating_layout = layout.Floating(
|
||||
|
||||
Reference in New Issue
Block a user