2022-10-18 17:13:21 +02:00
|
|
|
import os
|
2022-07-30 01:02:25 +02:00
|
|
|
import subprocess
|
2023-10-15 13:47:14 +02:00
|
|
|
from libqtile import bar, extension, hook, layout, qtile
|
2023-02-21 11:52:58 +01:00
|
|
|
from libqtile.lazy import lazy
|
2023-02-09 23:16:17 +01:00
|
|
|
from libqtile.config import Click, Drag, DropDown, Group, Key, Match, ScratchPad, Screen
|
2023-07-27 21:59:12 +02:00
|
|
|
from libqtile.backend.wayland import InputConfig
|
2023-08-04 23:25:14 +02:00
|
|
|
from qtile_extras import widget
|
2023-07-27 21:59:12 +02:00
|
|
|
|
|
|
|
os.environ["MOZ_ENABLE_WAYLAND"] = "1"
|
|
|
|
os.environ["MOZ_DBUS_REMOTE"] = "1"
|
2023-09-28 00:51:30 +02:00
|
|
|
os.environ["XDG_CURRENT_DESKTOP"] = "qtile:wlroots"
|
2023-07-27 21:59:12 +02:00
|
|
|
|
|
|
|
wl_input_rules = {
|
|
|
|
"type:pointer": InputConfig(natural_scroll=True),
|
|
|
|
"type:touchpad": InputConfig(tap=True,natural_scroll=True),
|
|
|
|
"type:keyboard": InputConfig(kb_layout="pl",kb_repeat_delay=280,kb_repeat_rate=30),
|
|
|
|
}
|
2022-07-29 15:49:27 +02:00
|
|
|
|
2022-10-18 17:13:21 +02:00
|
|
|
@hook.subscribe.startup_once
|
|
|
|
def autostart():
|
2023-07-29 23:50:17 +02:00
|
|
|
autostart = os.path.expanduser('~/.config/qtile/autostart.sh')
|
2023-10-15 13:47:14 +02:00
|
|
|
subprocess.run([autostart])
|
2023-07-29 23:50:17 +02:00
|
|
|
|
|
|
|
@hook.subscribe.shutdown
|
|
|
|
def autostop():
|
|
|
|
autostop = os.path.expanduser('~/.config/qtile/stop.sh')
|
2023-10-15 13:47:14 +02:00
|
|
|
subprocess.run([autostop])
|
2022-10-18 17:13:21 +02:00
|
|
|
|
2023-02-09 23:16:17 +01:00
|
|
|
mod = "mod4"
|
2022-07-29 15:49:27 +02:00
|
|
|
groups = [
|
|
|
|
Group("1", label="\uf292"),
|
2023-10-14 23:26:39 +02:00
|
|
|
Group("2", label="\uf738", matches=[Match(wm_class=["Firefox"])]),
|
2023-09-17 22:54:17 +02:00
|
|
|
Group("3", label="\uf70d", matches=[Match(wm_class=["ferdium"])]),
|
2023-09-28 00:51:30 +02:00
|
|
|
Group("4", label="\uf70d", matches=[Match(wm_class=["discord"])]),
|
2023-09-17 22:54:17 +02:00
|
|
|
Group("5", label="\uf7aa", matches=[Match(wm_class=["mutt"])]),
|
2022-07-29 15:49:27 +02:00
|
|
|
Group("6", label="\uf120"),
|
2023-03-01 14:53:05 +01:00
|
|
|
Group("7", label="\uf09c", matches=[Match(wm_class=["1Password"])]),
|
2023-03-01 14:26:05 +01:00
|
|
|
Group("8", label="\uf198", matches=[Match(wm_class=["Slack"])]),
|
2022-07-29 15:49:27 +02:00
|
|
|
Group("9", label="\uf296"),
|
|
|
|
Group("0", label="\uf2bb", matches=[Match(wm_class=["workfx"])]),
|
|
|
|
]
|
|
|
|
|
|
|
|
keys = [
|
|
|
|
# switch between windows
|
|
|
|
Key([mod], "h", lazy.layout.left()),
|
|
|
|
Key([mod], "l", lazy.layout.right()),
|
|
|
|
Key([mod], "j", lazy.layout.down()),
|
|
|
|
Key([mod], "k", lazy.layout.up()),
|
2023-03-05 19:38:14 +01:00
|
|
|
Key([mod], "Left", lazy.layout.left()),
|
|
|
|
Key([mod], "Right", lazy.layout.right()),
|
|
|
|
Key([mod], "Down", lazy.layout.down()),
|
|
|
|
Key([mod], "Up", lazy.layout.up()),
|
2022-07-29 15:49:27 +02:00
|
|
|
# move windows
|
|
|
|
Key([mod, "control"], "h", lazy.layout.shuffle_left()),
|
|
|
|
Key([mod, "control"], "l", lazy.layout.shuffle_right()),
|
|
|
|
Key([mod, "control"], "j", lazy.layout.shuffle_down()),
|
|
|
|
Key([mod, "control"], "k", lazy.layout.shuffle_up()),
|
|
|
|
# resize windows
|
|
|
|
Key([mod, "shift"], "h", lazy.layout.grow_left()),
|
|
|
|
Key([mod, "shift"], "l", lazy.layout.grow_right()),
|
|
|
|
Key([mod, "shift"], "j", lazy.layout.grow_down()),
|
|
|
|
Key([mod, "shift"], "k", lazy.layout.grow_up()),
|
2022-08-05 23:07:59 +02:00
|
|
|
Key([mod, "shift", "control"], "0", lazy.layout.normalize()),
|
2022-07-29 15:49:27 +02:00
|
|
|
# app binds
|
2023-07-27 21:59:12 +02:00
|
|
|
Key([mod], "Return", lazy.spawn("footclient")),
|
2022-07-29 15:49:27 +02:00
|
|
|
Key([mod], "space", lazy.spawncmd()),
|
2023-10-16 01:06:00 +02:00
|
|
|
Key([mod], "a", lazy.spawn("flatpak run com.yubico.yubioath")),
|
2023-10-17 02:18:45 +02:00
|
|
|
Key([mod], "e", lazy.spawn("selector-chars")),
|
2023-07-27 21:59:12 +02:00
|
|
|
Key([mod], "i", lazy.spawn("sh -c 'grim -g \"$(slurp)\"'")),
|
|
|
|
Key([mod], "m", lazy.spawn("sh -c 'pgrep -x neomutt > /dev/null || footclient -a mutt -o bold-text-in-bright=yes neomutt'")),
|
|
|
|
Key([mod, "shift"], "i", lazy.spawn("grim")),
|
|
|
|
Key([mod, "shift"], "Return", lazy.spawn("sh -c 'terminal_profile=work foot -o url.launch=workfx\ \${url}'")),
|
2023-02-22 16:19:33 +01:00
|
|
|
Key([mod, "control"], "a", lazy.spawn("selector-audio")),
|
|
|
|
Key([mod, "control"], "b", lazy.spawn("selector-bluetooth")),
|
2022-07-29 15:49:27 +02:00
|
|
|
# WM control
|
2022-11-18 17:17:32 +01:00
|
|
|
Key([mod], "f", lazy.window.toggle_floating()),
|
2022-07-29 15:49:27 +02:00
|
|
|
Key([mod], "q", lazy.window.kill()),
|
2023-10-19 00:41:28 +02:00
|
|
|
Key([mod, "control", "shift"], "l", lazy.spawn("physlock")),
|
2022-07-29 15:49:27 +02:00
|
|
|
Key([mod, "control", "shift"], "q", lazy.shutdown()),
|
|
|
|
Key([mod, "control", "shift"], "r", lazy.reload_config()),
|
2023-02-09 23:16:17 +01:00
|
|
|
Key([mod], "r", lazy.reload_config()),
|
2022-07-29 15:49:27 +02:00
|
|
|
# media keys
|
2023-10-19 00:41:28 +02:00
|
|
|
Key([], "XF86AudioMute", lazy.spawn("sb-volume mute")),
|
|
|
|
Key([], "XF86AudioMicMute", lazy.spawn("sb-volume micmute")),
|
2022-09-26 19:59:29 +02:00
|
|
|
Key([], "XF86AudioRaiseVolume", lazy.spawn("sb-volume inc")),
|
|
|
|
Key([], "XF86AudioLowerVolume", lazy.spawn("sb-volume dec")),
|
2023-10-17 02:14:32 +02:00
|
|
|
Key([], "XF86MonBrightnessUp", lazy.spawn("doas xbacklight -inc 10")),
|
|
|
|
Key([], "XF86MonBrightnessDown", lazy.spawn("doas xbacklight -dec 10")),
|
2022-07-29 15:49:27 +02:00
|
|
|
]
|
|
|
|
|
2023-02-09 23:16:17 +01:00
|
|
|
for i in groups[:10]:
|
|
|
|
keys.extend(
|
|
|
|
[
|
|
|
|
# mod1 + letter of group = switch to group
|
|
|
|
Key(
|
|
|
|
[mod], i.name, lazy.group[i.name].toscreen(),
|
|
|
|
desc="Switch to group {}".format(i.name),
|
|
|
|
),
|
|
|
|
# Key( [mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True),
|
|
|
|
# desc="Switch to & move focused window to group {}".format(i.name),
|
|
|
|
# ),
|
|
|
|
Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
|
|
|
|
desc="move focused window to group {}".format(i.name)
|
|
|
|
),
|
|
|
|
]
|
|
|
|
)
|
2022-07-29 15:49:27 +02:00
|
|
|
|
|
|
|
layouts = [
|
|
|
|
layout.Columns(
|
2023-01-27 17:21:48 +01:00
|
|
|
border_focus='#0094d8',
|
2023-01-27 17:04:59 +01:00
|
|
|
border_normal="#272822",
|
2022-09-18 12:57:25 +02:00
|
|
|
border_on_single = False,
|
2023-01-27 17:04:59 +01:00
|
|
|
border_width=5,
|
2022-07-29 15:49:27 +02:00
|
|
|
insert_position=1,
|
|
|
|
margin=[5, 5, 5, 5]
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
widget_defaults = dict(
|
2023-04-05 01:29:37 +02:00
|
|
|
background='#272822',
|
2022-11-04 02:46:17 +01:00
|
|
|
font="RobotoMono Nerd Font Medium",
|
2023-03-01 15:38:06 +01:00
|
|
|
fontsize=14,
|
2023-03-09 00:09:32 +01:00
|
|
|
foreground='#feffff',
|
2022-07-29 15:49:27 +02:00
|
|
|
)
|
|
|
|
extension_defaults = widget_defaults.copy()
|
|
|
|
|
2022-11-07 13:49:33 +01:00
|
|
|
def yubikey_replace(text):
|
2023-01-30 11:55:21 +01:00
|
|
|
return text.replace('YubiKey is waiting for a touch', 'Touch the Yubikey')
|
2022-11-07 13:49:33 +01:00
|
|
|
|
2022-07-29 15:49:27 +02:00
|
|
|
screens = [
|
|
|
|
Screen(
|
|
|
|
top=bar.Bar(
|
|
|
|
[
|
|
|
|
widget.GroupBox(
|
2023-02-09 01:42:43 +01:00
|
|
|
active='#feffff',
|
2022-07-29 15:49:27 +02:00
|
|
|
disable_drag=True,
|
2023-03-05 19:30:29 +01:00
|
|
|
fontsize=18,
|
2023-09-30 01:06:25 +02:00
|
|
|
highlight_color='#272822',
|
2023-10-09 23:25:21 +02:00
|
|
|
highlight_method='block',
|
2023-09-30 01:16:35 +02:00
|
|
|
mouse_callbacks={"Button1": lambda: None},
|
2022-07-29 15:49:27 +02:00
|
|
|
rounded=False,
|
2023-02-09 01:36:36 +01:00
|
|
|
this_current_screen_border='#005577',
|
2023-10-09 23:25:21 +02:00
|
|
|
urgent_alert_method='block',
|
2022-11-06 00:01:52 +01:00
|
|
|
urgent_border='#770000',
|
2023-09-30 01:16:35 +02:00
|
|
|
use_mouse_wheel=False,
|
2022-07-29 15:49:27 +02:00
|
|
|
),
|
|
|
|
widget.Prompt(
|
2023-02-09 23:16:17 +01:00
|
|
|
bell_style=None,
|
2022-07-29 15:49:27 +02:00
|
|
|
prompt='open: ',
|
|
|
|
record_history=False,
|
|
|
|
),
|
|
|
|
widget.Spacer(),
|
2022-11-07 00:05:36 +01:00
|
|
|
widget.Notify(
|
2022-11-04 02:46:17 +01:00
|
|
|
background='#e8b923',
|
2023-01-31 22:14:25 +01:00
|
|
|
background_low='#272822',
|
2022-11-07 00:57:41 +01:00
|
|
|
background_urgent='#770000',
|
2022-11-04 02:46:17 +01:00
|
|
|
foreground='#000000',
|
2023-02-09 01:42:43 +01:00
|
|
|
foreground_low='#c7c7c7',
|
|
|
|
foreground_urgent='#feffff',
|
2022-11-04 02:46:17 +01:00
|
|
|
font='RobotoMono Nerd Font Bold',
|
2022-11-07 13:49:33 +01:00
|
|
|
parse_text=yubikey_replace,
|
2022-11-06 16:27:52 +01:00
|
|
|
),
|
2022-11-06 16:00:39 +01:00
|
|
|
widget.GenPollCommand(
|
2023-02-09 01:36:36 +01:00
|
|
|
background='#005577',
|
2023-02-09 01:42:43 +01:00
|
|
|
foreground='#feffff',
|
2022-08-23 00:19:44 +02:00
|
|
|
update_interval=1,
|
2022-11-06 16:00:39 +01:00
|
|
|
cmd="sb-mail",
|
2022-07-29 15:49:27 +02:00
|
|
|
),
|
2022-11-06 16:00:39 +01:00
|
|
|
widget.GenPollCommand(
|
2022-11-06 00:01:52 +01:00
|
|
|
background='#770000',
|
2023-02-09 01:42:43 +01:00
|
|
|
foreground='#feffff',
|
2022-11-03 17:31:27 +01:00
|
|
|
update_interval=1,
|
2022-11-06 16:00:39 +01:00
|
|
|
cmd="sb-volume",
|
2022-11-03 17:31:27 +01:00
|
|
|
),
|
2023-02-09 01:23:49 +01:00
|
|
|
widget.GenPollCommand(
|
|
|
|
background='#770000',
|
2023-02-09 01:42:43 +01:00
|
|
|
foreground='#feffff',
|
2023-02-09 01:23:49 +01:00
|
|
|
update_interval=1,
|
|
|
|
cmd="sb-network",
|
2022-12-17 00:47:11 +01:00
|
|
|
),
|
2023-04-13 23:52:59 +02:00
|
|
|
widget.GenPollCommand(
|
2022-08-23 00:19:44 +02:00
|
|
|
update_interval=1,
|
2023-04-13 23:52:59 +02:00
|
|
|
cmd="sb-battery",
|
2022-07-29 15:49:27 +02:00
|
|
|
),
|
|
|
|
widget.Clock(
|
2022-11-07 13:49:33 +01:00
|
|
|
format='[%d] %H:%M:%S',
|
2022-07-29 15:49:27 +02:00
|
|
|
),
|
2023-07-27 21:59:12 +02:00
|
|
|
widget.StatusNotifier(
|
|
|
|
icon_size=18,
|
|
|
|
),
|
2022-07-29 15:49:27 +02:00
|
|
|
],
|
|
|
|
24,
|
2022-11-06 13:32:50 +01:00
|
|
|
margin=[5, 5, 0, 5]
|
2022-07-29 15:49:27 +02:00
|
|
|
),
|
2023-02-09 23:16:17 +01:00
|
|
|
wallpaper=os.environ['XDG_CONFIG_HOME'] + '/qtile/wallpaper.img',
|
2022-11-08 17:43:49 +01:00
|
|
|
wallpaper_mode='fill',
|
2022-07-29 15:49:27 +02:00
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
mouse = [
|
|
|
|
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
|
|
|
|
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
|
|
|
|
Click([mod], "Button2", lazy.window.bring_to_front()),
|
|
|
|
]
|
|
|
|
|
|
|
|
floating_layout = layout.Floating(
|
|
|
|
float_rules=[
|
|
|
|
*layout.Floating.default_float_rules,
|
2023-07-27 21:59:12 +02:00
|
|
|
Match(title="File Upload"),
|
|
|
|
Match(title="Open File"),
|
|
|
|
Match(title="Open file"),
|
|
|
|
Match(title="Open Files"),
|
|
|
|
Match(title="Firefox — Sharing Indicator"),
|
|
|
|
Match(title="Enter name of file to save to…"),
|
|
|
|
Match(title="Save Image"),
|
2022-07-29 15:49:27 +02:00
|
|
|
],
|
2023-02-09 23:16:17 +01:00
|
|
|
border_focus='#005577',
|
2022-07-29 15:49:27 +02:00
|
|
|
border_normal="#272822",
|
2023-02-09 23:16:17 +01:00
|
|
|
border_width=5,
|
2022-07-29 15:49:27 +02:00
|
|
|
)
|
2023-08-13 02:20:13 +02:00
|
|
|
|
2023-09-30 01:06:25 +02:00
|
|
|
focus_on_window_activation = "urgent"
|
2023-07-11 00:57:37 +02:00
|
|
|
wmname = "qtile"
|