├── .luarc.json
├── Icons-AwesomeWM-Layouts-pastel
├── archlinux-logo-round.png
├── archlinux.png
├── floating.png
├── max.png
└── tileleft.png
├── README.md
├── autorun.sh
├── my_taglist.lua
├── my_tasklist.lua
├── rc.lua
└── theme.lua
/.luarc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3 | "Lua.diagnostics.disable": [
4 | "undefined-global"
5 | ]
6 | }
--------------------------------------------------------------------------------
/Icons-AwesomeWM-Layouts-pastel/archlinux-logo-round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Strazil001/Dotfiles-AwesomeWM/e5721cdb0cb4dad56ff426c322f5ad1e9dd9ff38/Icons-AwesomeWM-Layouts-pastel/archlinux-logo-round.png
--------------------------------------------------------------------------------
/Icons-AwesomeWM-Layouts-pastel/archlinux.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Strazil001/Dotfiles-AwesomeWM/e5721cdb0cb4dad56ff426c322f5ad1e9dd9ff38/Icons-AwesomeWM-Layouts-pastel/archlinux.png
--------------------------------------------------------------------------------
/Icons-AwesomeWM-Layouts-pastel/floating.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Strazil001/Dotfiles-AwesomeWM/e5721cdb0cb4dad56ff426c322f5ad1e9dd9ff38/Icons-AwesomeWM-Layouts-pastel/floating.png
--------------------------------------------------------------------------------
/Icons-AwesomeWM-Layouts-pastel/max.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Strazil001/Dotfiles-AwesomeWM/e5721cdb0cb4dad56ff426c322f5ad1e9dd9ff38/Icons-AwesomeWM-Layouts-pastel/max.png
--------------------------------------------------------------------------------
/Icons-AwesomeWM-Layouts-pastel/tileleft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Strazil001/Dotfiles-AwesomeWM/e5721cdb0cb4dad56ff426c322f5ad1e9dd9ff38/Icons-AwesomeWM-Layouts-pastel/tileleft.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dotfiles-AwesomeWM
2 |
3 | ## Notice
4 | -------------------------------------------------------------------------------
5 | The use of the progress bars for volume and brightness is done by external scripts in bash.
6 | You can find them in my repo under Scripts-AwesomeWM
7 |
8 | ### Do mind that some things have to be tweaked for your system,
9 |
10 | For ex:
11 | I have an AMD Cpu, internal AMD Gpu and an NVIDIA RTX Gpu,
12 | I control my brightness with /sys/class/backlight/amdgpu_bl1 or amdgpu_bl0.
13 | Yours might be different, same goes for storage etc but you get the point.
14 |
15 | ### Enjoy
16 |
--------------------------------------------------------------------------------
/autorun.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | run() {
4 | if ! pgrep -f "$1" ;
5 | then
6 | "$@"&
7 | fi
8 | }
9 |
10 | #run /usr/bin/emacs --daemon
11 |
--------------------------------------------------------------------------------
/my_taglist.lua:
--------------------------------------------------------------------------------
1 | local awful = require("awful")
2 | local gears = require("gears")
3 | local gfs = gears.filesystem
4 | local wibox = require("wibox")
5 | local beautiful = require("beautiful")
6 | local xresources = require("beautiful.xresources")
7 | local dpi = xresources.apply_dpi
8 | ------------------------------------
9 |
10 | local get_taglist = function(s)
11 | -- Taglist buttons
12 | local taglist_buttons = gears.table.join(
13 | awful.button({}, 1,
14 | function(t) t:view_only() end),
15 | awful.button({ modkey }, 1, function(t)
16 | if client.focus then client.focus:move_to_tag(t) end
17 | end), awful.button({}, 3, awful.tag.viewtoggle),
18 | awful.button({ modkey }, 3, function(t)
19 | if client.focus then client.focus:toggle_tag(t) end
20 | end), awful.button({}, 4, function(t)
21 | awful.tag.viewnext(t.screen)
22 | end), awful.button({}, 5, function(t)
23 | awful.tag.viewprev(t.screen)
24 | end))
25 |
26 | ----------------------------------------------------------------------
27 |
28 | local unfocus_icon = " "
29 | local unfocus_color = "#585b70"
30 |
31 | local empty_icon = " "
32 | local empty_color = "#585b70"
33 |
34 | local focus_icon = " "
35 | local focus_color = "#b4befe"
36 |
37 | ----------------------------------------------------------------------
38 |
39 | -- Function to update the tags
40 | local update_tags = function(self, c3)
41 | local tagicon = self:get_children_by_id('icon_role')[1]
42 | if c3.selected then
43 | tagicon.text = focus_icon
44 | self.fg = focus_color
45 | elseif #c3:clients() == 0 then
46 | tagicon.text = empty_icon
47 | self.fg = empty_color
48 | else
49 | tagicon.text = unfocus_icon
50 | self.fg = unfocus_color
51 | end
52 | end
53 |
54 | ----------------------------------------------------------------------
55 |
56 | local icon_taglist = awful.widget.taglist {
57 | screen = s,
58 | filter = awful.widget.taglist.filter.all,
59 | layout = { spacing = 0, layout = wibox.layout.fixed.horizontal },
60 | widget_template = {
61 | {
62 | { id = 'icon_role', font = "JetBrainsMono Nerd Font 12", widget = wibox.widget.textbox },
63 | id = 'margin_role',
64 | top = dpi(0),
65 | bottom = dpi(0),
66 | left = dpi(2),
67 | right = dpi(2),
68 | widget = wibox.container.margin
69 | },
70 | id = 'background_role',
71 | widget = wibox.container.background,
72 | create_callback = function(self, c3, index, objects)
73 | update_tags(self, c3)
74 | end,
75 |
76 | update_callback = function(self, c3, index, objects)
77 | update_tags(self, c3)
78 | end
79 | },
80 | buttons = taglist_buttons
81 | }
82 | return icon_taglist
83 | end
84 |
85 | return get_taglist
86 |
--------------------------------------------------------------------------------
/my_tasklist.lua:
--------------------------------------------------------------------------------
1 | ---------------------------------------------------------------------------
2 | --- Tasklist widget module for awful.
3 | --
4 | --
5 | -- **Status icons:**
6 | --
7 | -- By default, the tasklist prepends some symbols in front of the client name.
8 | -- This is used to notify that the client has some specific properties that are
9 | -- currently enabled. This can be disabled using
10 | -- `beautiful.tasklist_plain_task_name`=true in the theme.
11 | --
12 | --
26 | --
27 | -- **Customizing the tasklist:**
28 | --
29 | -- The `tasklist` created by `rc.lua` use the default values for almost
30 | -- everything. However, it is possible to override each aspects to create a
31 | -- very different widget. Here's an example that create a tasklist similar to
32 | -- the default one, but with an explicit layout and some spacing widgets:
33 | --
34 | --
35 | --
36 | --
37 | --
38 | --
39 | -- s.mytasklist = awful.widget.tasklist {
40 | -- screen = s,
41 | -- filter = awful.widget.tasklist.filter.currenttags,
42 | -- buttons = tasklist_buttons,
43 | -- style = {
44 | -- shape_border_width = 1,
45 | -- shape_border_color = '#777777',
46 | -- shape = gears.shape.rounded_bar,
47 | -- },
48 | -- layout = {
49 | -- spacing = 10,
50 | -- spacing_widget = {
51 | -- {
52 | -- forced_width = 5,
53 | -- shape = gears.shape.circle,
54 | -- widget = wibox.widget.separator
55 | -- },
56 | -- valign = 'center',
57 | -- halign = 'center',
58 | -- widget = wibox.container.place,
59 | -- },
60 | -- layout = wibox.layout.flex.horizontal
61 | -- },
62 | -- -- Notice that there is *NO* `wibox.wibox` prefix, it is a template,
63 | -- -- not a widget instance.
64 | -- widget_template = {
65 | -- {
66 | -- {
67 | -- {
68 | -- {
69 | -- id = 'icon_role',
70 | -- widget = wibox.widget.imagebox,
71 | -- },
72 | -- margins = 2,
73 | -- widget = wibox.container.margin,
74 | -- },
75 | -- {
76 | -- id = 'text_role',
77 | -- widget = wibox.widget.textbox,
78 | -- },
79 | -- layout = wibox.layout.fixed.horizontal,
80 | -- },
81 | -- left = 10,
82 | -- right = 10,
83 | -- widget = wibox.container.margin
84 | -- },
85 | -- id = 'background_role',
86 | -- widget = wibox.container.background,
87 | -- },
88 | -- }
89 | --
90 | -- As demonstrated in the example above, there are a few "shortcuts" to avoid
91 | -- re-inventing the wheel. By setting the predefined roles as widget `id`s,
92 | -- `awful.widget.common` will do most of the work to update the values
93 | -- automatically. All of them are optional. The supported roles are:
94 | --
95 | -- * `icon_role`: A `wibox.widget.imagebox`
96 | -- * `text_role`: A `wibox.widget.textbox`
97 | -- * `background_role`: A `wibox.container.background`
98 | -- * `text_margin_role`: A `wibox.container.margin`
99 | -- * `icon_margin_role`: A `wibox.container.margin`
100 | --
101 | -- `awful.widget.common` also has 2 callbacks to give more control over the widget:
102 | --
103 | -- * `create_callback`: Called once after the widget instance is created
104 | -- * `update_callback`: Called everytime the data is refreshed
105 | --
106 | -- Both callback have the same parameters:
107 | --
108 | -- * `self`: The widget instance (*widget*).
109 | -- * `c`: The client (*client*)
110 | -- * `index`: The widget position in the list (*number*)
111 | -- * `clients`: The list of client, in order (*table*)
112 | --
113 | -- It is also possible to omit some roles and create an icon only tasklist.
114 | -- Notice that this example use the `awful.widget.clienticon` widget instead
115 | -- of an `imagebox`. This allows higher resoluton icons to be loaded. This
116 | -- example reproduces the Windows 10 tasklist look and feel:
117 | --
118 | --
119 | --
120 | --
121 | --
122 | --
123 | -- s.mytasklist = awful.widget.tasklist {
124 | -- screen = s,
125 | -- filter = awful.widget.tasklist.filter.currenttags,
126 | -- buttons = tasklist_buttons,
127 | -- layout = {
128 | -- spacing_widget = {
129 | -- {
130 | -- forced_width = 5,
131 | -- forced_height = 24,
132 | -- thickness = 1,
133 | -- color = '#777777',
134 | -- widget = wibox.widget.separator
135 | -- },
136 | -- valign = 'center',
137 | -- halign = 'center',
138 | -- widget = wibox.container.place,
139 | -- },
140 | -- spacing = 1,
141 | -- layout = wibox.layout.fixed.horizontal
142 | -- },
143 | -- -- Notice that there is *NO* `wibox.wibox` prefix, it is a template,
144 | -- -- not a widget instance.
145 | -- widget_template = {
146 | -- {
147 | -- wibox.widget.base.make_widget(),
148 | -- forced_height = 5,
149 | -- id = 'background_role',
150 | -- widget = wibox.container.background,
151 | -- },
152 | -- {
153 | -- {
154 | -- id = 'clienticon',
155 | -- widget = awful.widget.clienticon,
156 | -- },
157 | -- margins = 5,
158 | -- widget = wibox.container.margin
159 | -- },
160 | -- nil,
161 | -- create_callback = function(self, c, index, objects) --luacheck: no unused args
162 | -- self:get_children_by_id('clienticon')[1].client = c
163 | -- end,
164 | -- layout = wibox.layout.align.vertical,
165 | -- },
166 | -- }
167 | --
168 | -- The tasklist can also be created in an `awful.popup` in case there is no
169 | -- permanent `awful.wibar`:
170 | --
171 | --
172 | --
173 | --
174 | --
175 | --
176 | -- awful.popup {
177 | -- widget = awful.widget.tasklist {
178 | -- screen = screen[1],
179 | -- filter = awful.widget.tasklist.filter.allscreen,
180 | -- buttons = tasklist_buttons,
181 | -- style = {
182 | -- shape = gears.shape.rounded_rect,
183 | -- },
184 | -- layout = {
185 | -- spacing = 5,
186 | -- forced_num_rows = 2,
187 | -- layout = wibox.layout.grid.horizontal
188 | -- },
189 | -- widget_template = {
190 | -- {
191 | -- {
192 | -- id = 'clienticon',
193 | -- widget = awful.widget.clienticon,
194 | -- },
195 | -- margins = 4,
196 | -- widget = wibox.container.margin,
197 | -- },
198 | -- id = 'background_role',
199 | -- forced_width = 48,
200 | -- forced_height = 48,
201 | -- widget = wibox.container.background,
202 | -- create_callback = function(self, c, index, objects) --luacheck: no unused
203 | -- self:get_children_by_id('clienticon')[1].client = c
204 | -- end,
205 | -- },
206 | -- },
207 | -- border_color = '#777777',
208 | -- border_width = 2,
209 | -- ontop = true,
210 | -- placement = awful.placement.centered,
211 | -- shape = gears.shape.rounded_rect
212 | -- }
213 | --
214 | -- @author Julien Danjou <julien@danjou.info>
215 | -- @copyright 2008-2009 Julien Danjou
216 | -- @classmod awful.widget.tasklist
217 | ---------------------------------------------------------------------------
218 |
219 | -- Grab environment we need
220 | local capi = { screen = screen,
221 | client = client }
222 | local ipairs = ipairs
223 | local setmetatable = setmetatable
224 | local table = table
225 | local common = require("awful.widget.common")
226 | local beautiful = require("beautiful")
227 | local tag = require("awful.tag")
228 | local flex = require("wibox.layout.flex")
229 | local timer = require("gears.timer")
230 | local gcolor = require("gears.color")
231 | local gstring = require("gears.string")
232 | local gdebug = require("gears.debug")
233 | local base = require("wibox.widget.base")
234 |
235 | local function get_screen(s)
236 | return s and screen[s]
237 | end
238 |
239 | local tasklist = { mt = {} }
240 |
241 | local instances
242 |
243 | --- The default foreground (text) color.
244 | -- @beautiful beautiful.tasklist_fg_normal
245 | -- @tparam[opt=nil] string|pattern fg_normal
246 | -- @see gears.color
247 |
248 | --- The default background color.
249 | -- @beautiful beautiful.tasklist_bg_normal
250 | -- @tparam[opt=nil] string|pattern bg_normal
251 | -- @see gears.color
252 |
253 | --- The focused client foreground (text) color.
254 | -- @beautiful beautiful.tasklist_fg_focus
255 | -- @tparam[opt=nil] string|pattern fg_focus
256 | -- @see gears.color
257 |
258 | --- The focused client background color.
259 | -- @beautiful beautiful.tasklist_bg_focus
260 | -- @tparam[opt=nil] string|pattern bg_focus
261 | -- @see gears.color
262 |
263 | --- The urgent clients foreground (text) color.
264 | -- @beautiful beautiful.tasklist_fg_urgent
265 | -- @tparam[opt=nil] string|pattern fg_urgent
266 | -- @see gears.color
267 |
268 | --- The urgent clients background color.
269 | -- @beautiful beautiful.tasklist_bg_urgent
270 | -- @tparam[opt=nil] string|pattern bg_urgent
271 | -- @see gears.color
272 |
273 | --- The minimized clients foreground (text) color.
274 | -- @beautiful beautiful.tasklist_fg_minimize
275 | -- @tparam[opt=nil] string|pattern fg_minimize
276 | -- @see gears.color
277 |
278 | --- The minimized clients background color.
279 | -- @beautiful beautiful.tasklist_bg_minimize
280 | -- @tparam[opt=nil] string|pattern bg_minimize
281 | -- @see gears.color
282 |
283 | --- The elements default background image.
284 | -- @beautiful beautiful.tasklist_bg_image_normal
285 | -- @tparam[opt=nil] string bg_image_normal
286 |
287 | --- The focused client background image.
288 | -- @beautiful beautiful.tasklist_bg_image_focus
289 | -- @tparam[opt=nil] string bg_image_focus
290 |
291 | --- The urgent clients background image.
292 | -- @beautiful beautiful.tasklist_bg_image_urgent
293 | -- @tparam[opt=nil] string bg_image_urgent
294 |
295 | --- The minimized clients background image.
296 | -- @beautiful beautiful.tasklist_bg_image_minimize
297 | -- @tparam[opt=nil] string bg_image_minimize
298 |
299 | --- Disable the tasklist client icons.
300 | -- @beautiful beautiful.tasklist_disable_icon
301 | -- @tparam[opt=false] boolean tasklist_disable_icon
302 |
303 | --- Disable the tasklist client titles.
304 | -- @beautiful beautiful.tasklist_disable_task_name
305 | -- @tparam[opt=false] boolean tasklist_disable_task_name
306 |
307 | --- Disable the extra tasklist client property notification icons.
308 | --
309 | -- See the Status icons section for more details.
310 | --
311 | -- @beautiful beautiful.tasklist_plain_task_name
312 | -- @tparam[opt=false] boolean tasklist_plain_task_name
313 |
314 | --- The tasklist font.
315 | -- @beautiful beautiful.tasklist_font
316 | -- @tparam[opt=nil] string font
317 |
318 | --- The focused client alignment.
319 | -- @beautiful beautiful.tasklist_align
320 | -- @tparam[opt=left] string align *left*, *right* or *center*
321 |
322 | --- The focused client title alignment.
323 | -- @beautiful beautiful.tasklist_font_focus
324 | -- @tparam[opt=nil] string font_focus
325 |
326 | --- The minimized clients font.
327 | -- @beautiful beautiful.tasklist_font_minimized
328 | -- @tparam[opt=nil] string font_minimized
329 |
330 | --- The urgent clients font.
331 | -- @beautiful beautiful.tasklist_font_urgent
332 | -- @tparam[opt=nil] string font_urgent
333 |
334 | --- The space between the tasklist elements.
335 | -- @beautiful beautiful.tasklist_spacing
336 | -- @tparam[opt=0] number spacing The spacing between tasks.
337 |
338 | --- The default tasklist elements shape.
339 | -- @beautiful beautiful.tasklist_shape
340 | -- @tparam[opt=nil] gears.shape shape
341 |
342 | --- The default tasklist elements border width.
343 | -- @beautiful beautiful.tasklist_shape_border_width
344 | -- @tparam[opt=0] number shape_border_width
345 |
346 | --- The default tasklist elements border color.
347 | -- @beautiful beautiful.tasklist_shape_border_color
348 | -- @tparam[opt=nil] string|color shape_border_color
349 | -- @see gears.color
350 |
351 | --- The focused client shape.
352 | -- @beautiful beautiful.tasklist_shape_focus
353 | -- @tparam[opt=nil] gears.shape shape_focus
354 |
355 | --- The focused client border width.
356 | -- @beautiful beautiful.tasklist_shape_border_width_focus
357 | -- @tparam[opt=0] number shape_border_width_focus
358 |
359 | --- The focused client border color.
360 | -- @beautiful beautiful.tasklist_shape_border_color_focus
361 | -- @tparam[opt=nil] string|color shape_border_color_focus
362 | -- @see gears.color
363 |
364 | --- The minimized clients shape.
365 | -- @beautiful beautiful.tasklist_shape_minimized
366 | -- @tparam[opt=nil] gears.shape shape_minimized
367 |
368 | --- The minimized clients border width.
369 | -- @beautiful beautiful.tasklist_shape_border_width_minimized
370 | -- @tparam[opt=0] number shape_border_width_minimized
371 |
372 | --- The minimized clients border color.
373 | -- @beautiful beautiful.tasklist_shape_border_color_minimized
374 | -- @tparam[opt=nil] string|color shape_border_color_minimized
375 | -- @see gears.color
376 |
377 | --- The urgent clients shape.
378 | -- @beautiful beautiful.tasklist_shape_urgent
379 | -- @tparam[opt=nil] gears.shape shape_urgent
380 |
381 | --- The urgent clients border width.
382 | -- @beautiful beautiful.tasklist_shape_border_width_urgent
383 | -- @tparam[opt=0] number shape_border_width_urgent
384 |
385 | --- The urgent clients border color.
386 | -- @beautiful beautiful.tasklist_shape_border_color_urgent
387 | -- @tparam[opt=nil] string|color shape_border_color_urgent
388 | -- @see gears.color
389 |
390 | -- Public structures
391 | tasklist.filter, tasklist.source = {}, {}
392 |
393 | local function tasklist_label(c, args, tb)
394 | if not args then args = {} end
395 | local theme = beautiful.get()
396 | local align = args.align or theme.tasklist_align or "left"
397 | local fg_normal = gcolor.ensure_pango_color(args.fg_normal or theme.tasklist_fg_normal or theme.fg_normal, "white")
398 | local bg_normal = args.bg_normal or theme.tasklist_bg_normal or theme.bg_normal or "#000000"
399 | local fg_focus = gcolor.ensure_pango_color(args.fg_focus or theme.tasklist_fg_focus or theme.fg_focus, fg_normal)
400 | local bg_focus = args.bg_focus or theme.tasklist_bg_focus or theme.bg_focus or bg_normal
401 | local fg_urgent = gcolor.ensure_pango_color(args.fg_urgent or theme.tasklist_fg_urgent or theme.fg_urgent,
402 | fg_normal)
403 | local bg_urgent = args.bg_urgent or theme.tasklist_bg_urgent or theme.bg_urgent or bg_normal
404 | local fg_minimize = gcolor.ensure_pango_color(args.fg_minimize or theme.tasklist_fg_minimize or theme.fg_minimize,
405 | fg_normal)
406 | local bg_minimize = args.bg_minimize or theme.tasklist_bg_minimize or theme.bg_minimize or bg_normal
407 | -- FIXME v5, remove the fallback theme.bg_image_* variables, see GH#1403
408 | local bg_image_normal = args.bg_image_normal or theme.tasklist_bg_image_normal or theme.bg_image_normal
409 | local bg_image_focus = args.bg_image_focus or theme.tasklist_bg_image_focus or theme.bg_image_focus
410 | local bg_image_urgent = args.bg_image_urgent or theme.tasklist_bg_image_urgent or theme.bg_image_urgent
411 | local bg_image_minimize = args.bg_image_minimize or theme.tasklist_bg_image_minimize or theme.bg_image_minimize
412 | local tasklist_disable_icon = args.tasklist_disable_icon or theme.tasklist_disable_icon or false
413 | local disable_task_name = args.disable_task_name or theme.tasklist_disable_task_name or false
414 | local font = args.font or theme.tasklist_font or theme.font or ""
415 | local font_focus = args.font_focus or theme.tasklist_font_focus or theme.font_focus or font or ""
416 | local font_minimized = args.font_minimized or theme.tasklist_font_minimized or theme.font_minimized or font or ""
417 | local font_urgent = args.font_urgent or theme.tasklist_font_urgent or theme.font_urgent or font or ""
418 | local text = ""
419 | local name = ""
420 | local bg
421 | local bg_image
422 | local shape = args.shape or theme.tasklist_shape
423 | local shape_border_width = args.shape_border_width or theme.tasklist_shape_border_width
424 | local shape_border_color = args.shape_border_color or theme.tasklist_shape_border_color
425 |
426 | -- symbol to use to indicate certain client properties
427 | local sticky = args.sticky or theme.tasklist_sticky or "▪"
428 | local ontop = args.ontop or theme.tasklist_ontop or '⌃'
429 | local above = args.above or theme.tasklist_above or '▴'
430 | local below = args.below or theme.tasklist_below or '▾'
431 | local floating = args.floating or theme.tasklist_floating or '✈'
432 | local maximized = args.maximized or theme.tasklist_maximized or '+'
433 | local maximized_horizontal = args.maximized_horizontal or theme.tasklist_maximized_horizontal or '⬌'
434 | local maximized_vertical = args.maximized_vertical or theme.tasklist_maximized_vertical or '⬍'
435 |
436 | if tb then
437 | tb:set_align(align)
438 | end
439 |
440 | if not theme.tasklist_plain_task_name then
441 | if c.sticky then name = name .. sticky end
442 |
443 | if c.ontop then name = name .. ontop
444 | elseif c.above then name = name .. above
445 | elseif c.below then name = name .. below end
446 |
447 | if c.maximized then
448 | name = name .. maximized
449 | else
450 | if c.maximized_horizontal then name = name .. maximized_horizontal end
451 | if c.maximized_vertical then name = name .. maximized_vertical end
452 | if c.floating then name = name .. floating end
453 | end
454 | end
455 |
456 | if not disable_task_name then
457 | if c.minimized then
458 | name = name .. (gstring.xml_escape(c.icon_name) or gstring.xml_escape(c.class) or
459 | gstring.xml_escape(""))
460 | else
461 | name = name .. (gstring.xml_escape(c.class) or gstring.xml_escape(""))
462 | end
463 | end
464 |
465 | local focused = capi.client.focus == c
466 | -- Handle transient_for: the first parent that does not skip the taskbar
467 | -- is considered to be focused, if the real client has skip_taskbar.
468 | if not focused and capi.client.focus and capi.client.focus.skip_taskbar
469 | and capi.client.focus:get_transient_for_matching(function(cl)
470 | return not cl.skip_taskbar
471 | end) == c then
472 | focused = true
473 | end
474 |
475 | if focused then
476 | bg = bg_focus
477 | text = text .. ""..name..""
478 | bg_image = bg_image_focus
479 | font = font_focus
480 |
481 | if args.shape_focus or theme.tasklist_shape_focus then
482 | shape = args.shape_focus or theme.tasklist_shape_focus
483 | end
484 |
485 | if args.shape_border_width_focus or theme.tasklist_shape_border_width_focus then
486 | shape_border_width = args.shape_border_width_focus or theme.tasklist_shape_border_width_focus
487 | end
488 |
489 | if args.shape_border_color_focus or theme.tasklist_shape_border_color_focus then
490 | shape_border_color = args.shape_border_color_focus or theme.tasklist_shape_border_color_focus
491 | end
492 | elseif c.urgent then
493 | bg = bg_urgent
494 | text = text .. ""..name..""
495 | bg_image = bg_image_urgent
496 | font = font_urgent
497 |
498 | if args.shape_urgent or theme.tasklist_shape_urgent then
499 | shape = args.shape_urgent or theme.tasklist_shape_urgent
500 | end
501 |
502 | if args.shape_border_width_urgent or theme.tasklist_shape_border_width_urgent then
503 | shape_border_width = args.shape_border_width_urgent or theme.tasklist_shape_border_width_urgent
504 | end
505 |
506 | if args.shape_border_color_urgent or theme.tasklist_shape_border_color_urgent then
507 | shape_border_color = args.shape_border_color_urgent or theme.tasklist_shape_border_color_urgent
508 | end
509 | elseif c.minimized then
510 | bg = bg_minimize
511 | text = text .. ""..name..""
512 | bg_image = bg_image_minimize
513 | font = font_minimized
514 |
515 | if args.shape_minimized or theme.tasklist_shape_minimized then
516 | shape = args.shape_minimized or theme.tasklist_shape_minimized
517 | end
518 |
519 | if args.shape_border_width_minimized or theme.tasklist_shape_border_width_minimized then
520 | shape_border_width = args.shape_border_width_minimized or theme.tasklist_shape_border_width_minimized
521 | end
522 |
523 | if args.shape_border_color_minimized or theme.tasklist_shape_border_color_minimized then
524 | shape_border_color = args.shape_border_color_minimized or theme.tasklist_shape_border_color_minimized
525 | end
526 | else
527 | bg = bg_normal
528 | text = text .. ""..name..""
529 | bg_image = bg_image_normal
530 | end
531 |
532 | if tb then
533 | tb:set_font(font)
534 | end
535 |
536 | local other_args = {
537 | shape = shape,
538 | shape_border_width = shape_border_width,
539 | shape_border_color = shape_border_color,
540 | }
541 |
542 | return text, bg, bg_image, not tasklist_disable_icon and c.icon or nil, other_args
543 | end
544 |
545 | local function tasklist_update(s, w, buttons, filter, data, style, update_function, args)
546 | local clients = {}
547 |
548 | local source = args and args.source or tasklist.source.all_clients or nil
549 | local list = source and source(s, args) or capi.client.get()
550 |
551 | for _, c in ipairs(list) do
552 | if not (c.skip_taskbar or c.hidden
553 | or c.type == "splash" or c.type == "dock" or c.type == "desktop")
554 | and filter(c, s) then
555 | table.insert(clients, c)
556 | end
557 | end
558 |
559 | local function label(c, tb) return tasklist_label(c, style, tb) end
560 |
561 | update_function(w, buttons, label, data, clients, args)
562 | end
563 |
564 | --- Create a new tasklist widget.
565 | -- The last two arguments (update_function
566 | -- and layout) serve to customize the layout of the tasklist (eg. to
567 | -- make it vertical). For that, you will need to copy the
568 | -- awful.widget.common.list_update function, make your changes to it
569 | -- and pass it as update_function here. Also change the layout if the
570 | -- default is not what you want.
571 | --
572 | -- @tparam table args
573 | -- @tparam screen args.screen The screen to draw tasklist for.
574 | -- @tparam function args.filter Filter function to define what clients will be listed.
575 | -- @tparam table args.buttons A table with buttons binding to set.
576 | -- @tparam[opt] function args.update_function Function to create a tag widget on each
577 | -- update. See `awful.widget.common.list_update`.
578 | -- @tparam[opt] table args.layout Container widget for tag widgets. Default
579 | -- is `wibox.layout.flex.horizontal`.
580 | -- @tparam[opt=awful.tasklist.source.all_clients] function args.source The
581 | -- function used to generate the list of client.
582 | -- @tparam[opt] table args.widget_template A custom widget to be used for each client
583 | -- @tparam[opt={}] table args.style The style overrides default theme.
584 | -- @tparam[opt=nil] string|pattern args.style.fg_normal
585 | -- @tparam[opt=nil] string|pattern args.style.bg_normal
586 | -- @tparam[opt=nil] string|pattern args.style.fg_focus
587 | -- @tparam[opt=nil] string|pattern args.style.bg_focus
588 | -- @tparam[opt=nil] string|pattern args.style.fg_urgent
589 | -- @tparam[opt=nil] string|pattern args.style.bg_urgent
590 | -- @tparam[opt=nil] string|pattern args.style.fg_minimize
591 | -- @tparam[opt=nil] string|pattern args.style.bg_minimize
592 | -- @tparam[opt=nil] string args.style.bg_image_normal
593 | -- @tparam[opt=nil] string args.style.bg_image_focus
594 | -- @tparam[opt=nil] string args.style.bg_image_urgent
595 | -- @tparam[opt=nil] string args.style.bg_image_minimize
596 | -- @tparam[opt=nil] boolean args.style.tasklist_disable_icon
597 | -- @tparam[opt=false] boolean args.style.disable_task_name
598 | -- @tparam[opt=nil] string args.style.font
599 | -- @tparam[opt=left] string args.style.align *left*, *right* or *center*
600 | -- @tparam[opt=nil] string args.style.font_focus
601 | -- @tparam[opt=nil] string args.style.font_minimized
602 | -- @tparam[opt=nil] string args.style.font_urgent
603 | -- @tparam[opt=nil] number args.style.spacing The spacing between tags.
604 | -- @tparam[opt=nil] gears.shape args.style.shape
605 | -- @tparam[opt=nil] number args.style.shape_border_width
606 | -- @tparam[opt=nil] string|color args.style.shape_border_color
607 | -- @tparam[opt=nil] gears.shape args.style.shape_focus
608 | -- @tparam[opt=nil] number args.style.shape_border_width_focus
609 | -- @tparam[opt=nil] string|color args.style.shape_border_color_focus
610 | -- @tparam[opt=nil] gears.shape args.style.shape_minimized
611 | -- @tparam[opt=nil] number args.style.shape_border_width_minimized
612 | -- @tparam[opt=nil] string|color args.style.shape_border_color_minimized
613 | -- @tparam[opt=nil] gears.shape args.style.shape_urgent
614 | -- @tparam[opt=nil] number args.style.shape_border_width_urgent
615 | -- @tparam[opt=nil] string|color args.style.shape_border_color_urgent
616 | -- @param filter **DEPRECATED** use args.filter
617 | -- @param buttons **DEPRECATED** use args.buttons
618 | -- @param style **DEPRECATED** use args.style
619 | -- @param update_function **DEPRECATED** use args.update_function
620 | -- @param base_widget **DEPRECATED** use args.base_widget
621 | -- @function awful.tasklist
622 | function tasklist.new(args, filter, buttons, style, update_function, base_widget)
623 | local screen = nil
624 |
625 | local argstype = type(args)
626 |
627 | -- Detect the old function signature
628 | if argstype == "number" or argstype == "screen" or
629 | (argstype == "table" and args.index and args == capi.screen[args.index]) then
630 | gdebug.deprecate("The `screen` paramater is deprecated, use `args.screen`.",
631 | {deprecated_in=5})
632 |
633 | screen = get_screen(args)
634 | args = {}
635 | end
636 |
637 | assert(type(args) == "table")
638 |
639 | for k, v in pairs { filter = filter,
640 | buttons = buttons,
641 | style = style,
642 | update_function = update_function,
643 | layout = base_widget
644 | } do
645 | gdebug.deprecate("The `awful.widget.tasklist()` `"..k
646 | .."` paramater is deprecated, use `args."..k.."`.",
647 | {deprecated_in=5})
648 | args[k] = v
649 | end
650 |
651 | screen = screen or get_screen(args.screen)
652 | local uf = args.update_function or common.list_update
653 | local w = base.make_widget_from_value(args.layout or flex.horizontal)
654 |
655 | local data = setmetatable({}, { __mode = 'k' })
656 |
657 | local spacing = args.style and args.style.spacing or args.layout and args.layout.spacing
658 | or beautiful.tasklist_spacing
659 | if w.set_spacing and spacing then
660 | w:set_spacing(spacing)
661 | end
662 |
663 | local queued_update = false
664 |
665 | -- For the tests
666 | function w._do_tasklist_update_now()
667 | queued_update = false
668 | if screen.valid then
669 | tasklist_update(screen, w, args.buttons, args.filter, data, args.style, uf, args)
670 | end
671 | end
672 |
673 | function w._do_tasklist_update()
674 | -- Add a delayed callback for the first update.
675 | if not queued_update then
676 | timer.delayed_call(w._do_tasklist_update_now)
677 | queued_update = true
678 | end
679 | end
680 | function w._unmanage(c)
681 | data[c] = nil
682 | end
683 | if instances == nil then
684 | instances = setmetatable({}, { __mode = "k" })
685 | local function us(s)
686 | local i = instances[get_screen(s)]
687 | if i then
688 | for _, tlist in pairs(i) do
689 | tlist._do_tasklist_update()
690 | end
691 | end
692 | end
693 | local function u()
694 | for s in pairs(instances) do
695 | if s.valid then
696 | us(s)
697 | end
698 | end
699 | end
700 |
701 | tag.attached_connect_signal(nil, "property::selected", u)
702 | tag.attached_connect_signal(nil, "property::activated", u)
703 | capi.client.connect_signal("property::urgent", u)
704 | capi.client.connect_signal("property::sticky", u)
705 | capi.client.connect_signal("property::ontop", u)
706 | capi.client.connect_signal("property::above", u)
707 | capi.client.connect_signal("property::below", u)
708 | capi.client.connect_signal("property::floating", u)
709 | capi.client.connect_signal("property::maximized_horizontal", u)
710 | capi.client.connect_signal("property::maximized_vertical", u)
711 | capi.client.connect_signal("property::maximized", u)
712 | capi.client.connect_signal("property::minimized", u)
713 | capi.client.connect_signal("property::name", u)
714 | capi.client.connect_signal("property::icon_name", u)
715 | capi.client.connect_signal("property::icon", u)
716 | capi.client.connect_signal("property::skip_taskbar", u)
717 | capi.client.connect_signal("property::screen", function(c, old_screen)
718 | us(c.screen)
719 | us(old_screen)
720 | end)
721 | capi.client.connect_signal("property::hidden", u)
722 | capi.client.connect_signal("tagged", u)
723 | capi.client.connect_signal("untagged", u)
724 | capi.client.connect_signal("unmanage", function(c)
725 | u(c)
726 | for _, i in pairs(instances) do
727 | for _, tlist in pairs(i) do
728 | tlist._unmanage(c)
729 | end
730 | end
731 | end)
732 | capi.client.connect_signal("list", u)
733 | capi.client.connect_signal("focus", u)
734 | capi.client.connect_signal("unfocus", u)
735 | capi.screen.connect_signal("removed", function(s)
736 | instances[get_screen(s)] = nil
737 | end)
738 | end
739 | w._do_tasklist_update()
740 | local list = instances[screen]
741 | if not list then
742 | list = setmetatable({}, { __mode = "v" })
743 | instances[screen] = list
744 | end
745 | table.insert(list, w)
746 | return w
747 | end
748 |
749 | --- Filtering function to include all clients.
750 | -- @return true
751 | -- @filterfunction awful.tasklist.filter.allscreen
752 | function tasklist.filter.allscreen()
753 | return true
754 | end
755 |
756 | --- Filtering function to include the clients from all tags on the screen.
757 | -- @param c The client.
758 | -- @param screen The screen we are drawing on.
759 | -- @return true if c is on screen, false otherwise
760 | -- @filterfunction awful.tasklist.filter.alltags
761 | function tasklist.filter.alltags(c, screen)
762 | -- Only print client on the same screen as this widget
763 | return get_screen(c.screen) == get_screen(screen)
764 | end
765 |
766 | --- Filtering function to include only the clients from currently selected tags.
767 | -- @param c The client.
768 | -- @param screen The screen we are drawing on.
769 | -- @return true if c is in a selected tag on screen, false otherwise
770 | -- @filterfunction awful.tasklist.filter.currenttags
771 | function tasklist.filter.currenttags(c, screen)
772 | screen = get_screen(screen)
773 | -- Only print client on the same screen as this widget
774 | if get_screen(c.screen) ~= screen then return false end
775 | -- Include sticky client too
776 | if c.sticky then return true end
777 | local tags = screen.tags
778 | for _, t in ipairs(tags) do
779 | if t.selected then
780 | local ctags = c:tags()
781 | for _, v in ipairs(ctags) do
782 | if v == t then
783 | return true
784 | end
785 | end
786 | end
787 | end
788 | return false
789 | end
790 |
791 | --- Filtering function to include only the minimized clients from currently selected tags.
792 | -- @param c The client.
793 | -- @param screen The screen we are drawing on.
794 | -- @return true if c is in a selected tag on screen and is minimized, false otherwise
795 | -- @filterfunction awful.tasklist.filter.minimizedcurrenttags
796 | function tasklist.filter.minimizedcurrenttags(c, screen)
797 | screen = get_screen(screen)
798 | -- Only print client on the same screen as this widget
799 | if get_screen(c.screen) ~= screen then return false end
800 | -- Check client is minimized
801 | if not c.minimized then return false end
802 | -- Include sticky client
803 | if c.sticky then return true end
804 | local tags = screen.tags
805 | for _, t in ipairs(tags) do
806 | -- Select only minimized clients
807 | if t.selected then
808 | local ctags = c:tags()
809 | for _, v in ipairs(ctags) do
810 | if v == t then
811 | return true
812 | end
813 | end
814 | end
815 | end
816 | return false
817 | end
818 |
819 | --- Filtering function to include only the currently focused client.
820 | -- @param c The client.
821 | -- @param screen The screen we are drawing on.
822 | -- @return true if c is focused on screen, false otherwise
823 | -- @filterfunction awful.tasklist.filter.focused
824 | function tasklist.filter.focused(c, screen)
825 | -- Only print client on the same screen as this widget
826 | return get_screen(c.screen) == get_screen(screen) and capi.client.focus == c
827 | end
828 |
829 | --- Get all the clients in an undefined order.
830 | --
831 | -- This is the default source.
832 | --
833 | -- @sourcefunction awful.tasklist.source.all_clients
834 | function tasklist.source.all_clients()
835 | return capi.client.get()
836 | end
837 |
838 | function tasklist.mt:__call(...)
839 | return tasklist.new(...)
840 | end
841 |
842 | return setmetatable(tasklist, tasklist.mt)
843 |
844 | -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
845 |
--------------------------------------------------------------------------------
/rc.lua:
--------------------------------------------------------------------------------
1 | --# vim:fileencoding=utf-8:foldmethod=marker
2 | -- If LuaRocks is installed, make sure that packages installed through it are
3 | -- found (e.g. lgi). If LuaRocks is not installed, do nothing.
4 | pcall(require, "luarocks.loader")
5 |
6 | -- Standard awesome library
7 | local gears = require("gears")
8 | local awful = require("awful")
9 | require("awful.autofocus")
10 | -- Widget and layout library
11 | local wibox = require("wibox")
12 | -- Theme handling library
13 | local beautiful = require("beautiful")
14 | -- Notification library
15 | local naughty = require("naughty")
16 | local menubar = require("menubar")
17 | local hotkeys_popup = require("awful.hotkeys_popup")
18 | -- Enable hotkeys help widget for VIM and other apps
19 | -- when client with a matching name is opened:
20 | require("awful.hotkeys_popup.keys")
21 |
22 | local theme = require("theme")
23 |
24 | --awful.spawn.with_shell("~/.config/awesome/autorun.sh")
25 |
26 | -- Error handling {{{
27 | -- Check if awesome encountered an error during startup and fell back to
28 | -- another config (This code will only ever execute for the fallback config)
29 | if awesome.startup_errors then
30 | naughty.notify({
31 | preset = naughty.config.presets.critical,
32 | title = "Oops, there were errors during startup!",
33 | text = awesome.startup_errors,
34 | })
35 | end
36 |
37 | -- Handle runtime errors after startup
38 | do
39 | local in_error = false
40 | awesome.connect_signal("debug::error", function(err)
41 | -- Make sure we don't go into an endless error loop
42 | if in_error then
43 | return
44 | end
45 | in_error = true
46 |
47 | naughty.notify({
48 | preset = naughty.config.presets.critical,
49 | title = "Oops, an error happened!",
50 | text = tostring(err),
51 | })
52 | in_error = false
53 | end)
54 | end
55 | -- }}}
56 |
57 | -- {{{ Variable definitions
58 | -- Themes define colours, icons, font and wallpapers.
59 | --beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
60 | beautiful.init("/home/sv/.config/awesome/theme.lua")
61 |
62 | -- This is used later as the default terminal and editor to run.
63 | terminal = "kitty"
64 | editor = "nvim" or os.getenv("EDITOR")
65 | editor_cmd = terminal .. " -e " .. editor
66 |
67 | -- Default modkey.
68 | -- Usually, Mod4 is the key with a logo between Control and Alt.
69 | -- If you do not like this or do not have such a key,
70 | -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
71 | -- However, you can use another modifier like Mod1, but it may interact with others.
72 | modkey = "Mod4"
73 |
74 | -- Table of layouts to cover with awful.layout.inc, order matters.
75 | awful.layout.layouts = {
76 | awful.layout.suit.tile.left,
77 | --awful.layout.suit.tile,
78 | awful.layout.suit.floating,
79 | awful.layout.suit.max,
80 | --awful.layout.suit.max.fullscreen,
81 | --awful.layout.suit.tile.bottom,
82 | --awful.layout.suit.tile.top,
83 | --awful.layout.suit.fair,
84 | --awful.layout.suit.fair.horizontal,
85 | --awful.layout.suit.spiral,
86 | --awful.layout.suit.spiral.dwindle,
87 | --awful.layout.suit.magnifier,
88 | --awful.layout.suit.corner.nw,
89 | --awful.layout.suit.corner.ne,
90 | --awful.layout.suit.corner.sw,
91 | --awful.layout.suit.corner.se,
92 | }
93 | -- }}}
94 |
95 | -- {{{ Menu
96 | -- Create a launcher widget and a main menu
97 | myawesomemenu = {
98 | {
99 | "hotkeys",
100 | function()
101 | hotkeys_popup.show_help(nil, awful.screen.focused())
102 | end,
103 | },
104 | { "manual", terminal .. " -e man awesome" },
105 | { "edit config", editor_cmd .. " " .. awesome.conffile },
106 | { "restart", awesome.restart },
107 | {
108 | "quit",
109 | function()
110 | awesome.quit()
111 | end,
112 | },
113 | }
114 |
115 | mymainmenu =
116 | awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, { "open terminal", terminal } } })
117 |
118 | mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = mymainmenu })
119 |
120 | -- Menubar configuration
121 | menubar.utils.terminal = terminal -- Set the terminal for applications that require it
122 | -- }}}
123 |
124 | -- Keyboard map indicator and switcher
125 | mykeyboardlayout = awful.widget.keyboardlayout()
126 |
127 | -- {{{ Wibar
128 | -- Create a textclock widget
129 | mytextclock = wibox.widget.textclock()
130 |
131 | -- Create a wibox for each screen and add it
132 | local taglist_buttons = gears.table.join(
133 | awful.button({}, 1, function(t)
134 | t:view_only()
135 | end),
136 | awful.button({ modkey }, 1, function(t)
137 | if client.focus then
138 | client.focus:move_to_tag(t)
139 | end
140 | end),
141 | awful.button({}, 3, awful.tag.viewtoggle),
142 | awful.button({ modkey }, 3, function(t)
143 | if client.focus then
144 | client.focus:toggle_tag(t)
145 | end
146 | end),
147 | awful.button({}, 4, function(t)
148 | awful.tag.viewnext(t.screen)
149 | end),
150 | awful.button({}, 5, function(t)
151 | awful.tag.viewprev(t.screen)
152 | end)
153 | )
154 |
155 | local tasklist_buttons = gears.table.join(
156 | awful.button({}, 1, function(c)
157 | if c == client.focus then
158 | c.minimized = true
159 | else
160 | c:emit_signal("request::activate", "tasklist", { raise = true })
161 | end
162 | end),
163 | awful.button({}, 3, function()
164 | awful.menu.client_list({ theme = { width = 250 } })
165 | end),
166 | awful.button({}, 4, function()
167 | awful.client.focus.byidx(1)
168 | end),
169 | awful.button({}, 5, function()
170 | awful.client.focus.byidx(-1)
171 | end)
172 | )
173 |
174 | local function set_wallpaper(s)
175 | -- Wallpaper
176 | if beautiful.wallpaper then
177 | local wallpaper = beautiful.wallpaper
178 | -- If wallpaper is a function, call it with the screen
179 | if type(wallpaper) == "function" then
180 | wallpaper = wallpaper(s)
181 | end
182 | gears.wallpaper.maximized(wallpaper, s, true)
183 | end
184 | end
185 |
186 | -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
187 | screen.connect_signal("property::geometry", set_wallpaper)
188 |
189 | ---------------------------------
190 | -- Global Variables
191 | ---------------------------------
192 |
193 | local widget_fg = "#a6adc8"
194 | local widget_bg = "#1e1e2e"
195 |
196 | ---------------------------------
197 | -- Cutom Widgets
198 | ---------------------------------
199 |
200 | -- Storage widget
201 | local container_storage_widget = wibox.container
202 |
203 | local storage_widget_root = wibox.widget({
204 | align = "center",
205 | valign = "center",
206 | widget = wibox.widget.textbox,
207 | })
208 |
209 | local update_storage_root = function(st_root)
210 | storage_widget_root.text = " " .. st_root
211 | end
212 |
213 | local storage_widget_home = wibox.widget({
214 | align = "center",
215 | valign = "center",
216 | widget = wibox.widget.textbox,
217 | })
218 |
219 | local update_storage_home = function(st_home)
220 | storage_widget_home.text = " " .. st_home
221 | end
222 |
223 | local storage_root = awful.widget.watch("bash -c \"df -h | awk 'NR==4 {print $4}'\"", 60, function(self, stdout)
224 | local st_root = stdout
225 | update_storage_root(st_root)
226 | end)
227 |
228 | local storage_home = awful.widget.watch("/home/sv/Scripts/Scripts-AwesomeWM/disk-usage.sh", 60, function(self, stdout)
229 | st_home = stdout
230 | update_storage_home(st_home)
231 | end)
232 |
233 | container_storage_widget = {
234 | {
235 | {
236 | {
237 | {
238 | --{
239 | widget = storage_widget_root,
240 | --},
241 | --{
242 | -- widget = storage_widget_home,
243 | --},
244 | --layout = wibox.layout.flex.horizontal
245 | },
246 | left = 0,
247 | right = 0,
248 | top = 0,
249 | bottom = 0,
250 | widget = wibox.container.margin,
251 | },
252 | shape = gears.shape.rounded_bar,
253 | fg = "#b4befe",
254 | bg = widget_bg,
255 | widget = wibox.container.background,
256 | },
257 | left = 10,
258 | right = 10,
259 | top = 0,
260 | bottom = 0,
261 | widget = wibox.container.margin,
262 | },
263 | layout = wibox.layout.fixed.horizontal,
264 | }
265 |
266 | -- Memory progressbar widget
267 | --local container_mem_widget = wibox.container
268 | --local memory_progressbar = wibox.widget {
269 | -- max_value = 16000,
270 | -- value = 0.5, -- very hugly -- minimum value to handle to make it look good
271 | -- margins = 2,
272 | -- forced_width = 80,
273 | -- shape = gears.shape.rounded_bar,
274 | -- border_width = 0.5,
275 | -- border_color = "#b4befe",
276 | -- color = "#b4befe",
277 | -- background_color = widget_bg,
278 | -- widget = wibox.widget.progressbar,
279 | --}
280 | --
281 | --local update_memory_widget = function(mem)
282 | -- memory_progressbar.value = mem
283 | --end
284 | --
285 | --awful.widget.watch('bash -c "free -m | awk \'/Mem/{print $3}\'"', 2, function(self, stdout)
286 | -- local mem = tonumber(stdout)
287 | -- update_memory_widget(mem)
288 | --end)
289 | --
290 | --container_mem_widget = {
291 | -- {
292 | -- {
293 | -- {
294 | -- {
295 | -- {
296 | -- text = " ",
297 | -- font = "JetBrainsMono Nerd Font 9",
298 | -- widget = wibox.widget.textbox,
299 | -- },
300 | -- {
301 | -- widget = memory_progressbar,
302 | -- },
303 | -- layout = wibox.layout.fixed.horizontal
304 | -- },
305 | -- left = 12,
306 | -- right = 12,
307 | -- top = 2,
308 | -- bottom = 2,
309 | -- widget = wibox.container.margin
310 | -- },
311 | -- shape = gears.shape.rounded_bar,
312 | -- fg = "#b4befe",
313 | -- bg = widget_bg,
314 | -- widget = wibox.container.background
315 | -- },
316 | -- left = 5,
317 | -- right = 5,
318 | -- top = 7,
319 | -- bottom = 7,
320 | -- widget = wibox.container.margin
321 | -- },
322 | -- spacing = 0,
323 | -- layout = wibox.layout.fixed.horizontal,
324 | --}
325 |
326 | -- Cpu progressbar widget
327 | --local container_cpu_widget = wibox.container
328 | --
329 | --local cpu_progressbar = wibox.widget {
330 | -- max_value = 100,
331 | -- value = 0.5, -- very hugly -- minimum value to handle to make it look good
332 | -- margins = 2,
333 | -- forced_width = 80,
334 | -- shape = gears.shape.rounded_bar,
335 | -- border_width = 0.5,
336 | -- border_color = "#fab387",
337 | -- color = "#fab387",
338 | -- background_color = widget_bg,
339 | -- widget = wibox.widget.progressbar,
340 | --}
341 | --
342 | --local update_cpu_widget = function(cpu)
343 | -- cpu_progressbar.value = cpu
344 | --end
345 | --
346 | --awful.widget.watch('/home/sv/scripts/get-cpu.sh', 2, function(self, stdout)
347 | -- local cpu = tonumber(stdout)
348 | -- update_cpu_widget(cpu)
349 | --end)
350 | --
351 | --container_cpu_widget = {
352 | -- {
353 | -- {
354 | -- {
355 | -- {
356 | -- {
357 | -- text = " ",
358 | -- font = "JetBrainsMono Nerd Font 9",
359 | -- widget = wibox.widget.textbox,
360 | -- },
361 | -- {
362 | -- widget = cpu_progressbar,
363 | -- },
364 | -- layout = wibox.layout.fixed.horizontal
365 | -- },
366 | -- left = 12,
367 | -- right = 12,
368 | -- top = 2,
369 | -- bottom = 2,
370 | -- widget = wibox.container.margin
371 | -- },
372 | -- shape = gears.shape.rounded_bar,
373 | -- fg = "#fab387",
374 | -- bg = widget_bg,
375 | -- widget = wibox.container.background
376 | -- },
377 | -- left = 5,
378 | -- right = 5,
379 | -- top = 7,
380 | -- bottom = 7,
381 | -- widget = wibox.container.margin
382 | -- },
383 | -- spacing = 0,
384 | -- layout = wibox.layout.fixed.horizontal,
385 | --}
386 |
387 | -- Brightness widget
388 | local container_brightness_widget = wibox.container
389 |
390 | local brightness_widget = wibox.widget({
391 | align = "center",
392 | valign = "center",
393 | widget = wibox.widget.textbox,
394 | })
395 |
396 | local update_brightness_widget = function(brightness)
397 | brightness_widget.text = " " .. brightness
398 | end
399 |
400 | local br, br_signal = awful.widget.watch(
401 | "/home/sv/Scripts/Scripts-AwesomeWM/brightness-bar.sh",
402 | 60,
403 | function(self, stdout)
404 | local brightness = stdout
405 | update_brightness_widget(brightness)
406 | end
407 | )
408 |
409 | container_brightness_widget = {
410 | {
411 | {
412 | {
413 | widget = brightness_widget,
414 | },
415 | left = 12,
416 | right = 10,
417 | top = 0,
418 | bottom = 0,
419 | widget = wibox.container.margin,
420 | },
421 | shape = gears.shape.rounded_bar,
422 | fg = "#f9e2af",
423 | bg = widget_bg,
424 | widget = wibox.container.background,
425 | },
426 | spacing = 5,
427 | layout = wibox.layout.fixed.horizontal,
428 | }
429 |
430 | -- Volume widget
431 | local container_vol_widget = wibox.container
432 |
433 | local vol_widget = wibox.widget({
434 | align = "center",
435 | valign = "center",
436 | widget = wibox.widget.textbox,
437 | })
438 |
439 | local update_vol_widget = function(vol)
440 | vol_widget.text = " " .. vol
441 | end
442 |
443 | local vo, vo_signal = awful.widget.watch("/home/sv/Scripts/Scripts-AwesomeWM/volume-bar.sh", 60, function(self, stdout)
444 | local vol = stdout
445 | update_vol_widget(vol)
446 | end)
447 |
448 | container_vol_widget = {
449 | {
450 | {
451 | {
452 | widget = vol_widget,
453 | },
454 | left = 12,
455 | right = 10,
456 | top = 0,
457 | bottom = 0,
458 | widget = wibox.container.margin,
459 | },
460 | shape = gears.shape.rounded_bar,
461 | fg = "#f38ba8",
462 | bg = widget_bg,
463 | widget = wibox.container.background,
464 | },
465 | spacing = 5,
466 | layout = wibox.layout.fixed.horizontal,
467 | }
468 |
469 | -- Temp widget
470 | --local container_temp_widget = wibox.container
471 | --
472 | --local temp_widget = wibox.widget {
473 | -- align = 'center',
474 | -- valign = 'center',
475 | -- widget = wibox.widget.textbox
476 | --}
477 | --
478 | --local update_temp_widget = function(temp)
479 | -- temp_widget.text = " " .. temp
480 | --end
481 | --
482 | --awful.widget.watch('bash -c "sensors | grep edge | awk \'{print $2}\'"', 2, function(self, stdout)
483 | -- local temp = stdout
484 | -- update_temp_widget(temp)
485 | --end)
486 | --
487 | --container_temp_widget = {
488 | -- {
489 | -- {
490 | -- {
491 | -- {
492 | -- widget = temp_widget,
493 | -- },
494 | -- left = 12,
495 | -- right = 12,
496 | -- top = 2,
497 | -- bottom = 2,
498 | -- widget = wibox.container.margin
499 | -- },
500 | -- shape = gears.shape.rounded_bar,
501 | -- fg = "#a6e3a1",
502 | -- bg = widget_bg,
503 | -- widget = wibox.container.background
504 | -- },
505 | --
506 | -- left = 20,
507 | -- right = 5,
508 | -- top = 7,
509 | -- bottom = 7,
510 | -- widget = wibox.container.margin
511 | -- },
512 | -- spacing = 5,
513 | -- layout = wibox.layout.fixed.horizontal,
514 | --}
515 |
516 | -- Batery widget
517 | local container_battery_widget = wibox.container
518 |
519 | local battery_widget = wibox.widget({
520 | align = "center",
521 | valign = "center",
522 | widget = wibox.widget.textbox,
523 | })
524 |
525 | local update_battery_widget = function(bat)
526 | battery_widget.text = " " .. bat .. "%"
527 | end
528 |
529 | awful.widget.watch('bash -c "cat /sys/class/power_supply/BAT0/capacity"', 60, function(self, stdout)
530 | local bat = tonumber(stdout)
531 | update_battery_widget(bat)
532 | end)
533 |
534 | container_battery_widget = {
535 | {
536 | {
537 | {
538 | widget = battery_widget,
539 | },
540 | left = 12,
541 | right = 10,
542 | top = 0,
543 | bottom = 0,
544 | widget = wibox.container.margin,
545 | },
546 | shape = gears.shape.rounded_bar,
547 | fg = "#a6e3a1",
548 | bg = widget_bg,
549 | widget = wibox.container.background,
550 | },
551 | spacing = 5,
552 | layout = wibox.layout.fixed.horizontal,
553 | }
554 |
555 | -- Distro widget
556 | container_arch_widget = {
557 | {
558 | {
559 | text = "",
560 | font = "JetBrainsMono Nerd Font 15",
561 | widget = wibox.widget.textbox,
562 | },
563 | left = 8,
564 | right = 0,
565 | top = 2,
566 | bottom = 3,
567 | widget = wibox.container.margin,
568 | },
569 | fg = "#f38ba8",
570 | widget = wibox.container.background,
571 | }
572 |
573 | -- Clock widget
574 | container_clock_widget = {
575 | {
576 | {
577 | {
578 | widget = mytextclock,
579 | },
580 | left = 6,
581 | right = 6,
582 | top = 0,
583 | bottom = 0,
584 | widget = wibox.container.margin,
585 | },
586 | shape = gears.shape.rounded_bar,
587 | fg = "#cba6f7",
588 | bg = widget_bg,
589 | widget = wibox.container.background,
590 | },
591 | spacing = 5,
592 | layout = wibox.layout.fixed.horizontal,
593 | }
594 |
595 | local archimage = wibox.widget({
596 | image = theme.layout_archlogo,
597 | resize = false,
598 | widget = wibox.widget.imagebox,
599 | })
600 |
601 | awful.screen.connect_for_each_screen(function(s)
602 | -- Wallpaper
603 | set_wallpaper(s)
604 |
605 | -- Each screen has its own tag table.
606 | awful.tag(
607 | { " ", " ", " ", " ", " ", " ", " ", " ", " " },
608 | s,
609 | awful.layout.layouts[1]
610 | )
611 |
612 | -- Create a promptbox for each screen
613 | s.mypromptbox = awful.widget.prompt()
614 | -- Create an imagebox widget which will contain an icon indicating which layout we're using.
615 | -- We need one layoutbox per screen.
616 | s.mylayoutbox = awful.widget.layoutbox(s)
617 | s.mylayoutbox:buttons(gears.table.join(
618 | awful.button({}, 1, function()
619 | awful.layout.inc(1)
620 | end),
621 | awful.button({}, 3, function()
622 | awful.layout.inc(-1)
623 | end),
624 | awful.button({}, 4, function()
625 | awful.layout.inc(1)
626 | end),
627 | awful.button({}, 5, function()
628 | awful.layout.inc(-1)
629 | end)
630 | ))
631 |
632 | local layoutbox = wibox.widget({
633 | s.mylayoutbox,
634 | top = 3,
635 | bottom = 4,
636 | left = 5,
637 | right = 10,
638 | widget = wibox.container.margin,
639 | })
640 | -- Create a taglist widget
641 | --s.mytaglist = awful.widget.taglist {
642 | -- screen = s,
643 | -- filter = awful.widget.taglist.filter.all,
644 | -- buttons = taglist_buttons
645 | --}
646 | s.mytaglist = require("my_taglist")(s)
647 |
648 | --s.my_tasklist = require("my_tasklist")(s)
649 |
650 | -- Create a tasklist widget
651 | s.mytasklist = awful.widget.tasklist({
652 | screen = s,
653 | filter = awful.widget.tasklist.filter.currenttags,
654 | style = {
655 | shape = gears.shape.rounded_bar,
656 | },
657 | layout = {
658 | spacing = 10,
659 | layout = wibox.layout.fixed.horizontal,
660 | },
661 | -- Notice that there is *NO* wibox.wibox prefix, it is a template,
662 | -- not a widget instance.
663 | widget_template = {
664 | {
665 | {
666 | {
667 | {
668 |
669 | {
670 | id = "icon_role",
671 | widget = wibox.widget.imagebox,
672 | },
673 | left = 0,
674 | right = 5,
675 | top = 2,
676 | bottom = 2,
677 | widget = wibox.container.margin,
678 | },
679 | {
680 | id = "text_role",
681 | font = "JetBrainsMono Nerd Font 9",
682 | widget = wibox.widget.textbox,
683 | },
684 | layout = wibox.layout.fixed.horizontal,
685 | },
686 | left = 5,
687 | right = 5,
688 | top = 0,
689 | bottom = 2,
690 | widget = wibox.container.margin,
691 | },
692 | fg = widget_fg,
693 | bg = widget_bg,
694 | shape = gears.shape.rounded_bar,
695 | widget = wibox.container.background,
696 | },
697 | left = 0,
698 | right = 0,
699 | top = 0,
700 | bottom = 0,
701 | widget = wibox.container.margin,
702 | },
703 | })
704 |
705 | -- Create the wibox
706 | s.mywibox = awful.wibar({
707 | position = "top",
708 | border_width = 0,
709 | border_color = "#00000000",
710 | height = 26,
711 | input_passthrough = true,
712 | screen = s,
713 | })
714 |
715 | -- Add widgets to the wibox
716 | s.mywibox:setup({
717 | {
718 | layout = wibox.layout.align.horizontal,
719 | { -- Left widgets
720 | container_arch_widget,
721 | layout = wibox.layout.fixed.horizontal,
722 | --mylauncher,
723 | s.mytaglist,
724 | s.mypromptbox,
725 | },
726 | { -- Middle widgets
727 | layout = wibox.layout.fixed.horizontal,
728 | s.mytasklist,
729 | },
730 | { -- Right widgets
731 | layout = wibox.layout.fixed.horizontal,
732 | --container_temp_widget,
733 | container_storage_widget,
734 | --container_cpu_widget,
735 | --container_mem_widget,
736 | container_brightness_widget,
737 | container_vol_widget,
738 | container_battery_widget,
739 | container_clock_widget,
740 | layoutbox,
741 | },
742 | },
743 | top = 0, -- don't forget to increase wibar height
744 | color = "#80aa80",
745 | widget = wibox.container.margin,
746 | })
747 | end)
748 | -- }}}
749 |
750 | -- {{{ Mouse bindings
751 | root.buttons(gears.table.join(
752 | awful.button({}, 3, function()
753 | mymainmenu:toggle()
754 | end),
755 | awful.button({}, 4, awful.tag.viewnext),
756 | awful.button({}, 5, awful.tag.viewprev)
757 | ))
758 | -- }}}
759 |
760 | -- {{{ Key bindings
761 | globalkeys = gears.table.join(
762 | -- awful.key({ modkey, }, "s", hotkeys_popup.show_help,
763 | -- { description = "show help", group = "awesome" }),
764 | -- awful.key({ modkey, }, "Left", awful.tag.viewprev,
765 | -- { description = "view previous", group = "tag" }),
766 | -- awful.key({ modkey, }, "Right", awful.tag.viewnext,
767 | -- { description = "view next", group = "tag" }),
768 | awful.key({ modkey }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }),
769 |
770 | awful.key({ modkey }, "j", function()
771 | awful.client.focus.byidx(1)
772 | end, { description = "focus next by index", group = "client" }),
773 | awful.key({ modkey }, "k", function()
774 | awful.client.focus.byidx(-1)
775 | end, { description = "focus previous by index", group = "client" }),
776 | awful.key({ modkey }, "w", function()
777 | mymainmenu:show()
778 | end, { description = "show main menu", group = "awesome" }),
779 |
780 | -- Layout manipulation
781 | awful.key({ modkey, "Shift" }, "j", function()
782 | awful.client.swap.byidx(1)
783 | end, { description = "swap with next client by index", group = "client" }),
784 | awful.key({ modkey, "Shift" }, "k", function()
785 | awful.client.swap.byidx(-1)
786 | end, { description = "swap with previous client by index", group = "client" }),
787 | awful.key({ modkey, "Control" }, "j", function()
788 | awful.screen.focus_relative(1)
789 | end, { description = "focus the next screen", group = "screen" }),
790 | awful.key({ modkey, "Control" }, "k", function()
791 | awful.screen.focus_relative(-1)
792 | end, { description = "focus the previous screen", group = "screen" }),
793 | awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }),
794 | awful.key({ modkey }, "Tab", function()
795 | awful.client.focus.history.previous()
796 | if client.focus then
797 | client.focus:raise()
798 | end
799 | end, { description = "go back", group = "client" }),
800 |
801 | -- Standard program
802 | awful.key({ modkey }, "Return", function()
803 | awful.spawn(terminal)
804 | end, { description = "open a terminal", group = "launcher" }),
805 | awful.key({ modkey }, "b", function()
806 | awful.spawn("qutebrowser")
807 | end, { description = "open qutebrowser", group = "launcher" }),
808 |
809 | -- Screenshots
810 | awful.key({ modkey }, "s", function()
811 | awful.spawn("scrot -q 100 /home/sv/Pictures/Screenshots/%Y-%m-%d_$wx$h.png")
812 | naughty.notify({
813 | title = " ",
814 | fg = "#8293ce",
815 | text = " Screenshot taken",
816 | font = "Roboto Mono Nerd Font 12",
817 | margin = 15,
818 | opacity = 0.7,
819 | --border_width = 3,
820 | --border_color = "#9888c6",
821 | --replaces_id = 1,
822 | --border_width = 3,
823 | --border_color = "#89b4fa",
824 | width = 300,
825 | height = 100,
826 | shape = function(cr, width, heigt)
827 | gears.shape.rounded_rect(cr, width, heigt, 15)
828 | end,
829 | })
830 | end, { description = "Take screenshot fullscreen", group = "screen" }),
831 | awful.key({ modkey, "Shift" }, "s", function()
832 | awful.spawn("scrot -s -q 100 /home/sv/Pictures/Screenshots/%Y-%m-%d_$wx$h.png")
833 | end, { description = "Take screenshot selection", group = "screen" }),
834 |
835 | -- Awesome
836 | awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }),
837 | awful.key({ modkey, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }),
838 |
839 | awful.key({ modkey }, "l", function()
840 | awful.tag.incmwfact(0.05)
841 | end, { description = "increase master width factor", group = "layout" }),
842 | awful.key({ modkey }, "h", function()
843 | awful.tag.incmwfact(-0.05)
844 | end, { description = "decrease master width factor", group = "layout" }),
845 | awful.key({ modkey, "Shift" }, "h", function()
846 | awful.tag.incnmaster(1, nil, true)
847 | end, { description = "increase the number of master clients", group = "layout" }),
848 | awful.key({ modkey, "Shift" }, "l", function()
849 | awful.tag.incnmaster(-1, nil, true)
850 | end, { description = "decrease the number of master clients", group = "layout" }),
851 | awful.key({ modkey, "Control" }, "h", function()
852 | awful.tag.incncol(1, nil, true)
853 | end, { description = "increase the number of columns", group = "layout" }),
854 | awful.key({ modkey, "Control" }, "l", function()
855 | awful.tag.incncol(-1, nil, true)
856 | end, { description = "decrease the number of columns", group = "layout" }),
857 | awful.key({ modkey }, "m", function()
858 | awful.layout.inc(1)
859 | end, { description = "select next", group = "layout" }),
860 | awful.key({ modkey, "Shift" }, "m", function()
861 | awful.layout.inc(-1)
862 | end, { description = "select previous", group = "layout" }),
863 |
864 | awful.key({ modkey, "Control" }, "n", function()
865 | local c = awful.client.restore()
866 | -- Focus restored client
867 | if c then
868 | c:emit_signal("request::activate", "key.unminimize", { raise = true })
869 | end
870 | end, { description = "restore minimized", group = "client" }),
871 |
872 | -- Prompt
873 | awful.key({ modkey, "Shift" }, "r", function()
874 | awful.screen.focused().mypromptbox:run()
875 | end, { description = "run prompt", group = "launcher" }),
876 |
877 | awful.key({ modkey }, "x", function()
878 | awful.prompt.run({
879 | prompt = "Run Lua code: ",
880 | textbox = awful.screen.focused().mypromptbox.widget,
881 | exe_callback = awful.util.eval,
882 | history_path = awful.util.get_cache_dir() .. "/history_eval",
883 | })
884 | end, { description = "lua execute prompt", group = "awesome" }),
885 | -- Menubar
886 | --awful.key({ modkey }, "p", function() menubar.show() end,
887 | --{ description = "show the menubar", group = "launcher" })
888 |
889 | -- Dmenu
890 | --awful.key({ modkey }, "p", function() awful.spawn("dmenu_run -i -c -l 20") end,
891 | --{ description = "show Dmenu", group = "launcher" }))
892 |
893 | -- Rofi
894 | awful.key({ modkey }, "space", function()
895 | awful.spawn("rofi -show drun")
896 | end, { description = "show rofi", group = "launcher" }),
897 |
898 | -- Rofi Calc
899 | awful.key({ modkey, "Shift" }, "c", function()
900 | awful.spawn("rofi -show calc -modi calc -no-show-match -no-sort")
901 | end, { description = "show rofi", group = "launcher" }),
902 |
903 | -- Brightness up
904 | awful.key({ modkey, "Shift" }, "Right", function()
905 | --local brightness = [[/home/sv/scripts/brightness-bar.sh]]
906 | awful.spawn("brightnessctl set +5%")
907 | br_signal:emit_signal("timeout")
908 | --awful.spawn.easy_async(brightness, function(stdout)
909 | -- naughty.notify {
910 | -- --title = "Brightness",
911 | -- text = " " .. stdout,
912 | -- font = "Roboto Mono Nerd Font 12",
913 | -- replaces_id = 1,
914 | -- --border_width = 3,
915 | -- --border_color = "#89b4fa",
916 | -- width = 170,
917 | -- height = 25,
918 | -- shape = function(cr, width, heigt)
919 | -- gears.shape.rounded_rect(cr, width, heigt, 5)
920 | -- end
921 | -- }
922 | --end)
923 | end, { description = "Brightness up", group = "system" }),
924 |
925 | -- Brightness down
926 | awful.key({ modkey, "Shift" }, "Left", function()
927 | --local brightness = [[/home/sv/scripts/brightness-bar.sh]]
928 | awful.spawn("brightnessctl set -5%")
929 | br_signal:emit_signal("timeout")
930 | --awful.spawn.easy_async(brightness, function(stdout)
931 | -- naughty.notify {
932 | -- --title = "Brightness",
933 | -- text = " " .. stdout,
934 | -- font = "Roboto Mono Nerd Font 12",
935 | -- replaces_id = 1,
936 | -- --border_width = 3,
937 | -- --border_color = "#89b4fa",
938 | -- width = 170,
939 | -- height = 25,
940 | -- shape = function(cr, width, heigt)
941 | -- gears.shape.rounded_rect(cr, width, heigt, 5)
942 | -- end
943 | -- }
944 | --end)
945 | end, { description = "Brightness down", group = "system" }),
946 |
947 | -- Volume up
948 | awful.key({}, "XF86AudioRaiseVolume", function()
949 | --local volume = [[/home/sv/scripts/volume-bar.sh]]
950 | awful.spawn("/home/stevevdv/Scripts/Scripts-AwesomeWM/volume-up.sh")
951 | vo_signal:emit_signal("timeout")
952 | --awful.spawn.easy_async(volume, function(stdout)
953 | -- naughty.notify {
954 | -- --title = "Brightness",
955 | -- text = " " .. stdout,
956 | -- font = "Roboto Mono Nerd Font 12",
957 | -- replaces_id = 1,
958 | -- --border_width = 3,
959 | -- --border_color = "#89b4fa",
960 | -- width = 170,
961 | -- height = 25,
962 | -- shape = function(cr, width, heigt)
963 | -- gears.shape.rounded_rect(cr, width, heigt, 5)
964 | -- end
965 | -- }
966 | --end)
967 | end, { description = "Volume up", group = "system" }),
968 |
969 | -- Volume down
970 | awful.key({}, "XF86AudioLowerVolume", function()
971 | --local volume = [[/home/sv/scripts/volume-bar.sh]]
972 | awful.spawn("/home/stevevdv/Scripts/Scripts-AwesomeWM/volume-down.sh")
973 | vo_signal:emit_signal("timeout")
974 | --awful.spawn.easy_async(volume, function(stdout)
975 | -- naughty.notify {
976 | -- --title = "Brightness",
977 | -- text = " " .. stdout,
978 | -- font = "Roboto Mono Nerd Font 12",
979 | -- replaces_id = 1,
980 | -- --border_width = 3,
981 | -- --border_color = "#89b4fa",
982 | -- width = 170,
983 | -- height = 25,
984 | -- shape = function(cr, width, heigt)
985 | -- gears.shape.rounded_rect(cr, width, heigt, 5)
986 | -- end
987 | -- }
988 | --end)
989 | end, { description = "Volume down", group = "system" })
990 | )
991 |
992 | clientkeys = gears.table.join(
993 | awful.key({ modkey }, "f", function(c)
994 | c.fullscreen = not c.fullscreen
995 | c:raise()
996 | end, { description = "toggle fullscreen", group = "client" }),
997 | awful.key({ modkey }, "c", function(c)
998 | c:kill()
999 | end, { description = "close", group = "client" }),
1000 | awful.key(
1001 | { modkey, "Control" },
1002 | "space",
1003 | awful.client.floating.toggle,
1004 | { description = "toggle floating", group = "client" }
1005 | ),
1006 | awful.key({ modkey, "Control" }, "Return", function(c)
1007 | c:swap(awful.client.getmaster())
1008 | end, { description = "move to master", group = "client" }),
1009 | awful.key({ modkey }, "o", function(c)
1010 | c:move_to_screen()
1011 | end, { description = "move to screen", group = "client" }),
1012 | awful.key({ modkey }, "t", function(c)
1013 | c.ontop = not c.ontop
1014 | end, { description = "toggle keep on top", group = "client" }),
1015 | awful.key({ modkey }, "n", function(c)
1016 | -- The client currently has the input focus, so it cannot be
1017 | -- minimized, since minimized clients can't have the focus.
1018 | c.minimized = true
1019 | end, { description = "minimize", group = "client" })
1020 | --awful.key({ modkey, }, "m",
1021 | -- function(c)
1022 | -- c.maximized = not c.maximized
1023 | -- c:raise()
1024 | -- end,
1025 | -- { description = "(un)maximize", group = "client" }),
1026 | --awful.key({ modkey, }, "m",
1027 | -- { description = "Toggle modes", group = "client" }),
1028 | --awful.key({ modkey, "Control" }, "m",
1029 | -- function(c)
1030 | -- c.maximized_vertical = not c.maximized_vertical
1031 | -- c:raise()
1032 | -- end,
1033 | -- { description = "(un)maximize vertically", group = "client" }),
1034 | --awful.key({ modkey, "Shift" }, "m",
1035 | -- function(c)
1036 | -- c.maximized_horizontal = not c.maximized_horizontal
1037 | -- c:raise()
1038 | -- end,
1039 | -- { description = "(un)maximize horizontally", group = "client" })
1040 | )
1041 |
1042 | -- Bind all key numbers to tags.
1043 | -- Be careful: we use keycodes to make it work on any keyboard layout.
1044 | -- This should map on the top row of your keyboard, usually 1 to 9.
1045 | for i = 1, 9 do
1046 | globalkeys = gears.table.join(
1047 | globalkeys,
1048 | -- View tag only.
1049 | awful.key({ modkey }, "#" .. i + 9, function()
1050 | local screen = awful.screen.focused()
1051 | local tag = screen.tags[i]
1052 | if tag then
1053 | tag:view_only()
1054 | end
1055 | end, { description = "view tag #" .. i, group = "tag" }),
1056 | -- Toggle tag display.
1057 | awful.key({ modkey, "Control" }, "#" .. i + 9, function()
1058 | local screen = awful.screen.focused()
1059 | local tag = screen.tags[i]
1060 | if tag then
1061 | awful.tag.viewtoggle(tag)
1062 | end
1063 | end, { description = "toggle tag #" .. i, group = "tag" }),
1064 | -- Move client to tag.
1065 | awful.key({ modkey, "Shift" }, "#" .. i + 9, function()
1066 | if client.focus then
1067 | local tag = client.focus.screen.tags[i]
1068 | if tag then
1069 | client.focus:move_to_tag(tag)
1070 | end
1071 | end
1072 | end, { description = "move focused client to tag #" .. i, group = "tag" }),
1073 | -- Toggle tag on focused client.
1074 | awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function()
1075 | if client.focus then
1076 | local tag = client.focus.screen.tags[i]
1077 | if tag then
1078 | client.focus:toggle_tag(tag)
1079 | end
1080 | end
1081 | end, { description = "toggle focused client on tag #" .. i, group = "tag" })
1082 | )
1083 | end
1084 |
1085 | clientbuttons = gears.table.join(
1086 | awful.button({}, 1, function(c)
1087 | c:emit_signal("request::activate", "mouse_click", { raise = true })
1088 | end),
1089 | awful.button({ modkey }, 1, function(c)
1090 | c:emit_signal("request::activate", "mouse_click", { raise = true })
1091 | awful.mouse.client.move(c)
1092 | end),
1093 | awful.button({ modkey }, 3, function(c)
1094 | c:emit_signal("request::activate", "mouse_click", { raise = true })
1095 | awful.mouse.client.resize(c)
1096 | end)
1097 | )
1098 |
1099 | -- Set keys
1100 | root.keys(globalkeys)
1101 | -- }}}
1102 |
1103 | -- {{{ Rules
1104 | -- Rules to apply to new clients (through the "manage" signal).
1105 | awful.rules.rules = {
1106 | -- All clients will match this rule.
1107 | {
1108 | rule = {},
1109 | properties = {
1110 | border_width = beautiful.border_width,
1111 | border_color = beautiful.border_normal,
1112 | focus = awful.client.focus.filter,
1113 | raise = true,
1114 | keys = clientkeys,
1115 | buttons = clientbuttons,
1116 | screen = awful.screen.preferred,
1117 | placement = awful.placement.no_overlap + awful.placement.no_offscreen,
1118 | },
1119 | },
1120 |
1121 | -- Floating clients.
1122 | {
1123 | rule_any = {
1124 | instance = {
1125 | "DTA", -- Firefox addon DownThemAll.
1126 | "copyq", -- Includes session name in class.
1127 | "pinentry",
1128 | "pavucontrol",
1129 | },
1130 | class = {
1131 | "Arandr",
1132 | "Blueman-manager",
1133 | "pavucontrol",
1134 | "Gpick",
1135 | "Kruler",
1136 | "MessageWin", -- kalarm.
1137 | "Sxiv",
1138 | "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
1139 | "Wpa_gui",
1140 | "veromix",
1141 | "xtightvncviewer",
1142 | },
1143 |
1144 | -- Note that the name property shown in xprop might be set slightly after creation of the client
1145 | -- and the name shown there might not match defined rules here.
1146 | name = {
1147 | "Event Tester", -- xev.
1148 | },
1149 | role = {
1150 | "AlarmWindow", -- Thunderbird's calendar.
1151 | "ConfigManager", -- Thunderbird's about:config.
1152 | "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
1153 | },
1154 | },
1155 | properties = { floating = true },
1156 | },
1157 |
1158 | -- Add titlebars to normal clients and dialogs
1159 | { rule_any = { type = { "normal", "dialog" } }, properties = { titlebars_enabled = false } },
1160 |
1161 | -- Set Firefox to always map on the tag named "2" on screen 1.
1162 | -- { rule = { class = "Firefox" },
1163 | -- properties = { screen = 1, tag = "2" } },
1164 | }
1165 | -- }}}
1166 |
1167 | -- {{{ Signals
1168 | -- Signal function to execute when a new client appears.
1169 | client.connect_signal("manage", function(c)
1170 | -- Set the windows at the slave,
1171 | -- i.e. put it at the end of others instead of setting it master.
1172 | -- if not awesome.startup then awful.client.setslave(c) end
1173 |
1174 | if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
1175 | -- Prevent clients from being unreachable after screen count changes.
1176 | awful.placement.no_offscreen(c)
1177 | end
1178 | end)
1179 |
1180 | -- Add a titlebar if titlebars_enabled is set to true in the rules.
1181 | client.connect_signal("request::titlebars", function(c)
1182 | -- buttons for the titlebar
1183 | local buttons = gears.table.join(
1184 | awful.button({}, 1, function()
1185 | c:emit_signal("request::activate", "titlebar", { raise = true })
1186 | awful.mouse.client.move(c)
1187 | end),
1188 | awful.button({}, 3, function()
1189 | c:emit_signal("request::activate", "titlebar", { raise = true })
1190 | awful.mouse.client.resize(c)
1191 | end)
1192 | )
1193 |
1194 | awful.titlebar(c):setup({
1195 | { -- Left
1196 | awful.titlebar.widget.iconwidget(c),
1197 | buttons = buttons,
1198 | layout = wibox.layout.fixed.horizontal,
1199 | },
1200 | { -- Middle
1201 | { -- Title
1202 | align = "center",
1203 | widget = awful.titlebar.widget.titlewidget(c),
1204 | },
1205 | buttons = buttons,
1206 | layout = wibox.layout.flex.horizontal,
1207 | },
1208 | { -- Right
1209 | awful.titlebar.widget.floatingbutton(c),
1210 | awful.titlebar.widget.maximizedbutton(c),
1211 | awful.titlebar.widget.stickybutton(c),
1212 | awful.titlebar.widget.ontopbutton(c),
1213 | awful.titlebar.widget.closebutton(c),
1214 | layout = wibox.layout.fixed.horizontal(),
1215 | },
1216 | layout = wibox.layout.align.horizontal,
1217 | })
1218 | end)
1219 |
1220 | -- Enable sloppy focus, so that focus follows mouse.
1221 | client.connect_signal("mouse::enter", function(c)
1222 | c:emit_signal("request::activate", "mouse_enter", { raise = false })
1223 | end)
1224 |
1225 | client.connect_signal("focus", function(c)
1226 | c.border_color = beautiful.border_focus
1227 | end)
1228 | client.connect_signal("unfocus", function(c)
1229 | c.border_color = beautiful.border_normal
1230 | end)
1231 | --client.connect_signal("manage", function(c) c.shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, 10) end end)
1232 | --autorun programs
1233 | autorun = true
1234 | autorunApps = {
1235 | "picom",
1236 | --"nitrogen --restore &",
1237 | }
1238 | if autorun then
1239 | for app = 1, #autorunApps do
1240 | awful.util.spawn(autorunApps[app])
1241 | end
1242 | end
1243 |
1244 | -- }}}
1245 |
--------------------------------------------------------------------------------
/theme.lua:
--------------------------------------------------------------------------------
1 | ---------------------------
2 | -- Default awesome theme --
3 | ---------------------------
4 |
5 | local theme_assets = require("beautiful.theme_assets")
6 | local beautiful = require("beautiful")
7 | local xresources = require("beautiful.xresources")
8 | local dpi = xresources.apply_dpi
9 | local wibox = require("wibox")
10 | local awful = require("awful")
11 | local gears = require("gears")
12 | local gcolor = require("gears.color")
13 | local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
14 |
15 |
16 |
17 | local gfs = require("gears.filesystem")
18 | local themes_path = gfs.get_themes_dir()
19 |
20 | local theme = {}
21 |
22 | theme.font = "JetbrainsMono Nerd Font 10.5"
23 | theme.tasklist_font = "JetbrainsMono Nerd Font 9"
24 |
25 | theme.bg_normal = "#1e1e2e"
26 | theme.bg_focus = "#1e1e2e"
27 | theme.bg_urgent = "#1e1e2e"
28 | theme.bg_minimize = "#1e1e2e"
29 | theme.bg_systray = theme.bg_normal
30 |
31 | theme.fg_normal = "#585b70"
32 | theme.fg_focus = "#fab387"
33 | theme.fg_urgent = "#f38ba8"
34 | theme.fg_minimize = "#ffffff"
35 |
36 | theme.useless_gap = dpi(6)
37 | theme.border_width = dpi(1)
38 | theme.border_normal = "#313244"
39 | theme.border_focus = "#b4befe"
40 |
41 |
42 |
43 | theme.border_marked = "#fab387"
44 |
45 |
46 | -- There are other variable sets
47 | -- overriding the default one when
48 | -- defined, the sets are:
49 | -- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile]
50 | -- tasklist_[bg|fg]_[focus|urgent]
51 | -- titlebar_[bg|fg]_[normal|focus]
52 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
53 | -- mouse_finder_[color|timeout|animate_timeout|radius|factor]
54 | -- prompt_[fg|bg|fg_cursor|bg_cursor|font]
55 | -- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font]
56 | -- Example:
57 | --theme.taglist_bg_focus = "#ff0000"
58 |
59 | -- Generate taglist squares:
60 | --local taglist_square_size = dpi(4)
61 | --theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
62 | -- taglist_square_size, theme.fg_focus
63 | --)
64 | --theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
65 | -- taglist_square_size, theme.fg_normal
66 | --)
67 |
68 | -- MEM
69 | local memicon = wibox.widget.imagebox(theme.widget_mem)
70 |
71 | -- CPU
72 | local cpuicon = wibox.widget.imagebox(theme.widget_cpu)
73 |
74 | -- Variables set for theming notifications:
75 | -- notification_font
76 | -- notification_[bg|fg]
77 | -- notification_[width|height|margin]
78 | -- notification_[border_color|border_width|shape|opacity]
79 |
80 | -- Variables set for theming the menu:
81 | -- menu_[bg|fg]_[normal|focus]
82 | -- menu_[border_color|border_width]
83 | theme.menu_submenu_icon = themes_path .. "default/submenu.png"
84 | theme.menu_height = dpi(15)
85 | theme.menu_width = dpi(100)
86 |
87 | -- You can add as many variables as
88 | -- you wish and access them by using
89 | -- beautiful.variable in your rc.lua
90 | --theme.bg_widget = "#cc0000"
91 |
92 | -- Define the image to load
93 | theme.titlebar_close_button_normal = themes_path .. "default/titlebar/close_normal.png"
94 | theme.titlebar_close_button_focus = themes_path .. "default/titlebar/close_focus.png"
95 |
96 | theme.titlebar_minimize_button_normal = themes_path .. "default/titlebar/minimize_normal.png"
97 | theme.titlebar_minimize_button_focus = themes_path .. "default/titlebar/minimize_focus.png"
98 |
99 | theme.titlebar_ontop_button_normal_inactive = themes_path .. "default/titlebar/ontop_normal_inactive.png"
100 | theme.titlebar_ontop_button_focus_inactive = themes_path .. "default/titlebar/ontop_focus_inactive.png"
101 | theme.titlebar_ontop_button_normal_active = themes_path .. "default/titlebar/ontop_normal_active.png"
102 | theme.titlebar_ontop_button_focus_active = themes_path .. "default/titlebar/ontop_focus_active.png"
103 |
104 | theme.titlebar_sticky_button_normal_inactive = themes_path .. "default/titlebar/sticky_normal_inactive.png"
105 | theme.titlebar_sticky_button_focus_inactive = themes_path .. "default/titlebar/sticky_focus_inactive.png"
106 | theme.titlebar_sticky_button_normal_active = themes_path .. "default/titlebar/sticky_normal_active.png"
107 | theme.titlebar_sticky_button_focus_active = themes_path .. "default/titlebar/sticky_focus_active.png"
108 |
109 | theme.titlebar_floating_button_normal_inactive = themes_path .. "default/titlebar/floating_normal_inactive.png"
110 | theme.titlebar_floating_button_focus_inactive = themes_path .. "default/titlebar/floating_focus_inactive.png"
111 | theme.titlebar_floating_button_normal_active = themes_path .. "default/titlebar/floating_normal_active.png"
112 | theme.titlebar_floating_button_focus_active = themes_path .. "default/titlebar/floating_focus_active.png"
113 |
114 | theme.titlebar_maximized_button_normal_inactive = themes_path .. "default/titlebar/maximized_normal_inactive.png"
115 | theme.titlebar_maximized_button_focus_inactive = themes_path .. "default/titlebar/maximized_focus_inactive.png"
116 | theme.titlebar_maximized_button_normal_active = themes_path .. "default/titlebar/maximized_normal_active.png"
117 | theme.titlebar_maximized_button_focus_active = themes_path .. "default/titlebar/maximized_focus_active.png"
118 |
119 | theme.wallpaper = "/home/sv/Pictures/walls/arch-catppuccin.png"
120 |
121 | -- You can use your own layout icons like this:
122 | theme.layout_fairh = themes_path .. "default/layouts/fairhw.png"
123 | theme.layout_fairv = themes_path .. "default/layouts/fairvw.png"
124 | theme.layout_floating = "/home/sv/.config/awesome/Icons-AwesomeWM-Layouts-pastel/floating.png"
125 | theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png"
126 | theme.layout_max = "/home/sv/.config/awesome/Icons-AwesomeWM-Layouts-pastel/max.png"
127 | theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png"
128 | theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png"
129 | theme.layout_tileleft = "/home/sv/.config/awesome/Icons-AwesomeWM-Layouts-pastel/tileleft.png"
130 | theme.layout_tile = themes_path .. "default/layouts/tilew.png"
131 | theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png"
132 | theme.layout_spiral = themes_path .. "default/layouts/spiralw.png"
133 | theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png"
134 | theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png"
135 | theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png"
136 | theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png"
137 | theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png"
138 |
139 | --theme.layout_archlogo = "/home/sv/pictures/Icons-AwesomeWM-Layouts-pastel/archlinux.png"
140 |
141 |
142 | for _, value in ipairs { true, false } do
143 | beautiful.tasklist_plain_task_name = false
144 | end
145 |
146 | -- Generate Awesome icon:
147 | theme.awesome_icon = theme_assets.awesome_icon(
148 | theme.menu_height, theme.bg_focus, theme.fg_focus
149 | )
150 |
151 | -- Define the icon theme for application icons. If not set then the icons
152 | -- from /usr/share/icons and /usr/share/icons/hicolor will be used.
153 | theme.icon_theme = nil
154 |
155 | return theme
156 |
157 | -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
158 |
--------------------------------------------------------------------------------