-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfig_keybindings.py
117 lines (82 loc) · 2.86 KB
/
config_keybindings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
"""
MODIFY THIS FILE TO CREATE CUSTOM KEYBINDINGS
Keybindings are configured with tuples, inside Predifined lists Variables
Modifier -> list() -> Ex: [MOD, CONTROL]
Key -> str() -> Ex: 'j'
Command -> str() -> Ex: vscode
(Modifier, Key, Command)
"""
from libqtile.confreader import ConfigError
# Import default mod keys
from keys.default import *
from functions import PWA
from os.path import expanduser
HOME = expanduser("~")
# Define constants here
TERMINAL = "alacritty"
# Basic window manager movements
# Qtile shutdown/restart keys
SHUTDOWN_MODIFIER = [MOD, CONTROL]
RESTART = "r"
SHUTDOWN = "q"
# Group movement keys:
GROUPS_KEY = CONTROL
SWAP_GROUP_KEY = SHIFT
NEXT_GROUP = "period"
PREV_GROUP = "comma"
# ------------ Hardware Configs ------------
HARDWARE_KEYS = [
# (Modifier, Key, Command)
# Volume
([], "XF86AudioLowerVolume", "pactl set-sink-volume @DEFAULT_SINK@ -5%"),
([], "XF86AudioRaiseVolume", "pactl set-sink-volume @DEFAULT_SINK@ +5%"),
([], "XF86AudioMute", "pactl set-sink-mute @DEFAULT_SINK@ toggle"),
# Brightness
([], "XF86MonBrightnessUp", "brightnessctl set +5%"),
([], "XF86MonBrightnessDown", "brightnessctl set 5%-"),
]
APPS = [
([MOD], "Return", TERMINAL),
# (Modifier, Key, Command)
([MOD], "e", "thunar"),
([MOD, ALT], "d", "emacs"),
([MOD, ALT], "o", "env LIBGL_ALWAYS_SOFTWARE=1 obs"),
([MOD, ALT], "v", "gvim"),
([MOD, ALT], "b", "brave"),
([MOD, ALT], "c", "code"),
([MOD, ALT], "p", "pycharm"),
([MOD, ALT], "a", "pavucontrol"),
([MOD, ALT], "e", "vim -g .config/qtile/config.py"),
([MOD, ALT], "z", "zoom"),
# Media hotkeys
([MOD], "Up", "pulseaudio-ctl up 5"),
([MOD], "Down", "pulseaudio-ctl down 5"),
# Makes reference to play-pause script
# You can find it in my scripts repository
([ALTGR], "space", "play-pause"),
# Run "rofi-theme-selector" in terminal to select a theme
([MOD], "space", 'rofi -modi "drun,power-menu:rofi-power-menu,run,window,ssh" -show drun -show-icons'),
# Screenshots
([], "Print", "xfce4-screenshooter"),
# Full screen screenshot
([ALT], "Print", "xfce4-screenshooter -f -c"),
# Terminal apps
([MOD, ALT], "n", TERMINAL + " -e nvim"),
]
##########################
# Your custom keys here #
##########################
CUSTOM_SPAWN_KEYS = [
# PWA keys
([MOD, ALT], "s", PWA.spotify()),
([MOD, ALT], "m", PWA.music()),
([MOD, ALT], "t", PWA.calendar()),
([MOD, ALT], "y", PWA.youtube()),
([MOD, ALT], "l", PWA.notion()),
([MOD, ALT], "h", PWA.habitica()),
]
SPAWN_KEYS = HARDWARE_KEYS + APPS + CUSTOM_SPAWN_KEYS
SPAWN_CMD_KEYS = [
# Takes full screenshot and creates a file on the screenshot folder
([SHIFT], "Print", f"xfce4-screenshooter -f -s {HOME}/Pictures/Screenshots/"),
]