diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2021-12-19 17:16:48 +0100 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2021-12-19 17:16:48 +0100 |
commit | 268e376a317895ef2c3666055c750a56ae3b21c3 (patch) | |
tree | aedc66971c32961705385f01cc7906e7739e0a0a /.config | |
parent | 5422ea7430f070323bbf8c6304567f248912781a (diff) | |
download | dotfiles-268e376a317895ef2c3666055c750a56ae3b21c3.tar.gz dotfiles-268e376a317895ef2c3666055c750a56ae3b21c3.zip |
mv qtile to .config
Diffstat (limited to '.config')
-rwxr-xr-x | .config/qtile/autorc | 26 | ||||
-rw-r--r-- | .config/qtile/config.py | 199 | ||||
-rw-r--r-- | .config/qtile/python.png | bin | 0 -> 52166 bytes |
3 files changed, 225 insertions, 0 deletions
diff --git a/.config/qtile/autorc b/.config/qtile/autorc new file mode 100755 index 0000000..14969c9 --- /dev/null +++ b/.config/qtile/autorc | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | function off_monitor_if_hdmi_plugged_in() { | ||
4 | monitor_status=$(xrandr | grep "HDMI-1-4 connected" | wc -l) | ||
5 | |||
6 | if [ $monitor_status == 1 ]; | ||
7 | then | ||
8 | xrandr --auto | ||
9 | xrandr --output eDP-1 --off | ||
10 | fi | ||
11 | } | ||
12 | |||
13 | function caps_to_esc(){ xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'; } | ||
14 | |||
15 | function start() { | ||
16 | killall $1 | ||
17 | sleep .5 | ||
18 | $($1 $2) & | ||
19 | } | ||
20 | |||
21 | off_monitor_if_hdmi_plugged_in | ||
22 | caps_to_esc | ||
23 | |||
24 | start picom "-b -D 4 --vsync" | ||
25 | start nitrogen "--restore" | ||
26 | start run_spotifyd | ||
diff --git a/.config/qtile/config.py b/.config/qtile/config.py new file mode 100644 index 0000000..0ab888b --- /dev/null +++ b/.config/qtile/config.py | |||
@@ -0,0 +1,199 @@ | |||
1 | import os | ||
2 | import subprocess | ||
3 | |||
4 | from typing import List | ||
5 | |||
6 | from libqtile import bar, layout, widget | ||
7 | from libqtile.config import Click, Drag, Group, Key, Match, Screen | ||
8 | from libqtile import extension | ||
9 | from libqtile.lazy import lazy | ||
10 | from libqtile.utils import guess_terminal | ||
11 | from libqtile import hook | ||
12 | |||
13 | mod = "mod4" | ||
14 | terminal = guess_terminal() | ||
15 | |||
16 | BAR = '#282a36' | ||
17 | YELLOW = '#f1fa8c' | ||
18 | RED = '#ff5555' | ||
19 | GREEN = '#50fa7b' | ||
20 | CYAN = '#8be9fd' | ||
21 | |||
22 | |||
23 | @hook.subscribe.startup_once | ||
24 | def autostart(): | ||
25 | home = os.path.expanduser('~/.config/qtile/autorc') | ||
26 | subprocess.run([home]) | ||
27 | |||
28 | keys = [ | ||
29 | Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), | ||
30 | Key([mod], "l", lazy.layout.right(), desc="Move focus to right"), | ||
31 | Key([mod], "j", lazy.layout.down(), desc="Move focus down"), | ||
32 | Key([mod], "k", lazy.layout.up(), desc="Move focus up"), | ||
33 | Key([mod], "space", lazy.layout.next(), | ||
34 | desc="Move window focus to other window"), | ||
35 | |||
36 | Key([mod, "shift"], "h", lazy.layout.shuffle_left(), | ||
37 | desc="Move window to the left"), | ||
38 | Key([mod, "shift"], "l", lazy.layout.shuffle_right(), | ||
39 | desc="Move window to the right"), | ||
40 | Key([mod, "shift"], "j", lazy.layout.shuffle_down(), | ||
41 | desc="Move window down"), | ||
42 | Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), | ||
43 | |||
44 | Key([mod, "control"], "h", lazy.layout.grow_left(), | ||
45 | desc="Grow window to the left"), | ||
46 | Key([mod, "control"], "l", lazy.layout.grow_right(), | ||
47 | desc="Grow window to the right"), | ||
48 | Key([mod, "control"], "j", lazy.layout.grow_down(), | ||
49 | desc="Grow window down"), | ||
50 | Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), | ||
51 | Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), | ||
52 | |||
53 | Key([mod, "shift"], "Return", lazy.layout.toggle_split(), | ||
54 | desc="Toggle between split and unsplit sides of stack"), | ||
55 | Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), | ||
56 | |||
57 | Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"), | ||
58 | Key([mod], "c", lazy.window.kill(), desc="Kill focused window"), | ||
59 | |||
60 | Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"), | ||
61 | Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), | ||
62 | Key([mod], "r", lazy.spawncmd(), | ||
63 | desc="Spawn a command using a prompt widget"), | ||
64 | |||
65 | Key([mod], "p", lazy.run_extension(extension.DmenuRun( | ||
66 | dmenu_prompt="$", | ||
67 | dmenu_bottom=False, | ||
68 | dmenu_lines=56, | ||
69 | background=BAR, | ||
70 | foreground=CYAN, | ||
71 | ))), | ||
72 | |||
73 | Key([mod, "mod1"], "q", lazy.spawn("qutebrowser"), desc="Spawn qutebrowser"), | ||
74 | Key([mod, "mod1"], "b", lazy.spawn("brave"), desc="Spawn brave"), | ||
75 | Key([mod, "mod1"], "e", lazy.spawn("emacs"), desc="Spawn emacs"), | ||
76 | Key([mod, "mod1"], "s", lazy.spawn("alacritty -e spt"), desc="Spawn spt (spotify clent)"), | ||
77 | ] | ||
78 | groups_names = [ | ||
79 | "dev", | ||
80 | "www", | ||
81 | "music", | ||
82 | "virt", | ||
83 | "sys", | ||
84 | "other" | ||
85 | ] | ||
86 | |||
87 | groups = [Group(i) for i in groups_names] | ||
88 | abc = 0 | ||
89 | for i in groups: | ||
90 | abc += 1 | ||
91 | keys.extend([ | ||
92 | Key([mod], str(abc), lazy.group[i.name].toscreen(), | ||
93 | desc="Switch to group {}".format(i.name)), | ||
94 | |||
95 | Key([mod, "shift"], str(abc), lazy.window.togroup(i.name, switch_group=True), | ||
96 | desc="Switch to & move focused window to group {}".format(i.name)), | ||
97 | ]) | ||
98 | |||
99 | |||
100 | layout_cfg = { | ||
101 | 'border_width': 2, | ||
102 | 'border_normal': "#bb8888", | ||
103 | 'border_focus': "884444", | ||
104 | 'margin': 8 | ||
105 | } | ||
106 | |||
107 | layouts = [ | ||
108 | layout.Columns(**layout_cfg), | ||
109 | # layout.Max(), | ||
110 | layout.Stack(num_stacks=1, **layout_cfg), | ||
111 | # layout.Bsp(), | ||
112 | # layout.Matrix(), | ||
113 | # layout.MonadTall(), | ||
114 | # layout.MonadWide(), | ||
115 | # layout.RatioTile(), | ||
116 | # layout.Tile(), | ||
117 | # layout.TreeTab(), | ||
118 | # layout.VerticalTile(), | ||
119 | # layout.Zoomy(), | ||
120 | ] | ||
121 | |||
122 | widget_defaults = dict( | ||
123 | font='sans', | ||
124 | fontsize=12, | ||
125 | padding=6, | ||
126 | ) | ||
127 | extension_defaults = widget_defaults.copy() | ||
128 | |||
129 | transparent_sep = { | ||
130 | 'foreground': BAR, | ||
131 | 'margin': 2 | ||
132 | } | ||
133 | |||
134 | soft_sep = { | ||
135 | 'foreground': '44475a', | ||
136 | 'padding': 2, | ||
137 | 'margin': 4 | ||
138 | } | ||
139 | |||
140 | screens = [ | ||
141 | Screen( | ||
142 | top=bar.Bar( | ||
143 | [ | ||
144 | widget.Sep(**transparent_sep), | ||
145 | widget.Image(filename="~/.config/qtile/python.png", margin=4), | ||
146 | widget.Sep(**transparent_sep), | ||
147 | widget.CurrentLayout(), | ||
148 | widget.Sep(**transparent_sep), | ||
149 | widget.GroupBox(), | ||
150 | widget.Prompt(), | ||
151 | widget.Sep(**transparent_sep), | ||
152 | widget.WindowName(), | ||
153 | widget.Net(format="↓{down} ↑{up}", foreground=YELLOW), | ||
154 | widget.Sep(**soft_sep), | ||
155 | widget.CPU(format=' {load_percent}%', fontsize=12, foreground=RED), | ||
156 | widget.Sep(**soft_sep), | ||
157 | widget.Battery(foreground=GREEN), | ||
158 | widget.Sep(**soft_sep), | ||
159 | widget.Clock(timezone='Europe/Warsaw', format='%B %-d, %H:%M', foreground=CYAN), | ||
160 | ], | ||
161 | 24, | ||
162 | margin=8, | ||
163 | background=BAR, | ||
164 | border_color=CYAN, | ||
165 | border_width=1 | ||
166 | ), | ||
167 | ), | ||
168 | ] | ||
169 | |||
170 | mouse = [ | ||
171 | Drag([mod], "Button1", lazy.window.set_position_floating(), | ||
172 | start=lazy.window.get_position()), | ||
173 | Drag([mod], "Button3", lazy.window.set_size_floating(), | ||
174 | start=lazy.window.get_size()), | ||
175 | Click([mod], "Button2", lazy.window.bring_to_front()) | ||
176 | ] | ||
177 | |||
178 | dgroups_key_binder = None | ||
179 | dgroups_app_rules = [] # type: List | ||
180 | follow_mouse_focus = True | ||
181 | bring_front_click = False | ||
182 | cursor_warp = False | ||
183 | floating_layout = layout.Floating(float_rules=[ | ||
184 | # Run the utility of `xprop` to see the wm class and name of an X client. | ||
185 | *layout.Floating.default_float_rules, | ||
186 | Match(wm_class='confirmreset'), # gitk | ||
187 | Match(wm_class='makebranch'), # gitk | ||
188 | Match(wm_class='maketag'), # gitk | ||
189 | Match(wm_class='ssh-askpass'), # ssh-askpass | ||
190 | Match(title='branchdialog'), # gitk | ||
191 | Match(title='pinentry'), # GPG key password entry | ||
192 | ]) | ||
193 | auto_fullscreen = True | ||
194 | focus_on_window_activation = "smart" | ||
195 | reconfigure_screens = True | ||
196 | |||
197 | auto_minimize = True | ||
198 | |||
199 | wmname = "LG3D" | ||
diff --git a/.config/qtile/python.png b/.config/qtile/python.png new file mode 100644 index 0000000..9a4b1ed --- /dev/null +++ b/.config/qtile/python.png | |||
Binary files differ | |||