diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2024-09-20 14:16:56 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2024-09-20 14:16:56 +0200 |
commit | 45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a (patch) | |
tree | b564c1c43920def6641cd482a7b4dca453dbc043 /files/.config/qtile | |
parent | 07dd8e37eb767c3dd6abf63e5e4a720cd778da15 (diff) | |
download | dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.tar.gz dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.zip |
Change dotfiles structure, and add guix-channels declaration.
Diffstat (limited to 'files/.config/qtile')
-rwxr-xr-x | files/.config/qtile/autorc | 31 | ||||
-rw-r--r-- | files/.config/qtile/config.py | 232 | ||||
-rwxr-xr-x | files/.config/qtile/mdt_shell | 1 | ||||
-rw-r--r-- | files/.config/qtile/photos/desktop.png | bin | 0 -> 1555228 bytes | |||
-rw-r--r-- | files/.config/qtile/python.png | bin | 0 -> 52166 bytes | |||
-rw-r--r-- | files/.config/qtile/readme.org | 5 |
6 files changed, 269 insertions, 0 deletions
diff --git a/files/.config/qtile/autorc b/files/.config/qtile/autorc new file mode 100755 index 0000000..c54f683 --- /dev/null +++ b/files/.config/qtile/autorc | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | function monitor_settings() { | ||
4 | sleep .5 | ||
5 | monitor_status=$(xrandr | grep "HDMI-1-4 connected" | wc -l) | ||
6 | |||
7 | if [ $monitor_status == 1 ]; | ||
8 | then | ||
9 | # xrandr --auto | ||
10 | # xrandr --output eDP-1 --off | ||
11 | xrandr --output eDP-1-1 --auto --output HDMI-0 --auto --left-of eDP-1-1 | ||
12 | fi | ||
13 | } | ||
14 | |||
15 | function caps_to_esc(){ xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'; } | ||
16 | |||
17 | function start() { | ||
18 | killall $1 | ||
19 | sleep .5 | ||
20 | $($1 $2) & | ||
21 | } | ||
22 | |||
23 | # monitor_settings | ||
24 | caps_to_esc | ||
25 | |||
26 | start nitrogen "--restore" | ||
27 | start picom "" | ||
28 | start spotifyd "" | ||
29 | start rclone "mount remote:/sync /home/jakub/Sync" | ||
30 | start emacs "--daemon" | ||
31 | xinput set-prop 11 344 1 | ||
diff --git a/files/.config/qtile/config.py b/files/.config/qtile/config.py new file mode 100644 index 0000000..9106731 --- /dev/null +++ b/files/.config/qtile/config.py | |||
@@ -0,0 +1,232 @@ | |||
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, KeyChord | ||
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 | |||
15 | TERMINAL = guess_terminal() | ||
16 | |||
17 | DMENU_FLAGS = '-l 16 -p run -c -i' | ||
18 | |||
19 | BAR = '#282a36' | ||
20 | LIGHT_BAR = '#393b37' | ||
21 | YELLOW = '#f1fa8c' | ||
22 | RED = '#ff5555' | ||
23 | LIGHT_RED = '#ff9999' | ||
24 | GREEN = '#50fa7b' | ||
25 | CYAN = '#8be9fd' | ||
26 | LIGHT_CYAN = '#abfbff' | ||
27 | |||
28 | @hook.subscribe.startup_once | ||
29 | def autostart(): | ||
30 | home = os.path.expanduser('~/.config/qtile/autorc') | ||
31 | subprocess.run([home]) | ||
32 | |||
33 | keys = [ | ||
34 | Key([MOD], "h", lazy.layout.left(), desc="Move focus to left"), | ||
35 | Key([MOD], "l", lazy.layout.right(), desc="Move focus to right"), | ||
36 | Key([MOD], "j", lazy.layout.down(), desc="Move focus down"), | ||
37 | Key([MOD], "k", lazy.layout.up(), desc="Move focus up"), | ||
38 | Key([MOD], "s", lazy.next_screen() ), | ||
39 | Key([MOD], "space", lazy.window.toggle_floating(), | ||
40 | desc="Move window focus to other window"), | ||
41 | |||
42 | Key([MOD, "shift"], "h", lazy.layout.shuffle_left(), | ||
43 | desc="Move window to the left"), | ||
44 | Key([MOD, "shift"], "l", lazy.layout.shuffle_right(), | ||
45 | desc="Move window to the right"), | ||
46 | Key([MOD, "shift"], "j", lazy.layout.shuffle_down(), | ||
47 | desc="Move window down"), | ||
48 | Key([MOD, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), | ||
49 | |||
50 | Key([MOD, "control"], "h", lazy.layout.grow_left(), | ||
51 | desc="Grow window to the left"), | ||
52 | Key([MOD, "control"], "l", lazy.layout.grow_right(), | ||
53 | desc="Grow window to the right"), | ||
54 | Key([MOD, "control"], "j", lazy.layout.grow_down(), | ||
55 | desc="Grow window down"), | ||
56 | Key([MOD, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), | ||
57 | Key([MOD], "n", lazy.layout.normalize(), desc="Reset all window sizes"), | ||
58 | |||
59 | Key([MOD, "shift"], "Return", lazy.layout.toggle_split(), | ||
60 | desc="Toggle between split and unsplit sides of stack"), | ||
61 | Key([MOD], "Return", lazy.spawn(TERMINAL), desc="Launch terminal"), | ||
62 | |||
63 | Key([MOD], "Tab", lazy.next_layout(), desc="Toggle between layouts"), | ||
64 | Key([MOD], "c", lazy.window.kill(), desc="Kill focused window"), | ||
65 | |||
66 | Key([MOD, "control"], "r", lazy.restart(), desc="Restart Qtile"), | ||
67 | Key([MOD, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), | ||
68 | |||
69 | Key([MOD], "F12", os.system("xbacklight -inc 10"), desc="Inc backlight"), | ||
70 | Key([MOD], "F11", os.system("xbacklight -dec 10"), desc="Dec backlight"), | ||
71 | |||
72 | Key([MOD], "r", lazy.spawncmd(), | ||
73 | desc="Spawn a command using a prompt widget"), | ||
74 | |||
75 | KeyChord([MOD], "p", [ | ||
76 | Key([], "p", lazy.spawn(f"dmenu_run {DMENU_FLAGS}"), desc="Spawn dmenu run"), | ||
77 | Key([], "n", lazy.spawn(f"networkmanager_dmenu {DMENU_FLAGS}"), desc="Spawn dmenu for network manager"), | ||
78 | ]), | ||
79 | |||
80 | Key([MOD, "mod1"], "q", lazy.spawn("qutebrowser"), desc="Spawn qutebrowser"), | ||
81 | Key([MOD, "mod1"], "b", lazy.spawn("brave"), desc="Spawn brave"), | ||
82 | Key([MOD, "mod1"], "f", lazy.spawn("firefox"), desc="Spawn firefox"), | ||
83 | |||
84 | KeyChord([MOD], "e", [ | ||
85 | Key([], "e", lazy.spawn("emacsclient -c -a 'emacs'"), desc="Spawn Emacsclient"), | ||
86 | Key([], "d", lazy.spawn("emacsclient -c -a 'emacs' --eval '(dired nil)'"), desc='Emacsclient Dired'), | ||
87 | Key([], "m", lazy.spawn("emacsclient -c -a 'emacs' --eval '(emms-browser)'"), desc='Emacsclient Dired'), | ||
88 | ]), | ||
89 | |||
90 | Key([MOD, "mod1"], "s", lazy.spawn("alacritty -e spt"), desc="Spawn spt (spotify clent)"), | ||
91 | Key([MOD, "mod1"], "l", lazy.spawn("slock"), desc="lock desktop"), | ||
92 | Key([MOD, "mod1"], "r", lazy.spawn("alacritty -e ranger"), desc="Spawn ranger (file manager)"), | ||
93 | Key([MOD, "mod1"], "p", lazy.spawn("alacritty -e pulsemixer"), desc="Spawn pulsemixer"), | ||
94 | ] | ||
95 | |||
96 | groups_names = [ | ||
97 | "dev", | ||
98 | "www", | ||
99 | "music", | ||
100 | "virt", | ||
101 | "sys", | ||
102 | "other" | ||
103 | ] | ||
104 | |||
105 | groups = [Group(i) for i in groups_names] | ||
106 | for i, group in enumerate(groups): | ||
107 | keys.extend([ | ||
108 | Key([MOD], str(i+1), lazy.group[group.name].toscreen(), | ||
109 | desc="Switch to group {}".format(group.name)), | ||
110 | |||
111 | Key([MOD, "shift"], str(i+1), lazy.window.togroup(group.name, switch_group=True), | ||
112 | desc="Switch to & move focused window to group {}".format(group.name)), | ||
113 | ]) | ||
114 | |||
115 | mouse = [ | ||
116 | Drag([MOD], "Button1", lazy.window.set_position_floating(), | ||
117 | start=lazy.window.get_position()), | ||
118 | Drag([MOD], "Button3", lazy.window.set_size_floating(), | ||
119 | start=lazy.window.get_size()), | ||
120 | Click([MOD], "Button2", lazy.window.bring_to_front()) | ||
121 | ] | ||
122 | |||
123 | layout_cfg = { | ||
124 | 'border_width': 2, | ||
125 | 'border_normal': "#bb8888", | ||
126 | 'border_focus': "884444", | ||
127 | 'margin': 8 | ||
128 | } | ||
129 | |||
130 | layouts = [ | ||
131 | # layout.Columns(**layout_cfg), | ||
132 | # layout.Max(), | ||
133 | layout.Stack(num_stacks=1, **layout_cfg), | ||
134 | # layout.Bsp(), | ||
135 | # layout.Matrix(), | ||
136 | layout.MonadTall(**layout_cfg), | ||
137 | # layout.MonadWide(), | ||
138 | # layout.RatioTile(), | ||
139 | # layout.Tile(), | ||
140 | # layout.TreeTab(), | ||
141 | # layout.VerticalTile(), | ||
142 | # layout.Zoomy(), | ||
143 | ] | ||
144 | |||
145 | widget_defaults = dict( | ||
146 | font='sans', | ||
147 | fontsize=12, | ||
148 | padding=6, | ||
149 | ) | ||
150 | |||
151 | transparent_sep = { | ||
152 | 'foreground': BAR, | ||
153 | 'margin': 2 | ||
154 | } | ||
155 | |||
156 | soft_sep = { | ||
157 | 'foreground': '44475a', | ||
158 | 'padding': 2, | ||
159 | 'margin': 4 | ||
160 | } | ||
161 | |||
162 | screens = [ | ||
163 | Screen( | ||
164 | top=bar.Bar( | ||
165 | [ | ||
166 | widget.Sep(**transparent_sep), | ||
167 | widget.Image(filename="~/.config/qtile/python.png", margin=4), | ||
168 | widget.Sep(**transparent_sep), | ||
169 | widget.CurrentLayout(), | ||
170 | widget.Sep(**transparent_sep), | ||
171 | widget.GroupBox( | ||
172 | margin_y = 3, | ||
173 | margin_x = 0, | ||
174 | padding_y = 5, | ||
175 | padding_x = 3, | ||
176 | borderwidth = 3, | ||
177 | rounded = False, | ||
178 | highlight_color = LIGHT_BAR, | ||
179 | highlight_method = "line", | ||
180 | this_current_screen_border = CYAN, | ||
181 | this_screen_border = CYAN, | ||
182 | other_current_screen_border = LIGHT_BAR, | ||
183 | other_screen_border = LIGHT_BAR, | ||
184 | ), | ||
185 | widget.Prompt(), | ||
186 | widget.Sep(**transparent_sep), | ||
187 | widget.WindowName(), | ||
188 | widget.Net(format="🌐 ↓{down} ↑{up}", foreground=YELLOW), | ||
189 | widget.Sep(**soft_sep), | ||
190 | widget.CPU(format='💻 {load_percent}%', fontsize=12, foreground=RED), | ||
191 | widget.Sep(**soft_sep), | ||
192 | widget.Battery(format='🔋 {char} {percent:2.0%} {hour:d}:{min:02d} {watt:.2f} W', foreground=GREEN), | ||
193 | widget.Sep(**soft_sep), | ||
194 | widget.Clock(format='📅 %B %-d, %H:%M', foreground=CYAN), | ||
195 | widget.Sep(**soft_sep), | ||
196 | widget.CurrentScreen(), | ||
197 | widget.Sep(**soft_sep), | ||
198 | widget.Systray() | ||
199 | ], | ||
200 | 24, | ||
201 | margin=8, | ||
202 | background=BAR, | ||
203 | border_color=CYAN, | ||
204 | border_width=1 | ||
205 | ), | ||
206 | ), | ||
207 | ] | ||
208 | |||
209 | floating_layout = layout.Floating(float_rules=[ | ||
210 | # Run the utility of `xprop` to see the wm class and name of an X client. | ||
211 | *layout.Floating.default_float_rules, | ||
212 | Match(wm_class='confirmreset'), # gitk | ||
213 | Match(wm_class='makebranch'), # gitk | ||
214 | Match(wm_class='maketag'), # gitk | ||
215 | Match(wm_class='ssh-askpass'), # ssh-askpass | ||
216 | Match(title='branchdialog'), # gitk | ||
217 | Match(title='pinentry'), # GPG key password entry | ||
218 | ]) | ||
219 | |||
220 | dgroups_key_binder = None | ||
221 | dgroups_app_rules = [] | ||
222 | |||
223 | follow_mouse_focus = True | ||
224 | bring_front_click = False | ||
225 | cursor_warp = False | ||
226 | auto_fullscreen = True | ||
227 | focus_on_window_activation = "smart" | ||
228 | reconfigure_screens = True | ||
229 | |||
230 | auto_minimize = True | ||
231 | |||
232 | wmname = "LG3D" | ||
diff --git a/files/.config/qtile/mdt_shell b/files/.config/qtile/mdt_shell new file mode 100755 index 0000000..90fa6f3 --- /dev/null +++ b/files/.config/qtile/mdt_shell | |||
@@ -0,0 +1 @@ | |||
TERM=xterm-256color /home/jakub/.local/bin/mdt shell | |||
diff --git a/files/.config/qtile/photos/desktop.png b/files/.config/qtile/photos/desktop.png new file mode 100644 index 0000000..8fca190 --- /dev/null +++ b/files/.config/qtile/photos/desktop.png | |||
Binary files differ | |||
diff --git a/files/.config/qtile/python.png b/files/.config/qtile/python.png new file mode 100644 index 0000000..9a4b1ed --- /dev/null +++ b/files/.config/qtile/python.png | |||
Binary files differ | |||
diff --git a/files/.config/qtile/readme.org b/files/.config/qtile/readme.org new file mode 100644 index 0000000..235dd47 --- /dev/null +++ b/files/.config/qtile/readme.org | |||
@@ -0,0 +1,5 @@ | |||
1 | #+title: Config | ||
2 | |||
3 | * Qtile conifg | ||
4 | - My personal qtile config ;) | ||
5 | [[./photos/desktop.png]] | ||