diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 65caccc..0000000 --- a/.drone.yml +++ /dev/null @@ -1,37 +0,0 @@ -kind: pipeline -name: default - -steps: -- name: build - image: silex/emacs:master-alpine-ci - commands: - - emacs -Q --script export.el - when: - branch: - - master - event: - exclude: - - pull_request - -- name: deploy - image: appleboy/drone-scp - settings: - host: - from_secret: ssh_host - target: - from_secret: ssh_target - source: - - org/config/* - strip_components: 2 - username: - from_secret: ssh_username - password: - from_secret: ssh_password - port: - from_secret: ssh_port - when: - branch: - - master - event: - exclude: - - pull_request diff --git a/README.org b/README.org index 0a79929..97ddb71 100644 --- a/README.org +++ b/README.org @@ -3,49 +3,31 @@ #+EMAIL: lucien@phundrak.com #+CREATOR: Lucien Cartier-Tilet #+LANGUAGE: en -#+OPTIONS: auto-id:t H:4 broken_links:mark email:t ^:{} +#+OPTIONS: H:4 broken_links:mark email:t ^:{} #+KEYWORDS: dotfiles linux emacs configuration phundrak drakpa -#+html: -#+html: #+html: -#+html: * Presentation - :PROPERTIES: - :CUSTOM_ID: Presentation-e5605995 - :END: - This repository is where I keep most of my configuration files. With what is - stored here, anyone can recreate a working desktop configuration similar to my - daily one. +This repository is where I keep most of my configuration files. With +what is stored here, anyone can recreate a working desktop +configuration similar to my daily one. - My dotfiles are managed by [[https://yadm.io/][yadm]], and although I don’t use its alternate files - features (which is pretty neat btw), it allows me to painlessly manage my - dotfiles right where they are and not in a separate Git repository somewhere - with everything symlinked. Another advantage of yadm is it will automatically - execute (with your authorization, of course) my homemade bootstrap when my - dotfiles are cloned through yadm. +My dotfiles are managed by [[https://yadm.io/][yadm]], and although I don’t use its +alternate files features (which is pretty neat btw), it allows me to +painlessly manage my dotfiles right where they are and not in a +separate Git repository somewhere with everything symlinked. Another +advantage of yadm is it will automatically execute (with your +authorization, of course) my homemade bootstrap when my dotfiles are +cloned through yadm. -* Where’s the config file for X? - :PROPERTIES: - :CUSTOM_ID: Where’s_the_config_file_for_X?-7b214c4a - :END: - As you may have noticed, I am striving for a 100% amount of configuration - files exported from Org files, that is, through literary programming. This is - still very much a work in progress though. Most of what you need can be found - in my [[file:org/config/index.org][index.org]] file and in its folder. - -* Some more info please? - :PROPERTIES: - :CUSTOM_ID: Some_more_info_please?-f54ae73a - :END: - Everything you need to know is in my [[file:org/config/]] folder, and my Org files - are also available in web format on my website [[https://config.phundrak.com/][config.phundrak.com]]. +* A lot of things are missing! +Yep, a lot of things are not in this repository but over at +[[https://config.phundrak.com][config.phundrak.com]]. This is where I store all my litterate config. +You can check out its own repo over at +[[https://labs.phundrak.com/phundrak/config.phundrak.com][labs.phundrak.com/phundrak/config.phundrak.com]]. * Neat, what’s the license? - :PROPERTIES: - :CUSTOM_ID: Neat,_what’s_the_license?-399aa236 - :END: All of my dotfiles (and my dotfiles only) are available under the GNU GPLv3 Licence. Please consult [[file:LICENCE.md]] for more information. In short: you are free to access, edit and redistribute all of my dotfiles under the same diff --git a/export.el b/export.el deleted file mode 100755 index fa840d6..0000000 --- a/export.el +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env -S emacs -Q --script - -(require 'package) -(require 'org) -(require 'ox-html) - -(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) -(package-initialize) -(package-refresh-contents) -(package-install 'htmlize) - -(setq org-confirm-babel-evaluate nil - org-html-validation-link nil - make-backup-files nil) - -(defun export-and-clean (directory) - (progn (mapc (lambda (file) - (progn (message (concat "=====================\n" - "Exporting " - file - "\n" - "=====================\n")) - (with-current-buffer (find-file file) - (org-html-export-to-html)))) - (directory-files directory t (regexp-quote ".org"))))) - -(dolist (dir '("org/config/" "org/config/Deprecated/" "org/config/WIP")) - (export-and-clean dir)) diff --git a/org/config/.dir-locals.el b/org/config/.dir-locals.el deleted file mode 100644 index faa8462..0000000 --- a/org/config/.dir-locals.el +++ /dev/null @@ -1,2 +0,0 @@ -((org-mode . ((org-confirm-babel-evaluate . nil) - (org-latex-reference-command . "\\ref{%s}")))) diff --git a/org/config/Deprecated/awesome.org b/org/config/Deprecated/awesome.org deleted file mode 100644 index f5d52c1..0000000 --- a/org/config/Deprecated/awesome.org +++ /dev/null @@ -1,1513 +0,0 @@ -#+title: AwesomeWM configuration -#+setupfile: ../headers -#+OPTIONS: unique-id:t -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+PROPERTY: header-args :noweb yes :tangle no :exports none -#+PROPERTY: header-args:lua :tangle ~/.config/awesome/rc.lua :exports code :noweb yes :mkdirp yes - -* Introduction -:PROPERTIES: -:CUSTOM_ID: Introduction-4c41360e -:END: -From the Arch Wiki: awesome is a highly configurable, next generation framework -window manager for Xorg. It is very fast and extensible. It is primarily -targeted at power users, developers and any people dealing with every day -computing tasks and who want to have fine-grained control on its graphical -environment. - -Personally, what really made me want to try Awesome is the fact its -configuration file is written with an actual programming language and not just a -configuration language like with i3, and by the fact it works with tags and not -workspaces which makes window management much more flexible. - -This document was written in Emacs with Org-mode and is both the documentation -and source code of my configuration file which can be extracted to -~$HOME/.config/awesome/rc.lua~ through a call to ~org-babel-tangle~. - -* Launching Awesome -:PROPERTIES: -:CUSTOM_ID: Launching-Awesome-lavgvvz00bj0 -:END: -In order to launch Awesome with ~startx~, I need a ~xinit~-compatible -script. Here is my ~$HOME/.xinitrc.awesome~ file: -#+begin_src sh :tangle ~/.xinitrc.awesome -xhost + -exec awesome -#+end_src - -* Loading libraries -:PROPERTIES: -:CUSTOM_ID: Loading_libraries-4df76999 -:END: -First of all, some initialization is needed, and this initialization is about -math randomness. So, let’s initialize the ~random~ method of the ~math~ library: -#+BEGIN_SRC lua -math.randomseed(os.time()) -#+END_SRC - -In order to be able to load libraries properly, I first need to make sure -LuaRocks is installed, so I can also make sure the packages our configuration -depends on installed through it can be found. If LuaRocks is not installed, then -do nothing. -#+BEGIN_SRC lua -pcall(require, "luarocks.loader") -#+END_SRC - -Next, we’ll also load the following libraries -#+NAME: table-imported-libraries -| Library | Import as | What it is | -|---------------------+---------------+---------------------------| -| gears | gears | Standard Awesome library | -| awful | awful | Standard Awesome library | -| wibox | wibox | Widget and layout library | -| beautiful | beautiful | Theme handling library | -| naughty | naughty | Notification library | -| menubar | menubar | Create menus | -| awful.hotkeys_popup | hotkeys_popup | Help window for hotkeys | - -#+NAME: imported-libraries -#+BEGIN_SRC emacs-lisp :var libs=table-imported-libraries :cache yes -(mapconcat (lambda (x) (format "local %s = require(\"%s\")" - (cadr x) - (car x))) - libs - "\n") -#+END_SRC - -#+RESULTS[a66d7b66dbd4b4001dc3f649840b66761cc915b5]: imported-libraries -: local gears = require("gears") -: local awful = require("awful") -: local wibox = require("wibox") -: local beautiful = require("beautiful") -: local naughty = require("naughty") -: local menubar = require("menubar") -: local hotkeys_popup = require("awful.hotkeys_popup") - -Here is the actual code in the config file: -#+BEGIN_SRC lua -<> -#+END_SRC - -I also want to be able to autofocus the first window when I go to another workspace, so let’s require that: -#+BEGIN_SRC lua -require("awful.autofocus") -#+END_SRC - -And finally, I want to be able to declare some shortcuts specific to some apps -thanks to the hotkeys help widget. -#+BEGIN_SRC lua -require("awful.hotkeys_popup.keys") -#+END_SRC -By the way, let’s initialize the ~random~ method of the ~math~ library: -#+BEGIN_SRC lua -math.randomseed(os.time()) -#+END_SRC - -* Error handling -:PROPERTIES: -:CUSTOM_ID: Error_handling-f6a6668f -:END: -This code checks if Awesome encountered an error during startup and fell back to -another config. This code will only ever execute for the fallback config. -#+BEGIN_SRC lua -if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) -end -#+END_SRC - -And this code handles runtime errors after startup thanks to signals. -#+BEGIN_SRC lua -do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true - - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = tostring(err) }) - in_error = false - end) -end -#+END_SRC - -* Variable definitions -:PROPERTIES: -:CUSTOM_ID: Variable_definitions-06b2bcbf -:END: -** Themes -:PROPERTIES: -:CUSTOM_ID: Variable_definitions-Themes-591886b4 -:END: -With Awesome, it is possible to load or write custom themes in order to give -Awesome a special look that fits the user. I am currently using a custom theme -that is not yet included in my dotfiles. I will add it later, along with the -images used for the theme. -#+BEGIN_SRC lua -beautiful.init("/home/phundrak/.config/awesome/nord/theme.lua") -#+END_SRC - -** Default terminal and text editor -:PROPERTIES: -:CUSTOM_ID: Variable_definitions-Default_terminal_and_text_editor-44b84e20 -:END: -The two following variables are set so that I don’t need to go over my whole -config file in order to modify which terminal or text editor I use, not that I -do it often though. -#+BEGIN_SRC lua -terminal = "kitty" -editor = os.getenv("EDITOR") or "emacsclient -c -a emacs" -#+END_SRC - -** Keys -:PROPERTIES: -:CUSTOM_ID: Variable_definitions-Keys-b8def4ac -:END: -The following declares the default Modkey. Usually, ~Mod4~ is the Super key, -situated between the Ctrl key and the Alt key with a logo (usually Windows’). -Another usual value for this is ~Mod1~, which is the Alt key, but it has greater -chances of interfering with other software. I also defined some other obvious -variables in order to make my code cleaner later on. -#+BEGIN_SRC lua -modkey = "Mod4" -shift = "Shift" -control = "Control" -meta = "Mod1" -alt = "Mod1" -- Just in case -#+END_SRC - -* Custom functions -:PROPERTIES: -:CUSTOM_ID: Custom_functions-ed54dbe2 -:END: -** Wallpaper-related functions -:PROPERTIES: -:CUSTOM_ID: Custom_functions-Wallpaper-related_functions-5912f7dd -:END: -*** Set a random wallpaper -:PROPERTIES: -:CUSTOM_ID: Custom_functions-Wallpaper-related_functions-Set_a_random_wallpaper-104bbeec -:END: -This function sets a random wallpaper from the directory -=~/Pictures/Wallpapers=, see [[file:bin.org::#pape-update-bdecbadf][pape-update]] in my custom scripts. -#+BEGIN_SRC lua -local function set_random_pape() - awful.spawn.with_shell("pape-update") - naughty.notify({ preset = naughty.config.presets.normal, - title = "Wallpaper change", - text = "Done!"}) -end -#+END_SRC - -*** Restore previous wallpaper -:PROPERTIES: -:CUSTOM_ID: Custom_functions-Wallpaper-related_functions-Restore_previous_wallpaper-8b5bc08c -:END: -I also wrote the following function that will restore the previously set -wallpaper: -#+BEGIN_SRC lua -local function set_wallpaper(_) - awful.spawn.with_shell("nitrogen --restore") -end -#+END_SRC - -** Layout manipulation -:PROPERTIES: -:CUSTOM_ID: Custom_functions-Layout_manipulation-6bc7db06 -:END: -The following function is used by a shortcut described below in -[[#Keybindings-Clients-f9f96d60]]. -#+BEGIN_SRC lua -local function client_go_back() - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end -end -#+END_SRC - -** Clients manipulation -:PROPERTIES: -:CUSTOM_ID: Custom_functions-Clients_manipulation-7e958fed -:END: -#+BEGIN_SRC lua -local function restore_minimized_clients() - local c = awful.client.restore() - -- Focus restored client - if c then - c:emit_signal( - "request::activate", "key.unminimize", {raise = true} - ) - end -end -#+END_SRC - -#+BEGIN_SRC lua -local function toggle_fullscreen_client(c) - c.fullscreen = not c.fullscreen - c:raise() -end -#+END_SRC - -#+BEGIN_SRC lua -local function toggle_maximized(c) - c.maximized = not c.maximized - c:raise() -end -#+END_SRC - -#+BEGIN_SRC lua -local function toggle_vertical_maximized(c) - c.maximized_vertical = not c.maximized_vertical - c:raise() -end -#+END_SRC - -#+BEGIN_SRC lua -local function toggle_horizontal_maximized(c) - c.maximized_horizontal = not c.maximized_horizontal - c:raise() -end -#+END_SRC - -** Tag manipulation -:PROPERTIES: -:CUSTOM_ID: Custom_functions-Tag_manipulation-5fc67669 -:END: -#+BEGIN_SRC lua -local function view_tag_n(i) - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - tag:view_only() - end -end -#+END_SRC - -#+BEGIN_SRC lua -local function toggle_tag_n(i) - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - awful.tag.viewtoggle(tag) - end -end -#+END_SRC - -#+BEGIN_SRC lua -local function move_focused_to_tag_n(i) - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:move_to_tag(tag) - end - end -end -#+END_SRC - -#+BEGIN_SRC lua -local function toggle_focused_client_to_tag_n(i) - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:toggle_tag(tag) - end - end -end -#+END_SRC - -** Awesome prompt -:PROPERTIES: -:CUSTOM_ID: Custom_functions-Awesome_prompt-de4fde50 -:END: -#+BEGIN_SRC lua -local function invoke_lua_execute_prompt() - awful.prompt.run { - prompt = "Run Lua code: ", - textbox = awful.screen.focused().promptbox.widget, - exe_callback = awful.util.eval, - history_path = awful.util.get_cache_dir() .. "/history_eval" - } -end -#+END_SRC - -* Layouts -:PROPERTIES: -:CUSTOM_ID: Layouts-be55a7fd -:END: -The following is a list of available windows layouts. I only enable some of -them, and their order in the table is their order in Awesome. -#+NAME: table-layouts -| Layout | Enabled? | -|-----------------+----------| -| magnifier | yes | -| tile.left | yes | -| tile | yes | -| tile.bottom | yes | -| tile.top | yes | -| max | yes | -| max.fullscreen | yes | -| floating | yes | -| fair | yes | -| fair.horizontal | yes | -| spiral | yes | -| spiral.dwindle | yes | -| corner.nw | no | -| corner.ne | no | -| corner.sw | no | -| corner.se | no | - -#+NAME: list-layouts -#+BEGIN_SRC emacs-lisp :var layouts=table-layouts :cache yes -(mapconcat (lambda (layout) - (let ((enabled-p (string= (cadr layout) "yes")) - (layout (car layout))) - (when enabled-p - (format "awful.layout.suit.%s,\n" layout)))) - layouts - "") -#+END_SRC - -#+RESULTS[bf3bbbd40ecc04ec19d9660abff2080b4f68196a]: list-layouts -#+begin_example -awful.layout.suit.magnifier, -awful.layout.suit.tile.left, -awful.layout.suit.tile, -awful.layout.suit.tile.bottom, -awful.layout.suit.tile.top, -awful.layout.suit.max, -awful.layout.suit.max.fullscreen, -awful.layout.suit.floating, -awful.layout.suit.fair, -awful.layout.suit.fair.horizontal, -awful.layout.suit.spiral, -awful.layout.suit.spiral.dwindle, -#+end_example - -Here is the code that activates these layouts: -#+BEGIN_SRC lua -awful.layout.layouts = { - <> -} -#+END_SRC - -* Top bar -:PROPERTIES: -:CUSTOM_ID: Top_bar-d3117294 -:END: -The top bar in Awesome is declared thanks to a ~wibar~ widget fro the ~awful~ -library. It is comprised of several buttons and widgets that will be declared -below. - -** Menus -:PROPERTIES: -:CUSTOM_ID: Top_bar-Menus-cf468ca8 -:END: -#+NAME: make-menu -#+BEGIN_SRC emacs-lisp :var menu=table-main-menu -(mapconcat (lambda (item) - (format "{ \"%s\", %s }" - (car item) - (mapconcat #'identity (cdr item) ", "))) - menu - ",\n") -#+END_SRC - -#+RESULTS: make-menu -: { "awesome", awesomewm_menu, beautiful.awesome_icon }, -: { "open terminal", terminal, nil } - -It is possible to create actual menus in Awesome, including the one available at -the top-left corner of the screen. First, let’s declare a menu related to -Awesome: -#+NAME: table-awesome-menu -| Name | Command | -|-------------+---------------------------------------------------------------------| -| hotkeys | function() hotkeys_popup.show_help(nil, awful.screen.focused()) end | -| edit config | editor .. " " .. awesome.conffile | -| restart | awesome.restart | -| quit | function() awesome.quit() end | - -And here is the actual code: -#+BEGIN_SRC lua -awesomewm_menu = { - <> -} -#+END_SRC - -Next, let’s create the main menu that will be used on ~S-w~ and at the top left -of the window: -#+NAME: table-main-menu -| Name | Command | Icon | -|---------------+----------------+------------------------| -| awesome | awesomewm_menu | beautiful.awesome_icon | -| open terminal | terminal | nil | - -Here is the actual code: -#+BEGIN_SRC lua -mainmenu = awful.menu({ items = { - <> - }}) -#+END_SRC - -For now it only has two entries: the Awesome menu and opening a terminal, I will -add some more later probably. Let’s specify it as being our main launcher: -#+BEGIN_SRC lua -launcher = awful.widget.launcher({ image = beautiful.awesome_icon, - menu = mainmenu }) -#+END_SRC - -Finally, let’s declare the menubar’s terminal for applications that require it. -#+BEGIN_SRC lua -menubar.utils.terminal = terminal -#+END_SRC - -** Widgets -:PROPERTIES: -:CUSTOM_ID: Top_bar-Widgets-0b255378 -:END: -Let’s declare the keyboard map indicator and switcher for the top bar: -#+BEGIN_SRC lua -keyboardlayout = awful.widget.keyboardlayout() -#+END_SRC - -Let’s also create a clock widget: -#+BEGIN_SRC lua -textclock = wibox.widget.textclock() -#+END_SRC - -** Tag list -:PROPERTIES: -:CUSTOM_ID: Top_bar-Tag_list-d43dbb62 -:END: -In order to create the taglist (an equivalent to workspaces, but better), we -need to create first a local variable that will hold the widget. It will be -declared as you can see below: -#+BEGIN_SRC lua :tangle no -local tasklist_buttons = gears.table.join( - -- configuration goes here -) -#+END_SRC - -~gears.table.join()~ joins several tables together, as described [[https://awesomewm.org/doc/api/libraries/gears.table.html][here]], which -will be useful since all its arguments will be tables generated by the -~awful.button~ method which will be useful in order to manage what clicks on the -tags should do. First, let’s manage left clicks. - -Left clicks in general are dedicated to tag visibility. A simple left click on a -tag should switch this tag as the only visible tag, no matter how many of them -were visible beforehand. -#+NAME: tag-simple-left-click -#+BEGIN_SRC lua :tangle no -awful.button({ }, 1, function(t) t:view_only() end) -#+END_SRC - -However, left clicks combined with the modkey will add the clicked tag to the -list of visible tags, which allows the user to see windows from several tags at -once. -#+NAME: tag-mod-left-click -#+BEGIN_SRC lua :tangle no -awful.button({ modkey }, 1, awful.tag.viewtoggle) -#+END_SRC - -Right clicks are dedicated to window tagging. A simple right click will untag -the currently focused window and tag it again with the clicked tag, moving it -effectively from one tag to another. -#+NAME: tag-simple-right-click -#+BEGIN_SRC lua :tangle no -awful.button({ }, 3, function(t) - if client.focus then - client.focus:move_to_tag(t) - end -end) -#+END_SRC - -However, a right click combined with the modkey will add the clicked tag to the -currently focused window, making it visible to both tags. -#+NAME: tag-mod-right-click -#+BEGIN_SRC lua :tangle no -awful.button({ modkey }, 3, function(t) - if client.focus then - client.focus:toggle_tag(t) - end -end) -#+END_SRC - -The scroll wheel is treated as clicks just as any right or left clicks and can -be interpreted by Awesome. They can prove useful when it comes to tags. If a -scroll up is detected over tags, then Awesome will display the previous tag. -#+NAME: tag-simple-scroll-up -#+BEGIN_SRC lua :tangle no -awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end) -#+END_SRC - -Otherwise, if a scroll down is detected, the next tag will be displayed. -#+NAME: tag-simple-scroll-down -#+BEGIN_SRC lua :tangle no -awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end) -#+END_SRC - -So, here’s the actual configuration code for the taglist: -#+BEGIN_SRC lua -local taglist_buttons = gears.table.join( - <>, - <>, - <>, - <>, - <>, - <> -) -#+END_SRC - -** Tasks list -:PROPERTIES: -:CUSTOM_ID: Top_bar-Tasks_list-fb7c9b20 -:END: -Similarly to the tag list, the task list can display some special behavior -depending on the clicks it receives. These clicks are set like so: -#+BEGIN_SRC lua :tangle no -local tasklist_buttons = gears.table.join( - -- List of clicks -) -#+END_SRC - -A left click on a task in the taskbar will simply focus and raise the window -linked to it if it is not focused. Otherwise, if the window is focused, the -window will be minimized. -#+NAME: task-simple-left-click -#+BEGIN_SRC lua :tangle no -awful.button({ }, 1, function (c) - if c == client.focus then - c.minimized = true - else - c:emit_signal( - "request::activate", - "tasklist", - {raise = true} - ) - end -end) -#+END_SRC - -If the right click is detected, then a list of all the opened clients is invoked -so we can switch to another (and if needed switch visible tag). The width of -this list will be 250px. -#+NAME: task-simple-right-click -#+BEGIN_SRC lua :tangle no -awful.button({ }, 3, function() - awful.menu.client_list({ theme = { width = 250 } }) -end) -#+END_SRC - -If a scroll up is detected, then let’s select the previous client in the -tasklist. -#+NAME: task-simple-scroll-up -#+BEGIN_SRC lua :tangle no -awful.button({ }, 4, function () - awful.client.focus.byidx(1) -end) -#+END_SRC - -If a scroll down is detected, then let’s select the next client in the tasklist. -#+NAME: task-simple-scroll-down -#+BEGIN_SRC lua :tangle no -awful.button({ }, 5, function () - awful.client.focus.byidx(-1) -end) -#+END_SRC - -So, here’s the actual code for the tasklist: -#+BEGIN_SRC lua -local tasklist_buttons = gears.table.join( - <>, - <>, - <>, - <> -) -#+END_SRC - -* Theme and display -:PROPERTIES: -:CUSTOM_ID: Theme_and_display-6f94bad4 -:END: -** Screen update -:PROPERTIES: -:CUSTOM_ID: Theme_and_display-Screen_update-e162a27a -:END: -When a screen’s geometry changes (e.g. when a different resolution is applied), -the signal ~property::geometry~ is sent. When this is the case, the wallpaper -should be redisplayed since it won’t necessarily fit the new geometry of the -screen. And remember, I have a [[#Custom_functions-Wallpaper-related_functions-Restore_previous_wallpaper-8b5bc08c][function that does exactly that]]! Let’s connect -this function to the geometry change signal: -#+BEGIN_SRC lua -screen.connect_signal("property::geometry", set_wallpaper) -#+END_SRC - -If a new screen gets connected, it will need to get a new wallpaper. A lot needs -to be done, and all the following lines of code will be inside a block like -this: -#+BEGIN_SRC lua :tangle no -awful.screen.connect_for_each_screen(function(s) - -- Code to be executed goes here -end) -#+END_SRC - -So, due the code block above, if you see any reference to ~s~ in the code blocks -below, it will refer to the screen being set up by the function. - -First, let’s set its wallpaper: -#+NAME: screen-set-pape -#+BEGIN_SRC lua :tangle no -set_wallpaper() -#+END_SRC - -Next, let’s build a list of tags for the screen. *Be aware that each screen has -its own tag table!* The default layout will be the first refered to in the -layouts list described above. -#+NAME: screen-taglist -#+BEGIN_SRC lua :tangle no -awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }, s, awful.layout.layouts[1]) -#+END_SRC - -Next, let’s create the taglist widget. It will use the ~taglist_buttons~ -[[#Top_bar-Tag_list-d43dbb62][declared above]] in order to handle clicks on tags, and due to the filter, all -tags will be displayed in the tagbar ([[https://awesomewm.org/apidoc/widgets/awful.widget.taglist.html#List_filters][more about tag filters]]). -#+NAME: screen-taglist-widget -#+BEGIN_SRC lua :tangle no -s.taglist = awful.widget.taglist { - screen = s, - filter = awful.widget.taglist.filter.all, - buttons = taglist_buttons -} -#+END_SRC - -A tasklist widget will also get created thanks with the ~tasklist_button~ -[[#Top_bar-Tag_list-d43dbb62][declared above]] that will handle clicks on tasks. Contrarily to the taglist -widget above, the tasklist will only display the screen’s current tags thanks to -its filter. -#+NAME: screen-tasklist-widget -#+BEGIN_SRC lua :tangle no -s.tasklist = awful.widget.tasklist { - screen = s, - filter = awful.widget.tasklist.filter.currenttags, - buttons = tasklist_buttons -} -#+END_SRC - -A promptbox will also be created for the screen: -#+NAME: screen-promptbox -#+BEGIN_SRC lua :tangle no -s.promptbox = awful.widget.prompt() -#+END_SRC - -Then, Let’s create an imagebox widget in which will be contained an icon -indicating which layout is being used. We need one per screen. We will also make -it clickable: if there is a left click or a scroll up detected above it, the -next layout will be loaded; otherwise if a right click or a scroll down is -detected, the previous layout will be loaded. -#+NAME: screen-layout-indicator -#+BEGIN_SRC lua :tangle no -s.layoutbox = awful.widget.layoutbox(s) -s.layoutbox:buttons(gears.table.join( - awful.button({ }, 1, function () awful.layout.inc( 1) end), - awful.button({ }, 3, function () awful.layout.inc(-1) end), - awful.button({ }, 4, function () awful.layout.inc( 1) end), - awful.button({ }, 5, function () awful.layout.inc(-1) end))) -#+END_SRC - -Now it is time to create the widget, a ~wibox~ that will contain our bar. -#+NAME: screen-wibox-widget -#+BEGIN_SRC lua :tangle no -s.wibox = awful.wibar({ position = "top", screen = s }) -#+END_SRC - -Finally, let’s set up our bar. Since it is a horizontal bar, its layout will be -horizontal too. Our launcher, taglist and promptbox will be part of the left -widgets, while the tasklist will be at the center, and the keyboard indicator, -the system tray, the clock and the layout indicator will be on the right. -#+NAME: screen-wibox-setup -#+BEGIN_SRC lua :tangle no -s.wibox:setup { - layout = wibox.layout.align.horizontal, - { -- Left widgets - layout = wibox.layout.fixed.horizontal, - launcher, - s.taglist, - s.promptbox, - }, - s.tasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - keyboardlayout, - wibox.widget.systray(), - textclock, - s.layoutbox, - }, -} -#+END_SRC - -In the end, our code looks like this: -#+BEGIN_SRC lua -awful.screen.connect_for_each_screen(function(s) - <> - <> - <> - <> - <> - <> - <> - <> -end) -#+END_SRC - -* Mouse bindings -:PROPERTIES: -:CUSTOM_ID: Mouse_bindings-eb4a69a8 -:END: -It is possible with Awesome to bind some shortcuts to mouse events when the -mouse is above Awesome itself (not above some client). Only one is set: the -right click opens the Awesome menu. -#+BEGIN_SRC lua -root.buttons(gears.table.join( - awful.button({}, 3, function() mainmenu:toggle() end) -)) -#+END_SRC - -I will also set three mouse bindings for when the mouse is above a client: -- A simple click on a client will focus and raise it. -- A click on a client combined with a modkey press will allow the user to move a - client after focusing it and making it floating. -- A middle click on a client combined with a modkey press will toggle the - floating status of the client. -- A right click combined with the modkey will allow the user to resize a after - focusing it and making it a floating client. - -#+BEGIN_SRC lua -clientbuttons = gears.table.join( - awful.button({ }, 1, function (c) - c:emit_signal("request::activate", "mouse_click", {raise = true}) - end), - awful.button({ modkey }, 1, function (c) - c:emit_signal("request::activate", "mouse_click", {raise = true}) - c.floating = true - awful.mouse.client.move(c) - end), - awful.button({ modkey }, 2, function (c) - awful.client.floating.toggle(c) - end), - awful.button({ modkey }, 3, function (c) - c:emit_signal("request::activate", "mouse_click", {raise = true}) - c.floating = true - awful.mouse.client.resize(c) - end) -) -#+END_SRC - -* Keybindings -:PROPERTIES: -:CUSTOM_ID: Keybindings-a4e415b3 -:END: -Keybindings allow the user to execute some Lua code all across Awesome. They all -bear at least a list of modifier keys, the actual key to be pressed, the action -they keybinding should yield, a description, and a group. The latter two will be -useful for the keybindings help window which will display them all, sorted by -group and with the description displayed next to the keybinding itself. - -Here are some keybindings related to Awesome itself. Most of them will be -described in tables, but due to some limitations from Org-mode (the Emacs mode -used to write this document and generate my Awesome configuration), a few of -them will be directly written as Lua code. - -Here is a description of the tables displayed below: -- Key :: key which toggles the shortcut -- Modifiers :: modifier keys that are required to toggle the shortcut -- Lambda? :: whether or not the ~Action~ should be nested in a lambda function. - Possible values are: - - ~no~ :: The value is a Lua function to be executed as is - - ~yes~ :: The value is to be inserted into a lambda - - ~spawn~ :: The value is to be inserted in an ~awful.spawn~ call in a lambda - - ~shell~ :: The value is to be inserted in an ~awful.spawn.with_shell~ call - in a lambda -- Action :: code to be executed by the shortcut -- What it does :: short description of the shortcut’s action -- Group :: group in which the shortcut will appear in Awesome’s help window -- Clientkey? :: whether this should be a global shortcut or a shortcut only - aimed at clients (value is ~yes~ or ~no~) - -#+NAME: gen-sc-text -#+BEGIN_SRC emacs-lisp -(lambda (x) - (let ((key (nth 0 x)) - (modifiers (nth 1 x)) - (lambda-p (pcase (nth 2 x) - ("yes" 'lambda) - ("shell" 'shell) - ("terminal" 'terminal) - ("spawn" 'spawn) - (otherwise nil))) - (action (nth 3 x)) - (description (nth 4 x)) - (group (nth 5 x)) - (clientkey (if (string= (nth 6 x) "yes") "c" ""))) - (format "awful.key({%s},\"%s\",%s,\n\t{description=\"%s\",group=\"%s\"})" - modifiers - key - (if (not lambda-p) - action - (format "function(%s) %s end" clientkey - (pcase lambda-p - ('lambda action) - ('shell - (format "awful.spawn.with_shell(\"%s\")" action)) - ('terminal - (format "awful.spawn(terminal..\" -e %s\")" action)) - ('spawn - (format "awful.spawn(\"%s\")" action))))) - description - group))) -#+END_SRC - -#+NAME: gen-sc-glob -#+BEGIN_SRC emacs-lisp :var table=sc-client -(mapconcat - <> - (seq-filter (lambda (x) - (let ((clientkey-p (nth 6 x))) - (or (not clientkey-p) - (string= "no" clientkey-p)))) - table) - ",\n") -#+END_SRC - -#+NAME: gen-sc-client -#+BEGIN_SRC emacs-lisp :var table=sc-client :cache yes -(mapconcat - <> - (seq-filter (lambda (keybind) - (string= "yes" (nth 6 keybind))) - table) - ",\n") -#+END_SRC - -#+NAME: sc-tag-num-gen -#+BEGIN_SRC emacs-lisp :var input=sc-tag-num :results drawer :wrap src lua -(let (result) - (dotimes (i 10 result) - (let* ((j (+ 1 i))) - (setq result - (cons - (mapconcat - (lambda (line) - (format - "awful.key({%s},\"#%d\",function() %s%d) end, -\t{description=\"%s%d\",group=\"%s\"})" - (nth 1 line) (+ j 9) (nth 2 line) j - (nth 3 line) j (nth 4 line))) - input - ",\n") result)))) - (mapconcat (lambda (x) x) - result - ",\n\n")) -#+END_SRC - -Most of these keybindings are available at root-level of Awesome and will be -declared in the ~globalkeys~ variable, which will be added then to ~root.keys~ -(see [[https://awesomewm.org/doc/api/libraries/root.html#keys]]). -#+BEGIN_SRC lua :cache yes -globalkeys = gears.table.join( - -- Awesome - <>, - -- App - <>, - <>, - <>, - <>, - <>, - -- Client - <>, - -- Layout - <>, - -- Media - <>, - -- Screen - <>, - -- Tags - <>, - -- Misc - <>, - <> -) -root.keys(globalkeys) - -clientkeys = gears.table.join( - -- Client - <> -) -#+END_SRC - -** Applications -:PROPERTIES: -:CUSTOM_ID: Keybindings-Applications-8321c6c9 -:END: -#+NAME: sc-app -| Key | Modifiers | Lambda? | Action | What it does | Group | -|--------+-----------+---------+-----------------------+-------------------+-------| -| Return | modkey | yes | awful.spawn(terminal) | open a terminal | app | -| n | modkey | spawn | nemo | open file manager | app | -| g | modkey | spawn | gimp | open GIMP | app | - -*** Internet apps -:PROPERTIES: -:CUSTOM_ID: Keybindings-Applications-Internet_apps-87e80705 -:END: -#+NAME: sc-app-internet -| Key | Modifiers | Lambda? | Action | What it does | Group | -|-----+----------------+---------+-----------------------------------+--------------------+----------| -| b | modkey | yes | awful.spawn(os.getenv("BROWSER")) | invoke web browser | internet | -| d | control, shift | spawn | lightcord | launch Discord | internet | - -*** Screenshots -:PROPERTIES: -:CUSTOM_ID: Keybindings-Applications-Screenshots-fa63a5a5 -:END: -#+NAME: sc-app-screenshot -| Key | Modifiers | Lambda? | Action | What it does | Group | -|-------+-----------+---------+----------------------------------------------+-----------------------------+------------| -| Print | | spawn | scrot -e 'mv $f ~/Pictures/Screenshots' | Screenshot | screenshot | -| Print | control | spawn | scrot -s -e 'mv $f ~/Pictures/Screenshots' | Screenshot (area selection) | screenshot | -| Print | shift | spawn | scrot -d 3 -e 'mv $f ~/Pictures/Screenshots' | Screenshot (3s delay) | screenshot | - -*** Emacs -:PROPERTIES: -:CUSTOM_ID: Keybindings-Applications-Emacs-95f8f6a4 -:END: -#+NAME: sc-app-emacs -| Key | Modifiers | Lambda? | Action | What it does | Group | -|-----+---------------+---------+-------------------+----------------------+-------| -| e | modkey | spawn | emacsclient -c -n | invoke Spacemacs | emacs | -| e | modkey, shift | spawn | emacs | invoke Vanilla Emacs | emacs | - -*** Rofi -:PROPERTIES: -:CUSTOM_ID: Keybindings-Applications-Rofi-ca998c87 -:END: -#+NAME: sc-app-rofi -| Key | Modifiers | Lambda? | Action | What it does | Group | -|-----+------------------------+---------+------------------------------------------+---------------------------------+-------| -| a | modkey | shell | awiki | find and open an ArchWiki page | rofi | -| d | modkey | spawn | rofi -combi-modi drun,window -show combi | rofi for drun and windows | rofi | -| d | modkey, meta | spawn | rofi -show ssh | rofi for SSH | rofi | -| p | modkey, shift | shell | rofi-pass -t | types password from ~pass~ | rofi | -| p | modkey, control, shift | shell | rofi-pass | copy password from ~pass~ | rofi | -| e | modkey, meta | shell | rofi-emoji | select and copy emoji from list | rofi | -| m | modkey, meta | shell | rofi-mount | volume mounting helper | rofi | -| u | modkey, meta | shell | rofi-umount | volume unmounting helper | rofi | -| w | modkey, control | shell | wacom-setup | set up my wacom tablet | rofi | -| y | modkey | shell | ytplay | play web video in mpv | rofi | -| y | modkey, shift | shell | rofi-ytdl | download video from web | rofi | - -** Awesome -:PROPERTIES: -:CUSTOM_ID: Keybindings-Awesome-7b691e10 -:END: -Here will be declared some shortcuts directly related to Awesome itself. -#+NAME: sc-awesome -| Key | Modifiers | Lambda? | Action | What it does | Group | -|-----+------------------------+---------+---------------------------+-------------------------+---------| -| h | modkey | no | hotkeys_popup.show_help | show help | awesome | -| h | modkey, shift | yes | mainmenu:show() | show main menu | awesome | -| l | modkey | spawn | plock | lock screen | awesome | -| q | modkey, shift | no | awesome.quit | quit awesome | awesome | -| r | modkey, shift, control | no | awesome.restart | reload awesome | awesome | -| w | modkey | no | set_random_pape | set random wallpaper | awesome | -| w | modkey, shift | spawn | select-pape | set wallpaper | awesome | -| x | modkey | no | invoke_lua_execute_prompt | lua execute prompt | awesome | -| F4 | modkey, control | spawn | systemctl hibernate | hibernate computer | awesome | -| F4 | modkey, shift | spawn | systemctl suspend | suspend to RAM computer | awesome | -| F4 | modkey, shift, control | spawn | poweroff | power off computer | awesome | - -** Clients -:PROPERTIES: -:CUSTOM_ID: Keybindings-Clients-f9f96d60 -:END: -These shortcuts are related to clients (aka windows) management. -#+NAME: sc-client -| Key | Modifiers | Lambda? | Action | What it does | Group | Clientkey? | -|-----+------------------------+---------+----------------------------------+-------------------------------+--------+------------| -| c | modkey, meta | yes | awful.placement.centered(c) | center client | client | yes | -| f | modkey | yes | toggle_fullscreen_client(c) | toggle fullscreen | client | yes | -| m | modkey | yes | toggle_maximized(c) | toggle maximized | client | yes | -| m | modkey, shift | yes | toggle_horizontal_maximized(c) | toggle horizontally maximized | client | yes | -| m | modkey, control | yes | toggle_vertical_maximized(c) | toggle vertically maximized | client | yes | -| n | modkey, shift | yes | c.minimized = true | minimize | client | yes | -| n | modkey, control | no | restore_minimized_clients | restore minimized | client | no | -| o | modkey, shift | yes | c:move_to_screen() | move to screen | client | yes | -| q | modkey | yes | c:kill() | close client | client | yes | -| s | modkey | yes | awful.client.focus.byidx(-1) | focus previous client | client | no | -| t | modkey | yes | awful.client.focus.byidx(1) | focus next client | client | no | -| s | modkey, shift | yes | awful.client.swap.byidx(-1) | swap with previous client | client | no | -| t | modkey, shift | yes | awful.client.swap.byidx(1) | swap with next client | client | no | -| m | modkey, shift, control | yes | c:swap(awful.client.getmaster()) | swap with master client | client | yes | -| u | modkey | no | awful.client.urgent.jumpto | jump to urgent client | client | no | -| v | modkey | yes | c.ontop = not c.ontop | toggle keep on top | client | yes | -| f | modkey, control | no | awful.client.floating.toggle | toggle floating | client | yes | -| Tab | modkey | no | client_go_back | go back | client | no | - -** Layout manipulation -:PROPERTIES: -:CUSTOM_ID: Keybindings-Layout_manipulation-648b4581 -:END: -#+NAME: sc-layout -| Key | Modifiers | Lambda? | Action | What it does | Group | -|-------+-----------------+---------+-------------------------------------+-----------------------------------+--------| -| r | modkey | yes | awful.tag.incmwfact(0.05) | increase master width factor | layout | -| c | modkey | yes | awful.tag.incmwfact(-0.05) | decrease master width factor | layout | -| r | modkey, shift | yes | awful.tag.incnmaster(1, nil, true) | increase number of master clients | layout | -| c | modkey, shift | yes | awful.tag.incnmaster(-1, nil, true) | decrease number of master clients | layout | -| r | modkey, control | yes | awful.tag.incncol(1, nil, true) | increase number of colums | layout | -| c | modkey, control | yes | awful.tag.incncol(-1, nil, true) | decrease number of colums | layout | -| space | modkey | yes | awful.layout.inc(1) | next layout | layout | -| space | modkey, meta | yes | awful.layout.inc(-1) | previous layout | layout | - -** Media -:PROPERTIES: -:CUSTOM_ID: Keybindings-Media-f2cc1324 -:END: -#+NAME: sc-media -| Key | Modifiers | Lambda? | Action | What it does | Group | -|----------------------+-----------------+----------+---------------------------------+--------------------------+-------| -| + | modkey, meta | shell | mpc volume +2 | increase mpd volume | media | -| - | modkey, meta | shell | mpc volume -2 | decrease mpd volume | media | -| n | modkey, meta | terminal | ncmpcpp -q | spawn ncmpcpp | media | -| v | modkey, meta | terminal | ncmpcpp -qs visualizer | spawn ncmpcpp visualizer | media | -| XF86AudioLowerVolume | | shell | amixer -q set Master 2%- unmute | lower volume | media | -| Prior | modkey, control | shell | amixer -q set Master 2%- unmute | lower volume | media | -| XF86AudioRaiseVolume | | shell | amixer -q set Master 2%+ unmute | raise volume | media | -| Next | modkey, control | shell | amixer -q set Master 2%+ unmute | lower volume | media | -| XF86AudioMute | | shell | amixer -q set master 1+ toggle | toggle mute audio | media | -| Prior | modkey, control | shell | amixer -q set master 1+ toggle | toggle mute audio | media | -| XF86AudioPrev | | shell | mpc prev | previous mpd track | media | -| XF86AudioLowerVolume | meta | shell | mpc prev | prevous mpd track | media | -| Prior | modkey | shell | mpc prev | previous mpd track | media | -| XF86AudioNext | | shell | mpc next | next mpd track | media | -| XF86AudioRaiseVolume | meta | shell | mpc next | next mpd track | media | -| Next | modkey | shell | mpc next | next mpd track | media | -| XF86AudioPlay | | shell | mpc toggle | toggle mpd playback | media | -| p | modkey | shell | mpc toggle | toggle mpd playback | media | -| XF86AudioStop | | shell | mpc stop | stop playback | media | -| XF86AudioPlay | meta | shell | mpc stop | stop playback | media | -| p | modkey, meta | shell | mpc stop | stop playback | media | - -** Screen -:PROPERTIES: -:CUSTOM_ID: Keybindings-Screen-b73991f0 -:END: -#+NAME: sc-screen -| Key | Modifiers | Lambda? | Action | What it does | Group | -|-----------------------+--------------+---------+---------------------------------+----------------------------+--------| -| t | modkey, meta | yes | awful.screen.focus_relative(1) | focus next screen | screen | -| s | modkey, meta | yes | awful.screen.focus_relative(-1) | focus previous screen | screen | -| XF86MonBrightnessDown | | shell | xbacklight -dec 1 | decrease screen brightness | screen | -| Next | modkey, meta | shell | xbacklight -dec 1 | decrease screen brightness | screen | -| XF86MonBrightnessUp | | shell | xbacklight -inc 1 | increase screen brightness | screen | -| Prev | modkey, meta | shell | xbacklight -inc 1 | increase screen brightness | screen | -| F3 | modkey | spawn | arandr | randr graphical frontend | screen | -| o | modkey | yes | awful.screen.focus_relative(1) | focus next screen | screen | - -** Tags -:PROPERTIES: -:CUSTOM_ID: Keybindings-Tags-3424b757 -:END: -#+NAME: sc-tag -| Key | Modifiers | Lambda? | Action | What it does | Group | -|--------+-----------------+---------+---------------------------+--------------+-------| -| Escape | modkey | no | awful.tag.history.restore | go back | tag | -| t | modkey, control | no | awful.tag.viewprev | view prev | tag | -| s | modkey, control | no | awful.tag.viewnext | view next | tag | - -Another set of shortcuts is linked to the number row on the keyboard that allow -the manipulation of the default tags that range from ~1~ to ~10~ (the latter is -displayed as ~0~). Here is what the possible actions are: -#+NAME: sc-tag-num -| Key | Modifiers | Action | What it does | Group | -|--------+------------------------+---------------------------------+--------------------------------+-------| -| Number | modkey | view_tag_n( | view tag # | tag | -| Number | modkey, control | toggle_tag_n( | toggle tag # | tag | -| Number | modkey, shift | move_focused_to_tag_n( | move focused client to tag # | tag | -| Number | modkey, control, shift | toggle_focused_client_to_tag_n( | Toggle focused client on tag # | tag | - -** Misc -:PROPERTIES: -:CUSTOM_ID: Keybindings-Misc-0b45ce02 -:END: -In this category you will find other keybindings that do not fit in other -categories. For now, the only keybinding that is in this category is for -toggling the touchpad’s tapping ability. This is linked to a special script I -wrote [[file:bin.org::#Toggle_touchpad_tapping-23348b00][here]]. -#+NAME: sc-misc -| Key | Modifiers | Lambda? | Action | What it does | Group | -|--------------------+-----------+---------+-----------+-------------------------+-------| -| XF86TouchpadToggle | | shell | tttapping | toggle touchpad tapping | misc | - -* Rules -:PROPERTIES: -:CUSTOM_ID: Rules-c6142cdf -:END: -With ~awful.rules~, users are able to describe some rules for window clients -when the latter spawn, such as their placement, their properties or even execute -a script. A rule can be applied through the ~manage~ signal, and they are all -stored in ~awful.rules.rules~, the global rules table, as follows: -#+BEGIN_SRC lua :tangle no -awful.rules.rules = { - -- Rules here -} -#+END_SRC - -# Block for exporting rules from below -#+BEGIN_SRC lua :exports none -awful.rules.rules = { - <>, - <>, - <>, - <> -} -#+END_SRC - -For more documentation on rules and their syntax, you can read the [[https://awesomewm.org/doc/api/libraries/awful.rules.html][official -documentation]]. - -** Universal rules -:PROPERTIES: -:CUSTOM_ID: Rules-Universal_rules-50aad2ce -:END: -The first rule is a universal rule which will match all clients, as you can see -with its syntax below: -#+BEGIN_SRC lua :tangle no -{ rule = {}, - properties = { - -- List of properties - } -} -#+END_SRC - -Here is the list of properties with their value to apply to all clients, and a -short explanation as to what they do. -#+NAME: rules-universal-properties-table -| Property | Value | What it does | -|---------------+---------------------------------------------------------+-------------------------------------------------------------------------| -| border_width | beautiful.border_width | Set the width of the window’s border | -| border_color | beautiful.border_normal | Set the color of the window’s border | -| focus | awful.client.focus.filter | Set focus on the new window, except filtered out windows | -| raise | true | Set it as raised window | -| keys | clientkeys | Set the client’s shortcuts set in [[*Clients][Shortcuts/Clients]] | -| buttons | clientbuttons | Set the client’s mouse shortcuts from [[#Mouse_bindings-eb4a69a8][Mouse bindings]] | -| screen | awful.screen.preferred | Spawn the client on the main screen | -| placement | awful.placement.no_overlap+awful.placement.no_offscreen | Avoid the client to appear off the screen and overlaping another client | -| round_corners | true | Enable rounded corners for client | - -#+NAME: rules-universal-properties -#+BEGIN_SRC emacs-lisp :tangle no :exports none :var properties=rules-universal-properties-table :cache yes -(mapconcat (lambda (x) - (format "%s = %s" - (car x) - (cadr x))) - properties - ",\n") -#+END_SRC - -#+RESULTS[5ddcb42f901ac56237de5ed102800b588f462100]: rules-universal-properties -: border_width = beautiful.border_width, -: border_color = beautiful.border_normal, -: focus = awful.client.focus.filter, -: raise = true, -: keys = clientkeys, -: buttons = clientbuttons, -: screen = awful.screen.preferred, -: placement = awful.placement.no_overlap+awful.placement.no_offscreen, -: round_corners = true - -This is what my universal rules look like: -#+NAME: rules-universal -#+BEGIN_SRC lua :tangle no - { rule = {}, - properties = { - <> - } - } -#+END_SRC - -** Floating clients -:PROPERTIES: -:CUSTOM_ID: Rules-Floating_clients-49ab582e -:END: -Some clients will be declared by default as floating windows. For this, we will -declare a rule that will match any of the provided conditions: -#+NAME: rules-floating-conditions-table -| Property | Matches | Comment | -|----------+--------------+----------------------------------------------------------------| -| instance | pinentry | Matches any Polkit | -| class | Arandr | Visual frontend for Randr | -| class | Sxiv | Simple X Image Viewer | -| class | Tor Browser | Needs a fixed window size to avoid fingerprinting | -| name | Event Tester | xev | -| role | pop-up | Any pop-up window, such as Chromium’s detached Developer Tools | - -#+NAME: rules-floating-conditions -#+BEGIN_SRC emacs-lisp :exports none :tangle no :var conditions=rules-floating-conditions-table :cache yes -(mapconcat (lambda (x) - (format "%s = { \"%s\" }" (car x) (cadr x))) - conditions - ",\n") -#+END_SRC - -#+RESULTS[1fbe7dc1e85b5170957c9583e39c4cbec9a7d7ca]: rules-floating-conditions -: instance = { "pinentry" }, -: class = { "Arandr" }, -: class = { "Sxiv" }, -: class = { "Tor Browser" }, -: name = { "Event Tester" }, -: role = { "pop-up" } - -If any of these conditions is matched, then the client will be set as floating, -as you can see below: -#+NAME: rules-floating -#+BEGIN_SRC lua :tangle no -{ rule_any = { - <> -}, properties = { floating = true }} -#+END_SRC - -** Titlebars -:PROPERTIES: -:CUSTOM_ID: Rules-Titlebars-b532fdba -:END: -Any normal or dialog client will get a titlebar. This is enabled like so: -#+NAME: rules-titlebars -#+BEGIN_SRC lua :tangle no -{ rule_any = {type = { "normal", "dialog" } - }, properties = { titlebars_enabled = true } -} -#+END_SRC - -** Default tag for clients -:PROPERTIES: -:CUSTOM_ID: Rules-Default_tag_for_clients-6ded2a47 -:END: -With the use of some rules, it is possible to define which client are assigned -to which tag by default. -#+NAME: rules-default-tags-table -| Client Property | Value | Tag | -|-----------------+------------+-----| -| class | Emacs | 2 | -| class | firefox | 3 | -| class | Nemo | 4 | -| class | Gimp* | 5 | -| class | Signal | 8 | -| class | Steam | 9 | -| class | Mattermost | 0 | -| class | discord | 0 | -| class | lightcord | 0 | - -#+NAME: rules-default-tags-generate -#+BEGIN_SRC emacs-lisp :tangle no :exports none :cache yes :var tags=rules-default-tags-table -(mapconcat (lambda (x) - (format "{rule = {%s = \"%s\"}, properties = {screen = 1, tag = \"%d\"} }" - (nth 0 x) (nth 1 x) (nth 2 x))) - tags - ",\n") -#+END_SRC - -#+RESULTS[b1e188e8810460c2f84b6d9cb819430af300d9d0]: rules-default-tags-generate -: {rule = {class = "Emacs"}, properties = {screen = 1, tag = "2"} }, -: {rule = {class = "firefox"}, properties = {screen = 1, tag = "3"} }, -: {rule = {class = "Nemo"}, properties = {screen = 1, tag = "4"} }, -: {rule = {class = "Gimp*"}, properties = {screen = 1, tag = "5"} }, -: {rule = {class = "Signal"}, properties = {screen = 1, tag = "8"} }, -: {rule = {class = "Steam"}, properties = {screen = 1, tag = "9"} }, -: {rule = {class = "Mattermost"}, properties = {screen = 1, tag = "0"} }, -: {rule = {class = "discord"}, properties = {screen = 1, tag = "0"} }, -: {rule = {class = "lightcord"}, properties = {screen = 1, tag = "0"} } - -This is what these rules look like: -#+NAME: rules-default-tags -#+BEGIN_SRC lua :tangle no -<> -#+END_SRC - -* Signals -:PROPERTIES: -:CUSTOM_ID: Signals-e32971d6 -:END: -Signals are a way for Awesome to handle events, such as client creation or -deletion. - -** Client creation -:PROPERTIES: -:CUSTOM_ID: Signals-Client_creation-8048ac12 -:END: -When a new client is created, the ~manage~ signal is emited. When so, the -following snippet ensures this new client is not off the screen, unless its -position was deliberately set by a program or by the user. It will also spawn -the new client where the mouse currently is. -#+BEGIN_SRC lua -client.connect_signal("manage", function (c) - awful.client.movetoscreen(c, mouse.screen) - if awesome.startup - and not c.size_hints.user_position - and not c.size_hints.program_position then - awful.placement.no_offscreen(c) - end -end) -#+END_SRC - -** Titlebar creation -:PROPERTIES: -:CUSTOM_ID: Signals-Titlebar_creation-3b1aaa14 -:END: -It is possible for Awesome to send request signals, such as the request to -create titlebar (generally for new clients). The following snippet handles this -titlebar creation if titlebar creation was set to ~true~ in the [[#Rules-c6142cdf][rules]]. For a -detailed explanation of the code, see below. -#+BEGIN_SRC lua -client.connect_signal("request::titlebars", function(c) - local buttons = gears.table.join( - <>, - <> - ) - <> -end) -#+END_SRC - -The function has two main parts: the creation of the titlebar buttons (mouse -handling on the titlebar), and the creation of the titlebar itself. The creation -of the button is done by creating a local variable ~buttons~ which will be a -table created by the library ~gears~, in which will be buttons created by the -user. -#+BEGIN_SRC lua :tangle no -local buttons = gears.table.join( - -- Buttons declared here -) -#+END_SRC - -You can see a left click will enable the user to raise the window, but also it -will enable the user to move the window (if it is floating of course). -#+NAME: signal-titlebar-button1 -#+BEGIN_SRC lua :tangle no -awful.button({ }, 1, function() - c:emit_signal("request::activate", "titlebar", {raise = true}) - awful.mouse.client.move(c) -end) -#+END_SRC - -A right click on the titlebar will also raise the window, but will instead allow -the user to resize the client. -#+NAME: signal-titlebar-button3 -#+BEGIN_SRC lua :tangle no -awful.button({ }, 3, function() - c:emit_signal("request::activate", "titlebar", {raise = true}) - awful.mouse.client.resize(c) -end) -#+END_SRC - -Next comes the actual creation of the titlebar for the client ~c~. For that, we -call ~awful.titlebar()~, tell it where the titlebar should be relative to the -client and what its setup should be. The full call should look like so: -#+NAME: signal-titlebar-create -#+BEGIN_SRC lua :tangle no -awful.titlebar(c, {position="left", size = 22}) : setup { - <> -} -#+END_SRC - -In the setup, I need to repeat to Awesome the titlebar should be on the left of -the client, and I also tell it the layout alignment of the titlebar will be -vertical, because I like vertial titlebars. I also first send it three tables: -- The top or left elements of the titlebar (here the top) -- The middle elements of the titlebar -- The bottom or right elements of the titlebar (here the bottom) -You can notice in the setup’s code below that I haven’t included anything in the -middle elements, the only elements I am interested in are the top and bottom -elements. In the top elements, I have (top to bottom): -- A close button -- A maximize button -- A minimize button -- And an indication to Awesome these elements should be vertically aligned -To make Awesome happy, I also must indicate that the middle elements are -vertically aligned, and then I can declare my bottom elements: -- A button for toggling client floating -- And again the indication to Awesome these elements should be vertically - aligned -#+NAME: signal-titlebar-setup -#+BEGIN_SRC lua :tangle no -{ -- Top - awful.titlebar.widget.closebutton(c), - awful.titlebar.widget.minimizebutton(c), - awful.titlebar.widget.maximizedbutton(c), - layout = wibox.layout.fixed.vertical() -}, -{ - layout = wibox.layout.fixed.vertical() -}, -- Middle -{ -- Bottom - awful.titlebar.widget.floatingbutton(c), - layout = wibox.layout.fixed.vertical() -}, -layout = wibox.layout.align.vertical, -position = "left" -#+END_SRC - -** Changes of focus -:PROPERTIES: -:CUSTOM_ID: Signals-Changes_of_focus-1b73902c -:END: -The default Awesome configuration enables the following snippet of code that -makes windows hovered by the user’s mouse focused. Just for completeness’ sake, -I included it in this document, but be aware this won’t be tangled into my -configuration file and focus will not follow my mouse. -#+BEGIN_SRC lua :tangle no -client.connect_signal("mouse::enter", function(c) - c:emit_signal("request::activate", "mouse_enter", {raise = false}) -end) -#+END_SRC - -It is also possible to change the color of the borders based on client focus. -While my clients don’t have any border, they do have a titlebar which color -changes based on the client’s focus. This is handled by the following code -snippet: -#+BEGIN_SRC lua -client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) -client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -#+end_SRC - -* Autostart -:PROPERTIES: -:CUSTOM_ID: Autostart-f2cf42fe -:END: -By simply adding a line requesting to spawn a command, it is possible to create -some autolaunch. All of my autolaunched apps are launch through a custom script -which you can [[file:~/org/config/bin.org::#Autostart-a99e99e7][find here]]. The command gets called with -~awful.spawn.with_shell()~, as you can see below. -#+BEGIN_SRC lua -awful.spawn.with_shell("autostart") -#+END_SRC - -* What to do now :noexport: -:PROPERTIES: -:CUSTOM_ID: What_to_do_now-bce61fe1 -:END: -** DONE Error on S-q - CLOSED: [2020-04-12 dim. 15:47] -:PROPERTIES: -:CUSTOM_ID: What_to_do_now-Error_on_S-q-beea9b99 -:END: -~attempt to index a nil value (global 'c')~ - -** TODO Make custom theme -:PROPERTIES: -:CUSTOM_ID: What_to_do_now-Make_custom_theme-5837307e -:END: diff --git a/org/config/Deprecated/i3.org b/org/config/Deprecated/i3.org deleted file mode 100644 index 1c368f8..0000000 --- a/org/config/Deprecated/i3.org +++ /dev/null @@ -1,827 +0,0 @@ -#+TITLE: i3 config -#+setupfile: ../headers -#+OPTIONS: unique-id:t -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+PROPERTY: header-args :noweb yes :exports code :tangle ~/.config/i3/config -#+PROPERTY: header-args:emacs-lisp :exports none :tangle no - -* Presentation -:PROPERTIES: -:CUSTOM_ID: Presentation-9c7a53bf -:END: -#+begin_center -*Before proceeding, be aware that I deprecated this i3 config on August 22nd, 2020, meaning I won’t update it anymore unless I use it again some day in the future. I will keep it on my website though.* -#+end_center - -=i3= is a window manager for GNU/Linux which automatically tiles windows in workspaces. This configuration was ade to automatically handle some tasks such as which software allowed where, autostart, and launching software with shortcuts. - -It is to be noted I am using [[https://github.com/Airblader/i3][Airblader’s fork of i3]], =i3-gaps=. Some configuration will not work with =i3=. - -#+BEGIN_SRC conf :exports none - # -*- mode: conf -*- -#+END_SRC - -* Screenshots -:PROPERTIES: -:CUSTOM_ID: Screenshots-51f1cef3 -:END: -#+CAPTION: Desktop with Neofetch in the terminal -[[./img/neofetch.png.webp]] - -#+CAPTION: Desktop with Emacs opened -[[./img/emacs.png.webp]] - -#+CAPTION: Desktop with Rofi -[[./img/rofi.png.webp]] - -* Variables declaration -:PROPERTIES: -:CUSTOM_ID: Variables_declaration-0ebc9a21 -:END: -** Global -:PROPERTIES: -:CUSTOM_ID: Variables_declaration-Global-1cf1bfe4 -:END: -The first I do is declaring the modifier key and the alt key —I don’t find the names =Mod1= and =Mod4= to be explicit enough. This will map =$mod= to the Super key (or as some people unfortunately call it, the /Windows/ key) and =$alt= to the Alt key. - -Let’s also bind the =$up=, =$down=, =$left= and =$right= variables to respectively the up, down, left, and right arrows on the keyboard. Why bind them to variables? If I ever want to modify the arrow keys to some other keys, like =é=, =a=, =u=, and =i= (the equivalent of =wqsd= on the bépo layout) or =c=, =t=, =s=, and =r= (the equivalent of =hjkl= on the bépo layout), I will just have to modify these four lines. - -I’ll also set the =$term= variable. A lot of shortcuts in my i3 config rely on the terminal emulator itself to launch commands in the terminal, and thus call the terminal itself. If I ever need to move from my current terminal, I will just have to change the name of the executable here. - -#+NAME: variable-table -| variable | value | -|----------+-------| -| $mod | Mod4 | -| $alt | Mod1 | -| $up | Up | -| $down | Down | -| $left | Left | -| $right | Right | -| $term | st | - -#+NAME: variable-sh -| variable | value | -|-------------+--------------------------------------------------------------------------| -| $exiti3 | i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit' | -| $lockscreen | Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89 | -| $rofiexec | rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons | -| $mail | emacsclient -c -e '(mu4e)' -n | -| $ec | emacsclient -c -n | -| $walset | wal -i ~/Pictures/Wallpapers -o wal-set | - -Variables will be set like so. -#+BEGIN_SRC conf :tangle no -set $term st -#+END_SRC - -#+NAME: generate-variables -#+BEGIN_SRC emacs-lisp :var variables=variable-table :cache yes - (mapconcat (lambda (x) (format "set %s %s" (car x) (cadr x))) - variables - "\n") -#+END_SRC - -#+RESULTS[48079cbd7e6dbf2003fe5ae87216bd38f638b6f8]: generate-variables -: set $mod Mod4 -: set $alt Mod1 -: set $up Up -: set $down Down -: set $left Left -: set $right Right -: set $term st - -Finally, some variables hold some long strings for commands I don’t want to have to type multiple times. -#+NAME: generate-variables2 -#+BEGIN_SRC emacs-lisp :var variables=variable-sh :cache yes - (mapconcat (lambda (x) (format "set %s \"%s\"" (car x) (cadr x))) - variables - "\n") -#+END_SRC - -#+RESULTS[c901e3e31c500859661650e86a6b63aef286acbe]: generate-variables2 -: set $exiti3 "i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit'" -: set $lockscreen "Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89" -: set $rofiexec "rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons" -: set $mail "emacsclient -c -e '(mu4e)' -n" -: set $ec "emacsclient -c -n" -: set $walset "wal -i ~/Pictures/Wallpapers -o wal-set" - -Here is the configuration: -#+BEGIN_SRC conf :noweb yes - <> - <> -#+END_SRC - -Now comes the font for the window tiles. Honestly, this setting is useless since we do not see it, but let’s set it anyway. -#+BEGIN_SRC conf - font Fira Sans Book:style=Book:pixelsize=10 -#+END_SRC - -** Floating windows -:PROPERTIES: -:CUSTOM_ID: Variables_declaration-Floating_windows-897d0c3b -:END: -Floating windows are windows that are not tiled with other windows, but rather are free to go anywhere on your screen, with any size. A bit like what you would get with any other non-tiling window manager or desktop environment (though most of them support minimal tiling features). - -Let’s declare our floading modyfier. With floating windows, you can move them around by clicking on the window’s borders; but since we don’t have any with this config, we will have instead to press the floating modifier while clicking on the window (anywhere on the window is fine) to move them around. - -Here is the configuration: -#+BEGIN_SRC conf -floating_modifier $mod -#+END_SRC - -* i3 global settings -:PROPERTIES: -:CUSTOM_ID: i3_global_settings-1b863d93 -:END: -Some settings affect i3 globally, such as its aspect or how it handles the mouse. Hence, here are some settings I set in my configuration. - -** Mouse settings -:PROPERTIES: -:CUSTOM_ID: i3_global_settings-Mouse_settings-4630241d -:END: -First of all, I do not want i3 to warp my mouse each time I change windows; my mouse stays where it is. -#+BEGIN_SRC conf -mouse_warping none -#+END_SRC - -I also to not want the window focus to follow my mouse, because sometimes I will just knock my physical mouse out of the way of my hand, and when I do that the software mouse will most likely end up in another window I do not want to focus. -#+BEGIN_SRC conf - focus_follows_mouse no -#+END_SRC - -** Popup handling -:PROPERTIES: -:CUSTOM_ID: i3_global_settings-Popup_handling-51b6ed8d -:END: -While in fullscreen, some software might generate a popup. In that case, I want to be aware of that, and any popup will make me leave fullscreen in order to be presented with said popup. -#+BEGIN_SRC conf -popup_during_fullscreen leave_fullscreen -#+END_SRC - -** Behavior of workspace changes -:PROPERTIES: -:CUSTOM_ID: i3_global_settings-Behavior_of_workspace_changes-00202985 -:END: -When changing workspace as described below, we often want to go back to the previous workspace we were working on, but we might not remember immediately which one it was, or we might still have our fingers ready to fire the shortcut which made us make the first workspace change. Hence, if we type the same workspace change shortcut, instead of doing nothing it will bring us back to the previous workspace we were on. -#+BEGIN_SRC conf -workspace_auto_back_and_forth yes -#+END_SRC - -** Gaps and window appearance -:PROPERTIES: -:CUSTOM_ID: i3_global_settings-Gaps_and_window_appearance-749e9f7b -:END: -As mentioned in at the beginning of this document, I am using i3-gaps, which brings spacing (gaps) between windows to i3. - -First, I want space around my windows only when there are several containers on the same screen, otherwise they will be maximized. -#+BEGIN_SRC conf - smart_gaps on -#+END_SRC - -I also do not want to see any window border, so I will be turning this setting off. -#+BEGIN_SRC conf - smart_borders on -#+END_SRC - -By the way, the default border is invisible, since it is zero pixels wide. -#+BEGIN_SRC conf -default_border pixel 0 -#+END_SRC - -Then comes the size of these gaps. I made the outer gap negative so the space between my windows and the border of my screens is smaller than the gap between my containers. -#+BEGIN_SRC conf - gaps inner 20 - gaps outer -10 -#+END_SRC - -Some parameters are also available when it comes to the colors i3 uses. Honestly, we won’t see these colors much, so let’s simply keep the default values. -#+BEGIN_SRC conf - set_from_resource $fg i3wm.color7 #f0f0f0 - set_from_resource $bg i3wm.color2 #f0f0f0 - - # class border backgr. text indicator child_border - client.focused $bg $bg $fg $bg $bg - client.focused_inactive $bg $bg $fg $bg $bg - client.unfocused $bg $bg $fg $bg $bg - client.urgent $bg $bg $fg $bg $bg - client.placeholder $bg $bg $fg $bg $bg -#+END_SRC - -* Assigning windows to workspaces -:PROPERTIES: -:CUSTOM_ID: Assigning_windows_to_workspaces-e59f61e5 -:END: -I decided to bind some windows to some workspaces in order to have a better organization of my desktop. -#+NAME: assignment-table -| Application | Class | Workspace | -|-------------+-------------+-----------| -| Emacs | Emacs | 2 | -| Chromium | Chromium | 3 | -| Firefox | firefox | 3 | -| Nemo | Nemo | 4 | -| Wonderdraft | Godot | 5 | -| Gimp | Gimp* | 6 | -| Gnome Boxes | gnome-boxes | 8 | -| Steam | Steam | 9 | -| Discord | discord | 10 | - -The class table is used in the assignment in the i3 config file. For instance, Gimp’s assignment will look like this: -#+BEGIN_SRC conf :tangle no - assign [class="Gimp*"] 6 -#+END_SRC - -#+NAME: generate-workspaces -#+BEGIN_SRC emacs-lisp :var workspaces=assignment-table :cache yes - (mapconcat (lambda (x) (format "assign [class=\"%s\"] %s" (cadr x) (caddr x))) - workspaces - "\n") -#+END_SRC - -#+RESULTS[0995341b013e50227edf78257ab502e46a30bc9a]: generate-workspaces -: assign [class="Emacs"] 2 -: assign [class="Chromium"] 3 -: assign [class="firefox"] 3 -: assign [class="Nemo"] 4 -: assign [class="Godot"] 5 -: assign [class="Gimp*"] 6 -: assign [class="gnome-boxes"] 8 -: assign [class="Steam"] 9 -: assign [class="discord"] 10 - -Here is the configuration: -#+BEGIN_SRC conf :noweb yes -<> -#+END_SRC - -And although this is not specifically assigning a window to a workspace, I also want to have the tenth workspace assigned to a specific output in case I have two screens — and since this is the case when I am using only one computer, Marpa, I will be using some EmacsLisp in order to generate a different configuration file from this org file depending on the name of the machine. -#+NAME: ws10-output-edp1 -#+BEGIN_SRC emacs-lisp - (if (string= system-name "Marpa") - "workspace 10 output eDP-1" - "") -#+END_SRC - -Now I’ll call the above code as a noweb reference that should be executed. -#+BEGIN_SRC conf - <> -#+END_SRC - -* Shortcuts -:PROPERTIES: -:CUSTOM_ID: Shortcuts-9c7074d3 -:END: -I use *A LOT* of shortcuts when it comes to my workflow. Like, all the time. So, expect this chapter to be a bit long, and I’ll try to make it readable still. - -Shortcuts are set like so: -#+BEGIN_SRC conf :tangle no -bindsym shortcut command -#+END_SRC - -#+NAME: generate-shortcuts -#+BEGIN_SRC emacs-lisp :exports none :var table=[] :tangle no - (mapconcat (lambda (x) (format "bindsym %s %s" (car x) (cadr x))) - table - "\n") -#+END_SRC - -** Terminal shortcuts -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Terminal_shortcuts-514ecdbe -:END: -I have a couple of shortcuts which are related to my terminal. For instance, ~$mod+Return~ opens a regular terminal instance while ~$mod+$alt+M~ opens an SSH instance on my Mila host. -#+NAME: terminal-shortcuts -| shortcut | command | What it does | -|-------------------+----------------------+--------------------------------------------------| -| $mod+Return | exec $term | Opens a regular terminal console | -| $mod+$alt+Return | split h;; exec $term | Opens a terminal console below the current one | -| $mod+Shift+Return | split v;; exec $term | Opens a terminal on the right of the current one | -| $mod+$alt+m | exec $term ssh Mila | Opens an SSH instance in my Mila host | -| $mod+$alt+n | exec $term ssh Naro | Opens an SSH instance in my Naro host | -| $mod+Shift+h | exec $term htop | Opens a terminal with ~htop~ | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -** i3 shortcuts -:PROPERTIES: -:CUSTOM_ID: Shortcuts-i3_shortcuts-369039ae -:END: -A couple of shortcuts are dedicated to i3 itself. -#+NAME: i3-sh -| shortcut | command | what it does | -|--------------+---------------------------------+----------------------------------| -| $mod+Shift+c | exec yadm alt && i3-msg reload | Reload the i3 configuration file | -| $mod+Shift+r | exec yadm alt && i3-msg restart | Restart i3 inplace | -| $mod+Shift+e | exec $exiti3 | Quit i3 | - -And although this is not really an i3 shortcut per se, I add here the shortcut for launching pywal, which will set one of my wallpapers as the wallpaper and will generate my system’s color configuration from it. -#+NAME: wal-sh -| shortcut | command | what it does | -|----------+--------------+--------------------------------------------------------------| -| $mod+w | exec $walset | Set a random wallpaper and generates a color profile from it | - -We also have some shortcuts to lock our screen, sleep, hibernate and shut down our computer. -#+NAME: computer-sh -| shortcut | command | what it does | -|---------------+----------------------------+------------------------| -| $mod+l | exec i3lock -fol | Lock the screen | -| $mod+$alt+h | exec "systemctl suspend" | Suspend the computer | -| $mod+Ctrl+h | exec "systemctl hibernate" | Hibernate the computer | -| $mod+Shift+F4 | exec poweroff | Power off the computer | - -Here is the configuration: -#+BEGIN_SRC conf -<> -<> -<> -#+END_SRC - -** Window and workspace management -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-a384b8f8 -:END: -*** Managing how windows will split -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Managing_how_windows_will_split-5a22ae31 -:END: -It is possible to indicate to i3 how windows interact with one another, and especially how they are organized by spawning new windows either to the right or below the current window. -#+NAME: split-win-sh -| shortcuts | command | what it does | -|-----------+---------+--------------------------------------------------------| -| $mod+h | split h | Next window to spawn will spawn below the current one | -| $mod+v | split v | Next window to spawn will spawn beside the current one | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Focus windows -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Focus_windows-69a00ae9 -:END: -To change window focus, you can use one of the following shortcuts: -#+NAME: window-focus-sh -| shortcut | command | what it does | -|-------------+-------------+-------------------------------------------| -| $mod+$left | focus left | Focus the window left of the current one | -| $mod+$down | focus down | Focus the window down of the current one | -| $mod+$up | focus up | Focus the window up of the current one | -| $mod+$right | focus right | Focus the windof right of the current one | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Focus workspaces -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Focus_workspaces-9f4bee74 -:END: -Just like windows, it is also possible to change focus between workspaces, because let’s be honest, most people won’t have ten screens to display all ten workspaces at the same time, and frankly that would be impractical. -#+NAME: ws-focus-sh -| shortcut | window | what it does | -|----------+--------------+-------------------------| -| $mod+1 | workspace 1 | Focus first workspace | -| $mod+2 | workspace 2 | Focus second workspace | -| $mod+3 | workspace 3 | Focus third workspace | -| $mod+4 | workspace 4 | Focus fourth workspace | -| $mod+5 | workspace 5 | Focus fifth workspace | -| $mod+6 | workspace 6 | Focus sixth workspace | -| $mod+7 | workspace 7 | Focus seventh workspace | -| $mod+8 | workspace 8 | Focus eighth workspace | -| $mod+9 | workspace 9 | Focus ninth workspace | -| $mod+0 | workspace 10 | Focus tenth workspace | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Moving windows -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Moving_windows-d8c90ac2 -:END: -To move windows, a couple of shortcuts are available: -#+NAME: window-move-sh -| shortcut | command | what it does | -|-------------------+------------+-------------------------------| -| $mod+Shift+$left | move left | Move the focused window left | -| $mod+Shift+$down | move down | Move the focused window down | -| $mod+Shift+$up | move up | Move the focused window up | -| $mod+Shift+$right | move right | Move the focused window right | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Moving containers -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Moving_containers-b97cf4ae -:END: -To move containers between the available screens, you have the following shortcuts: -#+NAME: containers-move-sh -| shortcut | command | what it does | -|------------------+--------------------------------+------------------------------------------------------------| -| $mod+Ctrl+$left | move container to output left | Moves the container to the screen left of the current one | -| $mod+Ctrl+$down | move container to output down | Moves the container to the screen down of the current one | -| $mod+Ctrl+$up | move container to output up | Moves the container to the screen above the current one | -| $mod+Ctrl+$right | move container to output right | Moves the container to the screen right of the current one | - -You can also send containers to other workspaces by their number. -#+NAME: containers-ws-sh -| shortcut | command | what it does | -|--------------+--------------------------------+--------------------------------------------| -| $mod+Shift+1 | move container to workspace 1 | Move current container to the workspace 1 | -| $mod+Shift+2 | move container to workspace 2 | Move current container to the workspace 2 | -| $mod+Shift+3 | move container to workspace 3 | Move current container to the workspace 3 | -| $mod+Shift+4 | move container to workspace 4 | Move current container to the workspace 4 | -| $mod+Shift+5 | move container to workspace 5 | Move current container to the workspace 5 | -| $mod+Shift+6 | move container to workspace 6 | Move current container to the workspace 6 | -| $mod+Shift+7 | move container to workspace 7 | Move current container to the workspace 7 | -| $mod+Shift+8 | move container to workspace 8 | Move current container to the workspace 8 | -| $mod+Shift+9 | move container to workspace 9 | Move current container to the workspace 9 | -| $mod+Shift+0 | move container to workspace 10 | Move current container to the workspace 10 | - -Here is the configuration: -#+BEGIN_SRC conf -<> -<> -#+END_SRC - -*** Moving workspaces -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Moving_workspaces-a71d7b54 -:END: - -It is also possible to move workspaces. The related shortcuts available are the following: - -#+NAME: workspace-move-sh -| shortcut | command | what it does | -|------------------------+--------------------------------+------------------------------------------------------------| -| $mod+Ctrl+Shift+$left | move workspace to output left | Moves the workspace to the screen left of the current one | -| $mod+Ctrl+Shift+$down | move workspace to output down | Moves the workspace to the screen down of the current one | -| $mod+Ctrl+Shift+$up | move workspace to output up | Moves the workspace to the screen above the current one | -| $mod+Ctrl+Shift+$right | move workspace to output right | Moves the workspace to the screen right of the current one | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Close windows -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Close_windows-5e521a48 -:END: -To close windows, we have two main shortcuts: Alt+F4 and mod+q. The first one is here due to habits, but I don’t really use it anymore due to my main keyboard which doesn’t have any easy access to the functions keys, hence mod+q. -#+NAME: close-win-sh -| shortcut | command | what it does | -|----------+---------+-------------------------| -| $mod+q | kill | kill the current window | -| $alt+F4 | kill | kill the current window | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Manage the size of the current window -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Manage_the_size_of_the_current_window-11afa914 -:END: -It is possible to change the size of the current window, even if it is a floating one. The first shortcut that might interest you is $mod+f which switches your current window to fullscreen. But to resize a window, you will need to enter the ~resize~ mode. -#+NAME: size-win-sh -| shortcut | command | what it does | -|----------+-------------------+---------------------------------------------------| -| $mod+f | fullscreen toggle | Puts the current window in fullscreen or exits it | -| $mod+r | mode "resize" | Enter resize mode | - -When it comes to modes, they are defined as follows: -#+BEGIN_SRC conf :tangle no - mode "nameofyourmode" { - here go your shortcuts - } -#+END_SRC - -So, all the following shortcuts will be inserted in a mode called ~resize~. Note that not only are the resizing shortcuts bound to the arrow keys, they are also bound to ~ctsr~, which is the bépo equivalent of ~hjkl~. -#+NAME: resize-win-sh -| shortcut | command | what it does | -|----------+-------------------------------------+-------------------------------------------| -| $right | resize grow width 20 px or 10 ppt | Increase the width of the current window | -| r | resize grow width 20 px or 10 ppt | Increase the width of the current window | -| $left | resize shrink width 10 px or 5 ppt | Decrease the width of the current window | -| c | resize shrink width 10 px or 5 ppt | Decrease the width of the current window | -| $down | resize grow height 10 px or 5 ppt | Increase the height of the current window | -| t | resize grow height 10 px or 5 ppt | Increase the height of the current window | -| $up | resize shrink height 10 px or 5 ppt | Decrease the height of the current window | -| s | resize shrink height 10 px or 5 ppt | Decrease the height of the current window | -| Return | mode "default" | Return to the default mode | -| Escape | mode "default" | Return to the default mode | -If you prefer, you can think of these shortcuts not as increasing or decreasing the width or height of the current window, but rather as how the bottom or right limit of the windows will be moved relative to the top left corner. - -Here is the configuration: -#+BEGIN_SRC conf - <> - mode "resize" { - <> - } -#+END_SRC - -*** Manage floating windows -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Manage_floating_windows-9206f4da -:END: -As said above, your windows can be floating windows instead of being tiled like they are by default. For this too we have a couple of shortcuts: -#+NAME: float-win-sh -| shortcut | command | what it does | -|------------------+----------------------+------------------------------------------------------| -| $mod+Shift+space | floating toggle | Toggles the window between tiled and floating mode | -| $mod+space | focus mode_toggle | Toggles the focus between tiled and floating windows | -| $mod+Ctrl+c | move position center | Centers the focused floating window | -If you want to move around your floating window, you can do it with your mouse while holding down the floating modifier declared [[#Variables_declaration-Floating_windows-897d0c3b][here]]. - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Scratchpad and window display -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Scratchpad_and_window_display-10d8d1f4 -:END: -You can think of i3’s scratchpad as some sort of extra workspace in which you can hide your windows you are not using, or as if you want to reduce a window to the taskbar of other window managers or desktop environments. You have basically two shortcuts for the scratchpad: one that sends the current window to the scratchpad, and one that cicles through the windows sent to the scratchpad and shows them to you sequencially. If you go through all of them, they will be hidden again. You can get a window out of the scratchpad by tiling it to the current workspace with the shortcut described above. - -You also have the possibility of making a floating window a sticky window. This means not only will it show on all workspaces, it will also be on top of every other window. It can be useful if you have some notes you want to keep an eye on for instance. -#+NAME: scratchpad-sh -| shortcut | command | what it does | -|--------------+-----------------+------------------------------------------------------| -| $mod+Shift+s | move scratchpad | Sends the current window to the scratchpad | -| $mod+s | scratchpad show | Shows and cycles through windows from the scratchpad | -| $mod+Ctrl+s | sticky toggle | Toggles sticky mode on current window | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Gaps management -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Gaps_management-33979213 -:END: -It is possible to dynamically change the gaps between containers if we want to change a bit the appearance of i3. For that, we obviously have some shortcuts. -#+NAME: gaps-resize-sh -| shortcut | command | what it does | -|-------------------+-----------------------------------------------+-----------------------------| -| $mod+g | gaps inner current plus 5 | Increase the inner gap size | -| $mod+Shift+g | gaps inner current minus 5 | Decrease the inner gap size | -| $mod+Ctrl+g | gaps outer current plus 5 | Increase the outer gap size | -| $mod+Ctrl+Shift+g | gaps outer current minus 5 | Decrease the outer gap size | -| $mod+$alt+g | gaps inner all set 20; gaps outer all set -10 | Reset gaps | - -Here is the corresponding configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -** Launching software -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-0e088e69 -:END: -A big part of my i3 shortcuts though are related to launching various software. I’ll try to sort them by category here, but do take a look even at categories which you might not be interested in, they might actually have something useful for you. - -*** Software and command launcher -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Software_and_command_launcher-a3f5863e -:END: -These commands will allow the user to launch applications which provide ~.desktop~ files or user-defined ~.desktop~ files, as well as commands with the help of rofi. -#+NAME: launcher-sh -| shortcut | command | what it does | -|--------------+---------------------------------------+-------------------------------------------------------| -| $mod+Shift+d | exec --no-startup-id j4-dmenu-desktop | Launch a registered application | -| $mod+d | exec --no-startup-id $rofiexec | Launch a terminal command or a registered application | - -Here is the configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Internet software -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Internet_software-a0524cd8 -:END: -I have a couple of Internet-related software I can launch easily. -#+NAME: internet-sh -| shortcut | command | what it does | -|--------------+---------------------+-----------------------------| -| $mod+b | exec firefox | Launch browser | -| $mod+m | exec $mail | Launch Gnus, my mail client | -| Ctrl+Shift+d | exec discord-canary | Launch Discord | - -Hence this configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Screenshots -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Screenshots-41e41c88 -:END: -A couple of shortcuts are available for taking screenshots. -#+NAME: screenshot-sh -| shortcut | command | what it does | -|-------------+-----------------------------------+----------------------------------------------------------| -| Print | exec --no-startup-id scrot | Takes a screenshot of the entire desktop | -| Ctrl+Print | exec --no-startup-id "scrot -s" | Takes a screenshot of a region or the selected window | -| Shift+Print | exec --no-startup-id "scrot -d 3" | takes a screenshot of the desktop three in three seconds | - -This gives us this configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Screen brightness -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Screen_brightness-6855d53f -:END: -Here we have four commands for managing our screen’s brightness (this is useful for laptops, not so much with desktops), and two of them are actually duplicates of the other two in case a laptop doesn’t have dedicated keys or we are using a keyboard which doesn’t provide them. -#+NAME: brightness-sh -| shortcut | command | what it does | -|-----------------------+------------------------+---------------------------------------| -| XF86MonBrightnessUp | exec xbacklight -inc 5 | Increase the brightness of the screen | -| $mod+$alt+Next | exec xbacklight -inc 5 | Increase the brightness of the screen | -| XF86MonBrightnessDown | exec xbacklight -dec 5 | Decrease the brightness of the screen | -| $mod+$alt+Prev | exec xbacklight -dec 5 | Decrease the brightness of the screen | - -This gives us this configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Media control -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Media_control-18ad2815 -:END: -Some shortcuts are dedicated to media control, especially when it comes to controlling music. All of these media control shortcuts will be calls to ~mpc~ which will in turn send commands to ~mpd~, which is the music server I use on my computers. -#+NAME: media-sh -| shortcut | command | what it does | -|---------------------------+--------------------+--------------------------------| -| XF86AudioNext | exec mpc next | Forward to the next track | -| $alt+XF86AudioRaiseVolume | exec mpc next | Forward to the next track | -| $mod+Next | exec mpc next | Forward to the next track | -| XF86AudioPrev | exec mpc prev | Backward to the previous track | -| $alt+XF86AudioLowerVolume | exec mpc prev | Backward to the previous track | -| $mod+Prior | exec mpc prev | Backward to the previous track | -| XF86AudioPlay | exec mpc toggle | Play or pause the music | -| $mod+p | exec mpc toggle | Play or pause the music | -| $mod+$alt+p | exec mpc stop | Completely stop the music | -| XF86AudioStop | exec mpc stop | Completely stop the music | -| $alt+XF86AudioPlay | exec mpc stop | Completely stop the music | -| $mod+$alt+7 | exec mpc volume +5 | Increase the volume from mpd | -| $mod+$alt+8 | exec mpc volume -5 | Decrease the volume from mpd | - -We also have two shortcuts for launching ncmpcpp, my mpd frontend, either with the playlist open by default, or the visualizes open. -#+NAME: ncmpcpp-sh -| shortcut | command | what it does | -|--------------+-----------------------------------+----------------------------------| -| $mod+Shift+n | exec $term ncmpcpp -q | Launch ncmpcpp’s playlist editor | -| $mod+Shift+v | exec $term ncmpcpp -qs visualizer | Launch ncmpcpp’s visualizer | - -We also have more general shortcuts, like how to manipulate the general volume level. -#+NAME: volume-sh -| shortcut | command | what it does | -|----------------------+----------------------------------------+----------------------| -| XF86AudioMute | exec "amixer set Master 1+ toggle" | Mute or unmute audio | -| Ctrl+$mod+Prior | exec "amixer -q set Master 2%+ unmute" | Raise volume | -| XF86AudioRaiseVolume | exec "amixer -q set Master 2%+ unmute" | Raise volume | -| Ctrl+$mod+Next | exec "amixer -q set Master 2%- unmute" | Reduce volume | -| XF86AudioLowerVolume | exec "amixer -q set Master 2%- unmute" | Reduce volume | - -This gives us this configuration: -#+BEGIN_SRC conf -<> -<> -<> -#+END_SRC - -*** Rofi utilities -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Rofi_utilities-b8eb5b95 -:END: -We also have some utilities I’ve written and which are interfaced with rofi. Here are said shortcuts. -#+NAME: rofi-sh -| shortcut | command | what it does | -|-------------------+-----------------------+-----------------------------------------------------------------------| -| $mod+Shift+p | exec rofi-pass --type | Types the selected password available from ~pass~ where the cursor is | -| $mod+Ctrl+Shift+p | exec rofi-pass | Copies in the clipboard the selected password from ~pass~ for 45 sec | -| $mod+Ctrl+m | exec rofi-mount | Volume mounting helper | -| $mod+Ctrl+u | exec rofi-umount | Volume unmounting helper | -| $mod+$alt+e | exec rofi-emoji | Emoji picker, copies it in the clipboard | -| $mod+Ctrl+w | exec wacom-setup | Sets my Wacom Bamboo tablet as being active on the selected screen | -| $mod+Shift+w | exec connect-wifi | Connect to an available WiFi network | - -This gives us the following configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Miscellaneous -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Miscellaneous-7ec80fea -:END: -And last but not least, I have some other shortcuts for various software, some of them which I use quite a lot like the shortcut for launching Emacs. -#+NAME: misc-sh -| shortcut | command | what it does | -|-------------+------------------+---------------------------------| -| $mod+e | exec $ec | Launch Emacs client | -| $mod+n | exec nemo | Launch Nemo (file manager) | -| $mod+$alt+c | exec speedcrunch | Launch Speedcrunch (calculator) | -| $mod+F3 | exec arandr | Launch arandr | - -This gives us the following configuration: -#+BEGIN_SRC conf -<> -#+END_SRC - -*** Screen management -:PROPERTIES: -:CUSTOM_ID: Shortcuts-Launching_software-Screen_management-f9b35bf2 -:END: -Additionally, we have a shortcut for entering presentation mode on the additional screen of the computer; on my main computer, Mila, the additional screen is HDMI-1, while it is VGA1 on my travel laptop. We’ll use some Emacs Lisp to determine on the configuration file export which screens names to use. -#+NAME: hostname-screen-management -#+BEGIN_SRC emacs-lisp - (cond ((string= system-name "Marpa") "bindsym $mod+Ctrl+p xrandr --output HDMI-1 --mode 1024x768 --right-of eDP-1") - ((string= system-name "gampo") "bindsym $mod+Ctrl+p xrandr --output VGA1 --mode 1024x768 --right-of LVDS1")) -#+END_SRC - -Now, we just have to call this Emacs Lisp code as a noweb reference and execute it. -#+BEGIN_SRC conf :noweb yes - <> -#+END_SRC - -* Software autolaunch -:PROPERTIES: -:CUSTOM_ID: Software_autolaunch-ccee82f6 -:END: -When i3 is launched, I want it to also launch some software automatically. Here is what we will launch: -#+NAME: autolaunch -| always execute it? | command | what it is | -|--------------------+-------------------------------------------+----------------------------------------| -| no | /usr/lib/xfce-polkit/xfce-polkit | Launch the XFCE Polkit | -| no | picom --experimental-backends -e 1 | Launch picom | -| no | xss-lock -- lock | Launch power management | -| no | numlockx on | Activate NumLock | -| no | dunst -config ~/.config/dunst/dunstrc | Launch notification manager | -| no | nm-applet | NetworkManager system tray | -| yes | wal -i "$(< "${HOME}/.cache/wal/wal")" | Sets the wallpaper from last session | -| no | xrdb $HOME/.Xresources | Load Xresources files | -| yes | polybar-launch | Launch polybar | -| no | mpc stop | Stop music from mpd | -| no | mpd_discord_richpresence --no-idle --fork | Launch mpd status sharing with Discord | - -#+NAME: generate-autolaunch -#+BEGIN_SRC emacs-lisp :exports none :cache yes :var table=autolaunch - (mapconcat (lambda (x) - (format (concat (if (string= (car x) - "yes") - "exec_always" - "exec") - " --no-startup-id %s") - (cadr x))) - table - "\n") -#+END_SRC - -#+RESULTS[283577fe2e66b30c936b7fcf142713d285db8da6]: generate-autolaunch -#+begin_example -exec_always --no-startup-id wal -i "$(< "${HOME}/.cache/wal/wal")" -exec --no-startup-id xss-lock -- i3lock -fol -exec --no-startup-id dunst -config ~/.config/dunst/dunstrc -exec --no-startup-id xrdb $HOME/.Xresources -exec --no-startup-id compton -F --opengl --config ~/.config/compton.conf -e 1 -exec_always --no-startup-id polybar-launch -exec_always --no-startup-id enable_touch -exec --no-startup-id syndaemon -i 1.0 -t -k -exec --no-startup-id mpc stop -exec --no-startup-id mpd_discord_richpresence --no-idle --fork -exec --no-startup-id nm-applet -exec --no-startup-id numlockx on -#+end_example - -My travel laptop has a fingerprint reader which can be used as an authentification method when the root password is asked. Let’s launch our policy kit manager if that is the case: -#+NAME: fingerprint-thinkpad -#+BEGIN_SRC emacs-lisp - (if (string= system-name "gampo") - "exec --no-startup-id /usr/lib/mate-polkit/polkit-mate-authentication-agent-1" - "") -#+END_SRC - -#+BEGIN_SRC conf - <> - <> -#+END_SRC diff --git a/org/config/Deprecated/img/emacs.png b/org/config/Deprecated/img/emacs.png deleted file mode 100644 index 9ba0d05..0000000 Binary files a/org/config/Deprecated/img/emacs.png and /dev/null differ diff --git a/org/config/Deprecated/img/emacs.png.webp b/org/config/Deprecated/img/emacs.png.webp deleted file mode 100644 index c928aee..0000000 Binary files a/org/config/Deprecated/img/emacs.png.webp and /dev/null differ diff --git a/org/config/Deprecated/img/neofetch.png b/org/config/Deprecated/img/neofetch.png deleted file mode 100644 index 5fadf64..0000000 Binary files a/org/config/Deprecated/img/neofetch.png and /dev/null differ diff --git a/org/config/Deprecated/img/neofetch.png.webp b/org/config/Deprecated/img/neofetch.png.webp deleted file mode 100644 index 0e41313..0000000 Binary files a/org/config/Deprecated/img/neofetch.png.webp and /dev/null differ diff --git a/org/config/Deprecated/img/rofi.png b/org/config/Deprecated/img/rofi.png deleted file mode 100644 index d5d9066..0000000 Binary files a/org/config/Deprecated/img/rofi.png and /dev/null differ diff --git a/org/config/Deprecated/img/rofi.png.webp b/org/config/Deprecated/img/rofi.png.webp deleted file mode 100644 index a59ccd4..0000000 Binary files a/org/config/Deprecated/img/rofi.png.webp and /dev/null differ diff --git a/org/config/Deprecated/nano.org b/org/config/Deprecated/nano.org deleted file mode 100644 index 7231519..0000000 --- a/org/config/Deprecated/nano.org +++ /dev/null @@ -1,117 +0,0 @@ -#+TITLE: Nano configuration -#+setupfile: ../headers -#+OPTIONS: unique-id:t -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+PROPERTY: header-args :tangle ~/.config/nano/nanorc - -* Introduction -:PROPERTIES: -:CUSTOM_ID: Introduction-7e535842 -:END: -#+begin_center -*Before proceeding, be aware that I deprecated this nano config on August 28th, 2020, meaning I won’t update it anymore unless I use it again some day in the future. I will keep it on my website though.* -#+end_center - -I nowadays rarely use Nano as a text editor, since I mainly rely on Emacs for all sorts of tasks, including quick file editing. However, at times, Emacs won’t work or won’t be available, and I therefore need a lightweight, fast and reliable text editor: Nano. And despite Nano being a simple piece of software, it does offer some customization I cannot refuse. Here is how I configured it: - -* Configuration -:PROPERTIES: -:CUSTOM_ID: Configuration-b55668a7 -:END: -When saving a file, create a backup file by adding a tilde (=~=) to the file's name. And make and keep not just one backup file, but make and keep a uniquely numbered one every time a file is saved — when backups are enabled with =set backup= or =--backup= or =-B=. The uniquely numbered files are stored in the directory =~/.cache/nano/backups/=. -#+BEGIN_SRC conf - set backup - set backupdir /home/phundrak/.cache/nano/backups/ -#+END_SRC - -Save a file by default in Unix format. This overrides nano's default behavior of saving a file in the format that it had. (This option has no effect when you also use =set noconvert=.) -#+BEGIN_SRC conf - set unix -#+END_SRC - -** Keys behavior -:PROPERTIES: -:CUSTOM_ID: Configuration-Keys_behavior-c665fa36 -:END: -Make the Home key smarter. When Home is pressed anywhere but at the very beginning of non-whitespace characters on a line, the cursor will jump to that beginning (either forwards or backwards). If the cursor is already at that position, it will jump to the true beginning of the line. -#+BEGIN_SRC conf - set smarthome -#+END_SRC - -** Search -:PROPERTIES: -:CUSTOM_ID: Configuration-Search-6e458076 -:END: -Do case-unsensitive searches by default. -#+BEGIN_SRC conf - unset casesensitive -#+END_SRC - -Do regular-expression searches by default. Regular expressions in =nano= are of the extended type (ERE). -#+BEGIN_SRC conf - set regexp -#+END_SRC - -** Visual settings -:PROPERTIES: -:CUSTOM_ID: Configuration-Visual_settings-9952f2ae -:END: -Use bold instead of reverse video for the title bar, status bar, key combos, function tags, line numbers, and selected text. This can be overridden by setting the options =titlecolor=, =statuscolor=, =keycolor=, =functioncolor=, =numbercolor=, and =selectedcolor=. -#+BEGIN_SRC conf - set boldtext -#+END_SRC - -Enable soft line wrapping for easier viewing of very long lines. -#+BEGIN_SRC conf - set softwrap -#+END_SRC - -When soft line wrapping is enabled, make it wrap lines at blank characters (tabs and spaces) instead of always at the edge of the screen. -#+BEGIN_SRC conf - set atblanks -#+END_SRC - -Display line numbers to the left of the text area. -#+BEGIN_SRC conf - set linenumbers -#+END_SRC - -Constantly display the cursor position in the status bar. This overrides the option =quickblank=. -#+BEGIN_SRC conf - set constantshow -#+END_SRC - -** Whitespace settings -:PROPERTIES: -:CUSTOM_ID: Configuration-Whitespace_settings-8cef9cd7 -:END: -Convert typed tabs to spaces. Sue me. -#+BEGIN_SRC conf - set tabstospaces -#+END_SRC - -Use a tab size of a certain amount of columns. The value of number must be greater than 0. The default value is 8. -#+BEGIN_SRC conf -set tabsize 2 -#+END_SRC - -Automatically indent a newly created line to the same number of tabs and/or spaces as the previous line (or as the next line if the previous line is the beginning of a paragraph). -#+BEGIN_SRC conf - set autoindent -#+END_SRC - -Remove trailing whitespace from wrapped lines when automatic hard-wrapping occurs or when text is justified. -#+BEGIN_SRC conf -set trimblanks -#+END_SRC - -** Included configuration file -:PROPERTIES: -:CUSTOM_ID: Configuration-Included_configuration_file-70b0f35b -:END: -Nano gives the opportunity to include some files located elsewhere. This is why I added [[https://github.com/scopatz/nanorc][this repo]] as a submodule of my dotfiles so I can access a lot of them at the same time. Since the submodule is cloned in =~/.config/nanorc=, we can add only one line to include all of the =.nanorc= files. -#+BEGIN_SRC conf - include ~/.config/nano/nano-syntax/*.nanorc -#+END_SRC diff --git a/org/config/Deprecated/polybar.org b/org/config/Deprecated/polybar.org deleted file mode 100644 index a028fe2..0000000 --- a/org/config/Deprecated/polybar.org +++ /dev/null @@ -1,858 +0,0 @@ -#+TITLE: Polybar config -#+setupfile: ../headers -#+OPTIONS: unique-id:t -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+HTML_HEAD_EXTRA: -#+PROPERTY: header-args :exports none -#+PROPERTY: header-args:emacs-lisp :tangle no :exports none -#+PROPERTY: header-args:conf-windows :tangle ~/.config/polybar/config :noweb yes :exports code :mkdirp yes - -* Presentation -:PROPERTIES: -:CUSTOM_ID: Presentation-4e723f32 -:END: -#+begin_center -*Before proceeding, be aware that I deprecated this polybar config on August 22nd, 2020, meaning I won’t update it anymore unless I use it again some day in the future. I will keep it on my website though.* -#+end_center - -Polybar is a desktop utility for displaying various information in form of bars for GNU/Linux systems. It is often used as a replacement for native bars available in window managers, such as i3. In my case, I use two instances of polybar in order to get two bars displayed on each screen. The information displayed is either related to i3 itself, or it is system information, such as CPU or disk usage. More information will be given and explained below. - -If you want to learn more about how to configure Polybar, you can go to its [[https://github.com/jaagr/polybar][official repository on Github]]. - -#+BEGIN_EXPORT latex -Be aware that this PDF documents suffers from a couple of issues with some characters such as emojis. If you wish to see everything correctly, I would suggest you to take a look at the online HTML version of this document. -#+END_EXPORT - -* General settings -:PROPERTIES: -:CUSTOM_ID: General_settings-e02fb78c -:END: - Some general settings are available for Polybar, and they are declared under - the ~[settings]~ section. - #+BEGIN_SRC conf-windows - [settings] - #+END_SRC - Only one setting is used in this configuration though: the ability to relauch - polybar on a configuration file rewrite. - #+BEGIN_SRC conf-windows - screenchange-reload = true - #+END_SRC - - Some global settings are also available in order to adjust the - ~_NET_WM_STRUT_PARTIAL~ top and bottom values: - #+BEGIN_SRC conf-windows - [global/wm] - margin-top = 32 - margin-bottom = 22 - #+END_SRC - -* Colors declaration for polybar -:PROPERTIES: -:CUSTOM_ID: Colors_declaration_for_polybar-75ee0b65 -:END: -#+BEGIN_SRC conf-windows :exports none - ; -*- mode: conf-windows -*- -#+END_SRC -Like most status bars available, we can declare custom colors to be used in polybar. This part of the configuration file is declared with the following header: -#+BEGIN_SRC conf-windows - [colors] -#+END_SRC -As I use pywal as a color scheme generator based on the color of my wallpaper, I need to tell polybar to fetch the colors it will use from xrdb. If such color cannot be used, other colors will be used as fallback colors. First, let’s declare our default background and foreground colors with their alternative option. -#+BEGIN_SRC conf-windows - background = ${xrdb:color1:#50000000} - background-alt = ${xrdb:color2:#444} - foreground = ${xrdb:color7:#dfdfdf} - foreground-alt = ${xrdb:color6:#555} -#+END_SRC -Now, we can also declare our primary and secondary colors. -#+BEGIN_SRC conf-windows - primary = #ffb52a - secondary = #e60053 -#+END_SRC -Polybar is also aware of alerts sent by window managers such as i3 when a window opens in an unfocused workspace. For that, let’s declare an alert color. -#+BEGIN_SRC conf-windows - alert = #bd2c40 -#+END_SRC - -* Declaration of the bars -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-a95135a3 -:END: -It is possible in i3 to declare as many bars as we wish, and each of these bars will be named. Naming the bar is done in its module declaration like so: -#+BEGIN_SRC conf-windows :tangle no - [bar/nameofthebar] -#+END_SRC -In my configuration, I use two of such bars, one atop of my screen, and one at the bottom. - -** Top bar declaration -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Top_bar_declaration-fc0cd977 -:END: -As unimaginative as it might seem, I went for a rather explicit name for my bars. The top one is simply named ~top~, as shown below. -#+BEGIN_SRC conf-windows -[bar/top] -#+END_SRC - -*** Positioning -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Top_bar_declaration-Positioning-2505760c -:END: -We need to set on which screen the bar is to be displayed. Indeed, it is possible to display a bar on only one specific screen if we wish to. Actually, it is even the default behavior of polybar, but as we will see later with the launching script, it is possible to launch bars on multiple outputs at the same time. Here, we simply get the value of the variable ~monitor~ from the launch environment. -#+NAME: monitor-bar -#+BEGIN_SRC conf-windows -monitor = ${env:MONITOR} -#+END_SRC -We have a few position-related variables that need to be set. We can specify whether or not we want our bar at the bottom of the screen —which is the default behavior of polybar—, its width, its height, the radius for the rounding of its corners and whether the bar should be centered or not. In my case, my bars are rather small height-wise, and it occupies most of the width of my screens. There is some gaps between this bar and the border of the screen, but this is due to a border around the bar itself which acts not only on the width of the bar itself, but also on its height. -#+BEGIN_SRC conf-windows - bottom = false - border-size = 5 - <> -#+END_SRC -#+NAME: position-bar-top -#+BEGIN_SRC conf-windows :exports none :tangle no - width = 100% - height = 22 - radius = 10.0 - fixed-center = true -#+END_SRC -We also want to add some padding to our bar so our modules are not too close to its edges, especially due to the rounding of the top bar. -#+NAME: padding-bar -#+BEGIN_SRC conf-windows - padding-left = 2 - padding-right = 4 -#+END_SRC -Each module will have some padding around it, so that modules aren’t glued together and instead have some room to breathe. The padding on the left is a bit less than the padding on the right for aesthetic reasons. -#+NAME: module-margin-bar -#+BEGIN_SRC conf-windows - module-margin-left = 1 - module-margin-right = 2 -#+END_SRC -The top bar doesn’t include any system tray, so let’s disable that. -#+BEGIN_SRC conf-windows - tray-position = none -#+END_SRC - -*** Colors and display -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Top_bar_declaration-Colors_and_display-30f12652 -:END: -As explained above, we declared some global variables when it comes to colors, and this is where they will be used. The bar’s background will be of the same color as the main background color declared earlier, and the same goes for the foreground. -#+NAME: bar-colors -#+BEGIN_SRC conf-windows - background = ${colors.background} - foreground = ${colors.foreground} -#+END_SRC - -If we wanted, we could also declare a default color for the underlines under the various modules that will be included in the bar, but in our case this variable is unused. So we will simply add this commented line as a memento this is possible, but it won’t have any effect with this current configuration of polybar. Same goes for the border around the bar, it is a useless variable in this configuration since we want the border to be transparent. -#+NAME: line-border-color -#+BEGIN_SRC conf-windows - line-color = #f00 - ; border-color = #00000000 -#+END_SRC - -Although the variable for the default line color is not used, we still have to set the default width of the underline of our modules. By default, their underline will be three pixels thick. -#+NAME: line-size-bar -#+BEGIN_SRC conf-windows - line-size = 3 -#+END_SRC - -*** Fonts and locale -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Top_bar_declaration-Fonts_and_locale-70a25466 -:END: -Now we can chose which font fill be used in order to display text in this bar, as well as the locale we want. The locale will be useful for displaying information such as date and time, which is a module we will have in this top bar. First, the declaration of the locale is done like so: -#+NAME: locale-bar -#+BEGIN_SRC conf-windows - locale = ja_JP.UTF-8 -#+END_SRC -Now, we can declare the fonts we want to use in Polybar. It is possible to declare several of them, the first one is the one which gets the absolute priority, and the next ones with a larger index are fallback fonts. Font declaration accepts the fontconfig format as well as possible offset[fn:1]. Five fonts are used in my polybar config: -#+NAME: fonts-polybar -| Font | fontconfig | Vertical offset | Why it’s used | -|--------------+----------------------------------------------------+-----------------+-----------------------| -| Fira Sans | Fira Sans Book:style=Book:pixelsize=10 | 1 | Text display | -| IPA Mincho | IPAMincho:style=regular:pixelsize=6 | 0 | Japanese text display | -| Unifont | unifont:fontformat=truetype:size=6:antialias=false | 0 | Fallback font | -| NotoEmoji | NotoEmoji:style=Book:scale=16 | 0 | Emoji display | -| Siji | Siji:pixelsize=8 | 0 | Symbol display | -| Default font | fixed:pixelsize=8 | 0 | Fallback font | -#+NAME: font-ws-config -#+HEADER: :var text="font" -#+BEGIN_SRC emacs-lisp :var table=fonts-polybar[,1:2] :cache yes - (setq counter 0) - (mapconcat (lambda (font) - (setq counter (+ 1 counter)) - (format "%s-%d = %s;%s" - text - (- counter 1) - (nth 0 font) - (nth 1 font))) - table - "\n") -#+END_SRC - -#+RESULTS[53fd99d75f6b08e96288fd2a62b455d7ef8b1754]: font-ws-config -: font-0 = Fira Sans Book:style=Book:pixelsize=10;1 -: font-1 = IPAMincho:style=regular:pixelsize=6;0 -: font-2 = unifont:fontformat=truetype:size=6:antialias=false;0 -: font-3 = NotoEmoji:style=Book:scale=16;0 -: font-4 = Siji:pixelsize=8;0 -: font-5 = fixed:pixelsize=8;0 - -Here’s the font configuration: -#+BEGIN_SRC conf-windows - <> -#+END_SRC -Note that only Fira Sans get a small offset due to the size of the font and the height of the bar itself. - -*** Modules -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Top_bar_declaration-Modules-18979638 -:END: -Finally, arguably one of the most important parts of our bar configuration: the module selection. Modules can be positioned in three different parts of our bar: to the right, in middle or to the left. On the left, we want our workspace indicator for i3. In the middle, we’ll get the title of the focused window, and to the left we’ll have the date and time. -#+NAME: modules-generate -#+BEGIN_SRC emacs-lisp :var table=top-modules :results value :cache yes - (setq right '() - center '() - left '()) - (dolist (module table) - (let* ((module-name (nth 0 module)) - (module-layout (nth 1 module))) - (message "%S" module-layout) - (add-to-list (cond - ((string= "left" module-layout) 'left) - ((string= "center" module-layout) 'center) - (t 'right)) - module-name))) - (concat (concat "modules-left = " - (mapconcat #'identity left " ") - "\n") - (concat "modules-center = " - (mapconcat #'identity center " ") - "\n") - (concat "modules-right = " - (mapconcat #'identity right " ") - "\n")) -#+END_SRC - -#+RESULTS[90b932dc0fd32501e1513f14059b92de09a7b59e]: modules-generate -: modules-left = i3 -: modules-center = xwindow -: modules-right = date - -Here is the list of modules used: -#+NAME: top-modules -| Module name | Position | Brief description | -|-------------+----------+----------------------------| -| i3 | left | i3 workspace indicator | -| xwindow | center | Name of the focused window | -| date | right | Date and time | - -#+BEGIN_SRC conf-windows :cache yes - <> -#+END_SRC - -Each module will be described in details later in this document. - -** Bottom bar declaration -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Bottom_bar_declaration-8504b5ec -:END: -As described above, we will once again have to declare our bar with an equally unimaginative but explicit name. -#+BEGIN_SRC conf-windows - [bar/bottom] -#+END_SRC - -*** Positioning -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Bottom_bar_declaration-Positioning-b1883756 -:END: -The variables are the same as above, but two of them will be slightly modified: -#+BEGIN_SRC conf-windows - bottom = true - border-size = 0 - <> -#+END_SRC - -#+NAME: position-bar-bottom -#+BEGIN_SRC conf-windows :exports none :tangle no - width = 100% - height = 22 - radius = 0.0 - fixed-center = true -#+END_SRC -When it comes to the bottom bar, I prefer to have it fit my outputs, without any margin around it. And of course, I have to declare it as being at the bottom of the screen, hence these modifications. As regards the padding of our modules, their own margins, and the screen output, they aren’t modified. -#+BEGIN_SRC conf-windows - <> - <> - <> -#+END_SRC -However, we do display the system tray on this bottom bar at its right. It has no padding and it is not detached from the bar (this allows the bar to be displayed under the icons of the system tray), and their maximum size was chosen so they are well visible without being too big. -#+BEGIN_SRC conf-windows - tray-position = right - tray-padding = 0 - tray-detached = false - tray-maxsize = 15 -#+END_SRC - -*** Colors and display -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Bottom_bar_declaration-Colors_and_display-854aae82 -:END: -Nothing changes from the top bar, all the variables stay with the same values. See [[#Declaration_of_the_bars-Bottom_bar_declaration-Colors_and_display-854aae82][Colors and display]] of the top bar for more information. -#+BEGIN_SRC conf-windows - <> - <> - <> -#+END_SRC - -*** Fonts and locale -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Bottom_bar_declaration-Fonts_and_locale-67459d62 -:END: -Again, nothing changes from the top bar, so for more info on what’s going on, see [[#Declaration_of_the_bars-Top_bar_declaration-Fonts_and_locale-70a25466][Fonts and locale]] of the top bar. -#+BEGIN_SRC conf-windows - <> - <> -#+END_SRC - -*** Modules -:PROPERTIES: -:CUSTOM_ID: Declaration_of_the_bars-Bottom_bar_declaration-Modules-702b21fc -:END: -Now, we can get to something interesting again: modules. This bar has a lot more modules than the top bar. Here is the list of the modules we have on the bottom bar: -#+NAME: table-modules-bottom -| Module name | Position | Brief description | -|----------------+----------+---------------------------------| -| mpd | left | MPD status indicator | -| filesystem | right | Free storage in our filesystem | -| wlan | right | Name of the active WiFi network | -| eth | right | Local address on Ethernet | -| volume | right | System volume | -| backlight-acpi | right | Screen backlight | -| cpu | right | CPU usage | -| memory | right | RAM usage | -| temperature | right | CPU temperature | -| custom-battery | right | Battery usage | -Here’s the corresponding configuration: -#+ATTR_LATEX: :options breaklines -#+BEGIN_SRC conf-windows - <> -#+END_SRC -All these modules will be explained below. - -As you may have noticed, no modules will be displayed in the middle of this bar. - -* Modules -:PROPERTIES: -:CUSTOM_ID: Modules-2e1a51bc -:END: -Before we begin to describe the different modules, I would like to point out something that will be repeated multiple times if I don’t talk about it right now: for each module, it is possible to declare the foreground and background color of the prefix of the modules, as well as the underline color and the padding of the module. I like these parameters to be rather consistent, so the code block you will see below will often be reused. The colors refer to the colors declared earlier, and the padding is minimal. -#+NAME: mod-prefix-col -#+BEGIN_SRC conf-windows :tangle no - format-prefix-foreground = ${colors.foreground-alt} - format-prefix-underline = ${colors.secondary} - format-underline = ${colors.secondary} - format-padding = 1 -#+END_SRC - -** Hardware -:PROPERTIES: -:CUSTOM_ID: Modules-Hardware-26426ebd -:END: -*** Battery -:PROPERTIES: -:CUSTOM_ID: Modules-Hardware-Battery-299f2e42 -:END: -This module allows the user to get a battery widget among the polybar modules that will also send a notification to the user if the battery level drops below a certain value. This module relies on ~polybar-another-battery~ ([[https://github.com/drdeimos/polybar_another_battery][link]]) and its generated binary ~polybar-ab~ which should be in the ~$PATH~. - -The first line of the module declaration lets the user name the module however they want. In this case, the name is ~custom-battery~. -#+BEGIN_SRC conf-windows - [module/custom-battery] -#+END_SRC -Since it is not a core module, we have to declare it as a custom script so polybar knows what to do with it. -#+BEGIN_SRC conf-windows - type = custom/script -#+END_SRC -We now can specify the script execution, and whether or not the script will be continuously outputting something. In our case, the answer to this last question is yes. -#+BEGIN_SRC conf-windows - exec = polybar-ab -polybar -thr 10 - tail = true -#+END_SRC -The ~-thr 10~ specifies the threshold for polybar-ab at which it should warn the user about the battery level of the computer. - -Of course, users on desktop computers won’t need this module which is aimed at laptop users. Feel free to remove it if you do not need it. - -*** Filesystem -:PROPERTIES: -:CUSTOM_ID: Modules-Hardware-Filesystem-26f0a3c6 -:END: -This module allows to display information about our filesystem, including (and this is what I use this module for) displaying the used space and remaining space on different mount points. This module is an internal module to polybar, so let’s declare it as such: -#+BEGIN_SRC conf-windows - [module/filesystem] - type = internal/fs -#+END_SRC -We can specify how often the filesystem is to be checked with the variable ~interval~. I prefer it not to check it too often in order to not ping too often my drives, but I want it to be often enough so it is somewhat responsive. This is why I settled on a 20 seconds interval. -#+BEGIN_SRC conf-windows - interval = 20 -#+END_SRC -We now have to indicate where our different filesystems are mounted. In the case of my main computer /Marpa/, I have two partitions, the root partition and the home partition. But on my travel laptop, I only have the root partition, hence the usage of the below Elisp code that determines based on the computer it is running whether or not the second mount point to my home partition should be included. -#+NAME: include-home-partition -#+BEGIN_SRC emacs-lisp :tangle no :exports code - (if (string= system-name "Marpa") - "mount-1 = /home") -#+END_SRC - -#+BEGIN_SRC conf-windows - mount-0 = / - <> -#+END_SRC -Now we can set the format of our module. There are two mains formats, one for mounted and one for unmounted mountpoints. For both, we’ll simply use their label. -#+BEGIN_SRC conf-windows - format-mounted = - format-unmounted = -#+END_SRC -When it comes to the mounted partition, we want to display the name of the mountpoint and how used it is, both in terms of gigabytes and percentage. -#+BEGIN_SRC conf-windows - label-mounted = 💽 %mountpoint%: %used%/%total% (%percentage_used%%) - label-mounted-foreground = ${colors.foreground} - label-mounted-underline = ${colors.secondary} -#+END_SRC -If the volume is unmounted (which should be worrying considering the mountpoints chosen), then we’ll simply have a message telling us about that, and the foreground color will use the alternative foreground color described earlier. -#+BEGIN_SRC conf-windows - label-unmounted = %mountpoint% not mounted - label-unmounted-foreground = ${colors.foreground-alt} -#+END_SRC - -*** Xbacklight -:PROPERTIES: -:CUSTOM_ID: Modules-Hardware-Xbacklight-2901c504 -:END: -This module is used in order to display the level of brightness of a screen. It is not used by itself, but rather by other modules, such as [[#Modules-Hardware-ACPI_backlight-9eaeaa79][ACPI backlight]]. First of all, this module is an internal module for xbacklight. It will also display the brightness percentage, prefixed by a sun emoji. Lastly, it will be underlined by a green line. -#+BEGIN_SRC conf-windows - [module/xbacklight] - type = internal/xbacklight - format =