[Org files] Formatted org files to look better with new org config

This commit is contained in:
Lucien Cartier-Tilet 2020-11-13 15:18:43 +01:00
parent e3880c48b1
commit 3a1015b9e7
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
14 changed files with 5326 additions and 6531 deletions

View File

@ -11,36 +11,22 @@
: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.
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.
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~.
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~.
* Loading libraries
:PROPERTIES:
:CUSTOM_ID: Loading_libraries-4df76999
:END:
First of all, some initialization is needed, and this initialization is about
math randomness. So, lets initialize the ~random~ method of the ~math~
library:
First of all, some initialization is needed, and this initialization is about math randomness. So, lets 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.
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
@ -80,18 +66,15 @@
<<imported-libraries()>>
#+END_SRC
I also want to be able to autofocus the first window when I go to another
workspace, so lets require that:
I also want to be able to autofocus the first window when I go to another workspace, so lets require that:
#+BEGIN_SRC lua
require("awful.autofocus")
#+END_SRC
And finally, I want to be able to declare some shortcuts specific to some
appls thanks to the hotkeys help widget.
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, lets initialize the ~random~ method of the ~math~ library:
#+BEGIN_SRC lua
math.randomseed(os.time())
@ -101,8 +84,7 @@
: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.
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,
@ -136,10 +118,7 @@
: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.
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
@ -148,9 +127,7 @@
:PROPERTIES:
:CUSTOM_ID: Variable_definitions-Default_terminal_and_text_editor-44b84e20
:END:
The two following variables are set so that I dont 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.
The two following variables are set so that I dont 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 = "st"
editor = os.getenv("EDITOR") or "emacsclient -c"
@ -160,11 +137,7 @@
: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.
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"
@ -185,9 +158,7 @@
: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. This depends
on [[https://github.com/l3ib/nitrogen/][Nitrogen]].
This function sets a random wallpaper from the directory =~/Pictures/Wallpapers=, see [[file:bin.org::#pape-update-bdecbadf][pape-update]] in my custom scripts. This depends on [[https://github.com/l3ib/nitrogen/][Nitrogen]].
#+BEGIN_SRC lua
local function set_random_pape()
awful.spawn.with_shell("pape-update")
@ -201,8 +172,7 @@
: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:
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")
@ -213,8 +183,7 @@
:PROPERTIES:
:CUSTOM_ID: Custom_functions-Layout_manipulation-6bc7db06
:END:
The following function is used by a shortcut described below in
[[#Keybindings-Clients-f9f96d60]].
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()
@ -333,8 +302,7 @@
: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.
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? |
|-----------------+----------|
@ -390,9 +358,7 @@
: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.
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:
@ -416,9 +382,7 @@
: { "restart", awesome.restart }
: { "quit", function() awesome.quit() end }
It is possible to create actual menus in Awesome, including the one available
at the top-left corner of the screen. First, lets declare a menu related to
Awesome:
It is possible to create actual menus in Awesome, including the one available at the top-left corner of the screen. First, lets declare a menu related to Awesome:
#+NAME: table-awesome-menu
| Name | Command |
|-------------+---------------------------------------------------------------------|
@ -434,8 +398,7 @@
}
#+END_SRC
Next, lets create the main menu that will be used on ~S-w~ and at the top
left of the window:
Next, lets 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 |
|---------------+----------------+------------------------|
@ -449,16 +412,13 @@
}})
#+END_SRC
For now it only has two entries: the Awesome menu and opening a terminal, I
will add some more later probably. Lets specify it as being our main
launcher:
For now it only has two entries: the Awesome menu and opening a terminal, I will add some more later probably. Lets specify it as being our main launcher:
#+BEGIN_SRC lua
launcher = awful.widget.launcher({ image = beautiful.awesome_icon,
menu = mainmenu })
#+END_SRC
Finally, lets declare the menubars terminal for applications that require
it.
Finally, lets declare the menubars terminal for applications that require it.
#+BEGIN_SRC lua
menubar.utils.terminal = terminal
#+END_SRC
@ -481,39 +441,28 @@
: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:
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, lets manage left clicks.
~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, lets 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.
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.
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.
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)
@ -523,8 +472,7 @@
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.
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)
@ -534,10 +482,7 @@
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.
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.viewnext(t.screen) end)
@ -565,17 +510,14 @@
: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:
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.
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)
@ -591,9 +533,7 @@
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.
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()
@ -601,8 +541,7 @@
end)
#+END_SRC
If a scroll up is detected, then lets select the previous client in the
tasklist.
If a scroll up is detected, then lets select the previous client in the tasklist.
#+NAME: task-simple-scroll-up
#+BEGIN_SRC lua :tangle no
awful.button({ }, 4, function ()
@ -610,8 +549,7 @@
end)
#+END_SRC
If a scroll down is detected, then lets select the next client in the
tasklist.
If a scroll down is detected, then lets select the next client in the tasklist.
#+NAME: task-simple-scroll-down
#+BEGIN_SRC lua :tangle no
awful.button({ }, 5, function ()
@ -637,26 +575,19 @@
:PROPERTIES:
:CUSTOM_ID: Theme_and_display-Screen_update-e162a27a
:END:
When a screens 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 wont 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]]! Lets connect this function to the geometry change signal:
When a screens 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 wont 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]]! Lets 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:
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.
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, lets set its wallpaper:
#+NAME: screen-set-pape
@ -664,17 +595,14 @@
set_wallpaper()
#+END_SRC
Next, lets 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
[[#Layouts-be55a7fd][the layouts list described above]].
Next, lets 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, lets 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]]).
Next, lets 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 {
@ -684,10 +612,7 @@
}
#+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 screens current tags thanks
to its filter.
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 screens current tags thanks to its filter.
#+NAME: screen-tasklist-widget
#+BEGIN_SRC lua :tangle no
s.tasklist = awful.widget.tasklist {
@ -703,11 +628,7 @@
s.promptbox = awful.widget.prompt()
#+END_SRC
Then, Lets 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.
Then, Lets 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)
@ -724,11 +645,7 @@
s.wibox = awful.wibar({ position = "top", screen = s })
#+END_SRC
Finally, lets 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.
Finally, lets 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 {
@ -768,9 +685,7 @@
: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.
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)
@ -779,12 +694,9 @@
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.
- 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(
@ -811,34 +723,22 @@
: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.
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 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:
- 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
- ~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 shortcuts action
- Group :: group in which the shortcut will appear in Awesomes help window
- Clientkey? :: whether this should be a global shortcut or a shortcut only
aimed at clients (value is ~yes~ or ~no~)
- 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
@ -932,10 +832,7 @@
",\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]]).
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
@ -1145,9 +1042,7 @@
| 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:
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 |
|--------+------------------------+---------------------------------+--------------------------------+-------|
@ -1160,10 +1055,7 @@
: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 touchpads tapping ability. This is linked to a special script I
wrote [[file:bin.org::#Toggle_touchpad_tapping-23348b00][here]].
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 touchpads 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 |
|--------------------+-----------+---------+-----------+-------------------------+-------|
@ -1173,10 +1065,7 @@
: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:
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
@ -1193,15 +1082,13 @@
}
#+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]].
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:
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 = {
@ -1210,8 +1097,7 @@
}
#+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.
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 |
|---------------+---------------------------------------------------------+-------------------------------------------------------------------------|
@ -1260,8 +1146,7 @@
: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:
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 |
|----------+--------------+----------------------------------------------------------------|
@ -1280,7 +1165,7 @@
",\n")
#+END_SRC
#+RESULTS: rules-floating-conditions
#+RESULTS[1fbe7dc1e85b5170957c9583e39c4cbec9a7d7ca]: rules-floating-conditions
: instance = { "pinentry" },
: class = { "Arandr" },
: class = { "Sxiv" },
@ -1288,8 +1173,7 @@
: 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:
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 = {
@ -1313,8 +1197,7 @@
: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.
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 |
|-----------------+------------+-----|
@ -1354,17 +1237,13 @@
:PROPERTIES:
:CUSTOM_ID: Signals-e32971d6
:END:
Signals are a way for Awesome to handle events, such as client creation or
deletion.
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.
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)
@ -1380,10 +1259,7 @@
: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.
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(
@ -1394,19 +1270,14 @@
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.
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).
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()
@ -1415,8 +1286,7 @@
end)
#+END_SRC
A right click on the titlebar will also raise the window, but will instead
allow the user to resize the client.
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()
@ -1425,9 +1295,7 @@
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:
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"}) : setup {
@ -1435,25 +1303,18 @@
}
#+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:
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 setups code below that I havent 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):
You can notice in the setups code below that I havent 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:
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
- And again the indication to Awesome these elements should be vertically aligned
#+NAME: signal-titlebar-setup
#+BEGIN_SRC lua :tangle no
{ -- Top
@ -1477,20 +1338,14 @@
: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 users mouse focused. Just for completeness
sake, I included it in this document, but be aware this wont be tangled into
my configuration file and focus will not follow my mouse.
The default Awesome configuration enables the following snippet of code that makes windows hovered by the users mouse focused. Just for completeness sake, I included it in this document, but be aware this wont 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 dont have any border, they do have a titlebar which color
changes based on the clients focus. This is handled by the following code
snippet:
It is also possible to change the color of the borders based on client focus. While my clients dont have any border, they do have a titlebar which color changes based on the clients 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)
@ -1500,10 +1355,7 @@
: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.
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
@ -1512,7 +1364,6 @@
:PROPERTIES:
:CUSTOM_ID: What_to_do_now-bce61fe1
:END:
** DONE Error on S-q
CLOSED: [2020-04-12 dim. 15:47]
:PROPERTIES:

View File

@ -11,86 +11,14 @@
:PROPERTIES:
:CUSTOM_ID: Presentation-721f3cc4
:END:
This file will present all the executable scripts I wrote. It is also their
original source code, all the following code snippets are exported and tangled
from this file to the actual executables.
* 4chandl
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/4chandl
:CUSTOM_ID: 4chandl-21ff428f
:END:
Usage: =4chandl [ URL TO THREAD ]=
I made this small script to download the attached files of 4chan threads.
Lets check if any arguments were passed to the executable. If none were
passed, the script should be aborted.
#+BEGIN_SRC fish
if ! count $argv > /dev/null
echo 'No URL specified! Give the URL to thread as the only argument.'
exit 1
end
#+END_SRC
Now, lets store the regex we use to get the link to the attached files.
#+BEGIN_SRC fish
set regex_4cdn '\/\/is2\.4chan\.org\/[a-z]+\/[A-Za-z0-9]+\.[A-Za-z]{3,4}'
#+END_SRC
Well use a thread counter to get a visual indication on how the download is
going.
#+BEGIN_SRC fish
set thread_counter 1
#+END_SRC
Now, we will use each of the arguments passed as a URL to download the files
from.
#+BEGIN_SRC fish
for url in $argv
#+END_SRC
As a visual indicator, lets get the amount of elements we are going to
download from the current thread and print it.
#+BEGIN_SRC fish
set file_total (curl -ks $url | grep -oE $regex_4cdn | uniq | wc -l)
echo total files to download in current thread: $file_total
#+END_SRC
Lets set a file counter so we can visualize the download progress.
#+BEGIN_SRC fish
set file_counter 1
#+END_SRC
Now, lets download each file from the current thread.
#+BEGIN_SRC fish
for image_url in (curl -k -s $url | grep -Eo $regex_4cdn | uniq | sed 's/^/https:/')
echo -n Downloading image $counter of $total...
wget --no-check-certificate -q -nc $image_url
echo ' Done (thread: $thread_counter/thread_total\tfile: $file_counter/file_total)'
set file_counter (math $file_counter + 1)
end
#+END_SRC
Lets increment the thread counter.
#+BEGIN_SRC fish
set thread_counter (math $thread_counter + 1)
#+END_SRC
Lets now close the for loop.
#+BEGIN_SRC fish
end
#+END_SRC
This file will present all the executable scripts I wrote. It is also their original source code, all the following code snippets are exported and tangled from this file to the actual executables.
* Autostart
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/autostart
:CUSTOM_ID: Autostart-a99e99e7
:END:
Because I sometimes switch from window manager to window manager, creating a
script that handles by itself autostarting things for me is way easier than
rewriting every time the autostart part of my configuration. As you can every
instance will be launched asynchronously, and only if there is no other
instance of said command running.
Because I sometimes switch from window manager to window manager, creating a script that handles by itself autostarting things for me is way easier than rewriting every time the autostart part of my configuration. As you can every instance will be launched asynchronously, and only if there is no other instance of said command running.
~set-screens~ is a custom script declared [[*set-screens][below]].
#+NAME: autostart-table
@ -173,20 +101,9 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/awiki
:CUSTOM_ID: awiki-7ac5e1d5
:END:
~awiki~ is a simple script used with ~rofi~ that relies on the
~arch-wiki-docs~ package in order to provide the user a way to quickly find
and display any English page from the Arch Wiki in a browser. The advantage of
using this over the ~wiki-search~ utility from the ~arch-wiki-lite~ package is
you get instant suggestion in rofi using fuzzy-search. The downside is rofi
will only help you find pages by their title, and it will not help you find
keywords in the content of said pages.
~awiki~ is a simple script used with ~rofi~ that relies on the ~arch-wiki-docs~ package in order to provide the user a way to quickly find and display any English page from the Arch Wiki in a browser. The advantage of using this over the ~wiki-search~ utility from the ~arch-wiki-lite~ package is you get instant suggestion in rofi using fuzzy-search. The downside is rofi will only help you find pages by their title, and it will not help you find keywords in the content of said pages.
The first step is to create the list of all the pages that are currently
stored on disk. ~arch-wiki-docs~ stores them in
~/usr/share/doc/arch-wiki/html/en~. A simple ~ls~ piped in three ~sed~ will
give us a list of page titles. We then pipe that into rofi in dmenu mode in
order to choose the page we want to display. By the way, setting the location
of the HTML files will come in handy later.
The first step is to create the list of all the pages that are currently stored on disk. ~arch-wiki-docs~ stores them in ~/usr/share/doc/arch-wiki/html/en~. A simple ~ls~ piped in three ~sed~ will give us a list of page titles. We then pipe that into rofi in dmenu mode in order to choose the page we want to display. By the way, setting the location of the HTML files will come in handy later.
#+BEGIN_SRC fish
set WLOCATION /usr/share/doc/arch-wiki/html/en/
set WPAGE (/bin/ls $WLOCATION | \
@ -194,8 +111,7 @@
rofi -dmenu -p "Arch Wiki" -i | sed 's/ +/_/g')
#+END_SRC
Now, all I need to do is to send this list into rofi and tell it to open the
result with our favorite browser with ~xdg-open~.
Now, all I need to do is to send this list into rofi and tell it to open the result with our favorite browser with ~xdg-open~.
#+BEGIN_SRC fish
xdg-open $WLOCATION$WPAGE.html
#+END_SRC
@ -205,10 +121,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/askpass
:CUSTOM_ID: Askpass-d0d7a8c0
:END:
Askpass is a simple script that invokes ~rofi~ as a way to get from a GUI the
users sudo password. It is inspired by [[https://github.com/ODEX-TOS/tools/blob/master/rofi/askpass][this original tool]], rewritten in fish
and with [[https://wiki.archlinux.org/index.php/Rofi][rofi]] support instead of [[https://wiki.archlinux.org/index.php/Dmenu][dmenu]]. As you can see, this is a oneliner if
we ignore the initial shebang. This executable is pointed at by the
Askpass is a simple script that invokes ~rofi~ as a way to get from a GUI the users sudo password. It is inspired by [[https://github.com/ODEX-TOS/tools/blob/master/rofi/askpass][this original tool]], rewritten in fish and with [[https://wiki.archlinux.org/index.php/Rofi][rofi]] support instead of [[https://wiki.archlinux.org/index.php/Dmenu][dmenu]]. As you can see, this is a oneliner if we ignore the initial shebang. This executable is pointed at by the
#+BEGIN_SRC fish
rofi -dmenu -password -no-fixed-num-lines -p (printf $argv[1] | sed s/://)
#+END_SRC
@ -218,22 +131,17 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/backup
:CUSTOM_ID: Backup-68c7c63e
:END:
~backup~ is a very simple, oneliner script that will create a local copy of a
file and add the date at which it was copied in the filename. You can see its
source code here:
~backup~ is a very simple, oneliner script that will create a local copy of a file and add the date at which it was copied in the filename. You can see its source code here:
#+BEGIN_SRC fish
cp -r $argv[1] $argv[1].bak.(date +"%Y%m%d%H%M%S")
#+END_SRC
* ConnectWifi
* ConnectWifi :noexport:
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/connect-wifi
:CUSTOM_ID: ConnectWifi-16e5e24a
:END:
~connect-wifi~ is a small utility tool that allows the user to connect to
available WiFi networks. The first thing to do is to select the WiFi we want
to connect to. Well use the ~nmcli c s~ command to get the list of the
available networks, and well chose one with ~rofi~.
~connect-wifi~ is a small utility tool that allows the user to connect to available WiFi networks. The first thing to do is to select the WiFi we want to connect to. Well use the ~nmcli c s~ command to get the list of the available networks, and well chose one with ~rofi~.
#+BEGIN_SRC fish
set SELECTEDWIFI (nmcli d w l | \
egrep -o '([0-9A-F]{2}:){5}[0-9A-F]{2}\s*(.*)Infra' | \
@ -259,18 +167,13 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :tangle no
:CUSTOM_ID: Cppnew-964e697b
:END:
=cppnew= is a small utility that helps you create a new C++ project. Several
templates are available, the default one using CMake, and three others that
are a bit more advances, based on:
=cppnew= is a small utility that helps you create a new C++ project. Several templates are available, the default one using CMake, and three others that are a bit more advances, based on:
- CMake + [[https://conan.io/][Conan]]
- [[https://mesonbuild.com/][Meson]] + [[https://ninja-build.org/][Ninja]]
- Meson + Ninja + Conan
There is also a default [[http://doxygen.nl/][Doxygen]] file included for your documentation, ready to
go. I even made it so that you can execute it as an executable file, like
=./doc/Doxyfile= from the project root.
There is also a default [[http://doxygen.nl/][Doxygen]] file included for your documentation, ready to go. I even made it so that you can execute it as an executable file, like =./doc/Doxyfile= from the project root.
The choice is given to the user which of them to use with options that will be
given to =cppnew=.
The choice is given to the user which of them to use with options that will be given to =cppnew=.
First of all, if no arguments were passed, return an error.
#+begin_src fish
@ -279,17 +182,14 @@
end
#+end_src
Now, lets set a couple of variables which will prove useful later on when
trying to set up our project.
Now, lets set a couple of variables which will prove useful later on when trying to set up our project.
* Cnew
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/cnew
:CUSTOM_ID: Cnew-d9ec9cc4
:END:
=cnew= is a small utility script similar to but simpler than cppnew that
creates a CMake template C project from the template that already exists in
[[file:~/dev/templateC][~/dev/templateC]]. If no argument was passed, display an error message and exit.
=cnew= is a small utility script similar to but simpler than cppnew that creates a CMake template C project from the template that already exists in [[file:~/dev/templateC][~/dev/templateC]]. If no argument was passed, display an error message and exit.
#+BEGIN_SRC fish
if ! count $argv > /dev/null
echo "Missing argument: PROJECT" && return -1
@ -301,8 +201,7 @@
switch "$argv[1]"
#+END_SRC
If the argument is =-h= or =--help=, then display the help message and exit
the script normally.
If the argument is =-h= or =--help=, then display the help message and exit the script normally.
#+BEGIN_SRC fish
case -h --help
man ~/dev/fishfunctions/cnew.man
@ -320,15 +219,13 @@
end
#+END_SRC
Now, lets copy the template where the user is executing =cnew= from, give it
the name of the project and move to the project.
Now, lets copy the template where the user is executing =cnew= from, give it the name of the project and move to the project.
#+BEGIN_SRC fish
cp -r ~/dev/templateC $argv[1]
cd $argv[1]
#+END_SRC
The default files have a placeholder for the name of the project. Lets
replace these placeholders with the projects name.
The default files have a placeholder for the name of the project. Lets replace these placeholders with the projects name.
#+BEGIN_SRC fish
sed -i "s/PROJECTNAME/$argv[1]/g" CMakeLists.txt
sed -i "s/PROJECTNAME/$argv[1]/g" README.org
@ -349,23 +246,19 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/dart_language_server
:CUSTOM_ID: Dart_Language_Server-18c256b1
:END:
Spacemacs' recommendations on how to use Dart with LSP is outdated, since
[[https://github.com/natebosch/dart_language_server][=dart_language_server=]] is obsolete. As recommended by the repo owner, we
should launch instead the following code:
Spacemacs' recommendations on how to use Dart with LSP is outdated, since [[https://github.com/natebosch/dart_language_server][=dart_language_server=]] is obsolete. As recommended by the repo owner, we should launch instead the following code:
#+BEGIN_SRC fish
/usr/bin/dart $DART_SDK/snapshots/analysis_server.dart.snapshot --lsp
#+END_SRC
So, instead of using the obsolete executable, instead we will be calling the
analysis server as requested.
So, instead of using the obsolete executable, instead we will be calling the analysis server as requested.
* Dmenu
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/dmenu
:CUSTOM_ID: Dmenu-527edf04
:END:
I wrote this very simple script in order to replace =dmenu= with rofis
emulation of dmenu, since I prefer rofis appearance. It basically calls
rofis dmenu emulation with the arguments initially passed to dmenu.
I wrote this very simple script in order to replace =dmenu= with rofis emulation of dmenu, since I prefer rofis appearance. It basically calls rofis dmenu emulation with the arguments initially passed to dmenu.
#+BEGIN_SRC fish
rofi -dmenu $argv
#+END_SRC
@ -375,8 +268,7 @@
:HEADER-ARGS: :shebang "#!/bin/bash" :mkdirp yes :tangle ~/.local/bin/emacsmail
:CUSTOM_ID: Emacsmail-afffb7cd
:END:
This short script is used in my =~/.local/share/applications/mu4e.desktop=
file in order to send to Emacs any ~mailto:~ requests made in my system.
This short script is used in my =~/.local/share/applications/mu4e.desktop= file in order to send to Emacs any ~mailto:~ requests made in my system.
#+BEGIN_SRC bash
emacsclient -c --eval "(browse-url-mail \"$@\")"
#+END_SRC
@ -386,9 +278,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/rofi-emoji
:CUSTOM_ID: Emoji_picker-a1c374ec
:END:
The emoji picker is a simple fish script that uses rofi and
[[file:~/.config/emoji.txt][~/.config/emoji.txt]] to provide a small, local search for emojis. Once the
emoji is selected, it is copied to the clipboard using =xclipboard=.
The emoji picker is a simple fish script that uses rofi and [[file:~/.config/emoji.txt][~/.config/emoji.txt]] to provide a small, local search for emojis. Once the emoji is selected, it is copied to the clipboard using =xclipboard=.
#+BEGIN_SRC fish
grep -v "#" ~/.config/emoji.txt | rofi -dmenu -p "Select emoji" -i | \
awk '{print $1}' | tr -d '\n' | xclip -selection clipboard
@ -409,8 +299,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/mp42webm
:CUSTOM_ID: mp42webm-aeacca58
:END:
This function allows me to convert easily an mp4 video to the webm format.
Nothing too fancy here.
This function allows me to convert easily an mp4 video to the webm format. Nothing too fancy here.
#+BEGIN_SRC fish
ffmpeg -i $argv[1] -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis $argv[1].webm
#+END_SRC
@ -442,9 +331,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/plock
:CUSTOM_ID: Lock-635fcb38
:END:
~plock~ is a simple script that locks the screen with ~i3lock~ while setting
as the background image of the locked screen a corrupted screenshot of the
screen before it was locked.
~plock~ is a simple script that locks the screen with ~i3lock~ while setting as the background image of the locked screen a corrupted screenshot of the screen before it was locked.
#+BEGIN_SRC fish
set TMPBG /tmp/screen.png
scrot $TMPBG
@ -458,9 +345,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/polybar-launch
:CUSTOM_ID: Polybar-launch-36789edc
:END:
This scripts allows the user to kill polybar and relaunch it, or to simply
launch it if polybar isnt launched yet. First thing to do is kill all polybar
processes.
This scripts allows the user to kill polybar and relaunch it, or to simply launch it if polybar isnt launched yet. First thing to do is kill all polybar processes.
#+BEGIN_SRC bash
killall -q polybar
#+END_SRC
@ -470,9 +355,7 @@
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
#+END_SRC
Now that our system isnt running polybar anymore, well launch it again on
all of our screens. By the way, I have two bars, so Ill have to lauch them
both.
Now that our system isnt running polybar anymore, well launch it again on all of our screens. By the way, I have two bars, so Ill have to lauch them both.
#+BEGIN_SRC bash
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
@ -495,10 +378,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/rofi-mount
:CUSTOM_ID: Rofi-mount-ebbebf68
:END:
=rofimount= is a script inspired by [[https://github.com/ihebchagra/dotfiles/blob/master/.local/bin/dmount][this one]], based on dmenu, which
interactively asks the user what to mount, and where to mount it. What I did
was replace dmenu with rofi, and fix a couple of bugs I encountered in the
original script.
=rofimount= is a script inspired by [[https://github.com/ihebchagra/dotfiles/blob/master/.local/bin/dmount][this one]], based on dmenu, which interactively asks the user what to mount, and where to mount it. What I did was replace dmenu with rofi, and fix a couple of bugs I encountered in the original script.
** Get the mountable elements
:PROPERTIES:
@ -507,22 +387,19 @@
#+BEGIN_SRC fish
begin
#+END_SRC
What the script does first is detect everything that can be mounted. Between
a =begin= and =end=, lets set =LFS= as a local variable. This si in order to
get sane variables in the current block.
What the script does first is detect everything that can be mounted. Between a =begin= and =end=, lets set =LFS= as a local variable. This si in order to get sane variables in the current block.
#+BEGIN_SRC fish
set -l LFS
#+END_SRC
Now, lets detect the amount of mountable Android filesystems, and if any are
detected, lets read them into a global variable.
Now, lets detect the amount of mountable Android filesystems, and if any are detected, lets read them into a global variable.
#+BEGIN_SRC fish
set -l a (math (jmtpfs -l | wc -l) - 2)
test $a -ge 0 && jmtpfs -l 2> /dev/null | tail -n $a | read -zg anddrives
#+END_SRC
Well do the same for external and internal drives and partitions that can be
mounted here.
Well do the same for external and internal drives and partitions that can be mounted here.
#+BEGIN_SRC fish
lsblk -rpo "name,type,size,mountpoint" | \
awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3}' | \
@ -539,10 +416,7 @@
end
#+END_SRC
Alright, well save what kind on drives we can mount in a temporary file
called =/tmp/drives=. Well make sure its blank by erasing it then creating
it again with =touch=, like so. The =-f= flag on =rm= is here so we get no
error if we try to delete a file that doesnt exist (yet).
Alright, well save what kind on drives we can mount in a temporary file called =/tmp/drives=. Well make sure its blank by erasing it then creating it again with =touch=, like so. The =-f= flag on =rm= is here so we get no error if we try to delete a file that doesnt exist (yet).
#+BEGIN_SRC fish
set -g TMPDRIVES /tmp/drives
rm -f $TMPDRIVES
@ -556,8 +430,7 @@
test -n "$anddrives" && echo "Android" >> $TMPDRIVES
#+END_SRC
Now, we want to declare where to look for mount directories. For now, well
only look in =/media=, but you can add more if you wish.
Now, we want to declare where to look for mount directories. For now, well only look in =/media=, but you can add more if you wish.
#+BEGIN_SRC fish
set -g basemount /media
#+END_SRC
@ -566,34 +439,26 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-mount-Get_the_mount_point-6c4bac06
:END:
Now, lets declare a function that will allow us to chose the drive we want
to mount.
Now, lets declare a function that will allow us to chose the drive we want to mount.
#+BEGIN_SRC fish
function getmount
#+END_SRC
First, we want to get our mount point. Well run a =find= command on each of
the directories listed in =$basemount= to look for folders on which our drive
could be mounted. This list will be passed to rofi from which we will chose
our mount point.
First, we want to get our mount point. Well run a =find= command on each of the directories listed in =$basemount= to look for folders on which our drive could be mounted. This list will be passed to rofi from which we will chose our mount point.
#+BEGIN_SRC fish
set -g mp (for d in $basemount
find $d -maxdepth 5 -type d
end | rofi -dmenu -i -p 'Type in mount point.')
#+END_SRC
We should verify that something has been actually selected, otherwise we
should abort the script.
We should verify that something has been actually selected, otherwise we should abort the script.
#+BEGIN_SRC fish
if test -z $mp || test $mp = ""
return 1
end
#+END_SRC
Now, if the selected mount point does not exist, well ask the user whether
the directory should be created. If no, the script will abort. If yes, an
attempt will be made at creating the directory as the user; if that fails, a
new attempt will be made as sudo.
Now, if the selected mount point does not exist, well ask the user whether the directory should be created. If no, the script will abort. If yes, an attempt will be made at creating the directory as the user; if that fails, a new attempt will be made as sudo.
#+BEGIN_SRC fish
if test ! -d $mp
switch (printf "No\\nYes" | rofi -dmenu -i -p "$mp does not exist. Create it?")
@ -614,42 +479,34 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-mount-Mount_a_USB_drive,_hard_drive_or_partition-f5431dbe
:END:
Alright, we want to mount a partition that answers by the name of
=/dev/sdXX=, how do we do that? Lets create first the function =mountusb=
that will take care of it for us.
Alright, we want to mount a partition that answers by the name of =/dev/sdXX=, how do we do that? Lets create first the function =mountusb= that will take care of it for us.
#+BEGIN_SRC fish
function mountusb
#+END_SRC
Now, the first thing we want to do is select the partition we want to mount.
Remember, we stored those in =$usbdrives= earlier, so lets pipe them into
rofi so we can chose from it. Also, =awk= will get their path in =/dev=.
Now, the first thing we want to do is select the partition we want to mount. Remember, we stored those in =$usbdrives= earlier, so lets pipe them into rofi so we can chose from it. Also, =awk= will get their path in =/dev=.
#+BEGIN_SRC fish
set -g chosen (echo $usbdrives | \
rofi -dmenu -i -p "Mount which drive?" | \
awk '{print $1}')
#+END_SRC
As usual after a user selection, lets verify something has actually been
selected. If not, lets abort the script.
As usual after a user selection, lets verify something has actually been selected. If not, lets abort the script.
#+BEGIN_SRC fish
test -z $chosen && return 1
#+END_SRC
Now, lets select the mount point of our partition. Well call the function
=getmount= described in [[#Rofi-mount-Get_the_mount_point-6c4bac06][Get the mount point]] to select it.
Now, lets select the mount point of our partition. Well call the function =getmount= described in [[#Rofi-mount-Get_the_mount_point-6c4bac06][Get the mount point]] to select it.
#+BEGIN_SRC fish
getmount
#+END_SRC
Lets verify the variable =mp= set in =getmount= is not empty, otherwise
abort the script.
Lets verify the variable =mp= set in =getmount= is not empty, otherwise abort the script.
#+BEGIN_SRC fish
test -z $mp && return 1
#+END_SRC
Now, lets mount it! Well use a switch which will detect the filesystem used
so we know how to mount the partition.
Now, lets mount it! Well use a switch which will detect the filesystem used so we know how to mount the partition.
#+BEGIN_SRC fish
switch (lsblk -no "fstype" $chosen)
#+END_SRC
@ -666,21 +523,18 @@
sudo -A mount -t ntfs $chosen $mp -o rw,umask=0000
#+END_SRC
Else, well let =mount= determine which filesystem is used by the partition
(generally =ext4=).
Else, well let =mount= determine which filesystem is used by the partition (generally =ext4=).
#+BEGIN_SRC fish
case '*'
sudo -A mount $chosen $mp
#+END_SRC
Well also run a =chown= on this newly mounted filesystem so the user can
access it without any issues.
Well also run a =chown= on this newly mounted filesystem so the user can access it without any issues.
#+BEGIN_SRC fish
sudo -A chown -R $USER:(id -g $USER) $mp
#+END_SRC
Lets close the switch block and send a notification the partition has been
mounted.
Lets close the switch block and send a notification the partition has been mounted.
#+BEGIN_SRC fish
end && notify-send -a "dmount" "💻 USB mounting" "$chosen mounted to $mp."
#+END_SRC
@ -694,8 +548,7 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-mount-Mount_an_Android_device-5321f9cd
:END:
The function that manages to mount Android filesystems is =mountandroid=.
Lets declare it.
The function that manages to mount Android filesystems is =mountandroid=. Lets declare it.
#+BEGIN_SRC fish
function mountandroid -d "Mount an Android device"
#+END_SRC
@ -705,9 +558,7 @@
set chosen (echo $anddrives | rofi -dmenu -i -p "Which Android device?" | awk '{print $1 $2}' | sed 's/,$//')
#+END_SRC
Now, we need to get the bus of the Android device we want to mount. It will
be useful later, after we authorized mounting from our device, to get the
path to our partition.
Now, we need to get the bus of the Android device we want to mount. It will be useful later, after we authorized mounting from our device, to get the path to our partition.
#+BEGIN_SRC fish
set bus (echo $chosen | sed 's/,.*//')
#+END_SRC
@ -717,24 +568,19 @@
jmtpfs -device=$chosen $mp
#+END_SRC
Now, we need to allow our computer to mount our Android device. Depending on
the Android version it is running on, we either need to specify our device is
USB connected in order to exchange files, or Android will explicitely ask us
if it is OK for our computer to access it. Lets inform the user of that.
Now, we need to allow our computer to mount our Android device. Depending on the Android version it is running on, we either need to specify our device is USB connected in order to exchange files, or Android will explicitely ask us if it is OK for our computer to access it. Lets inform the user of that.
#+BEGIN_SRC fish
echo "OK" | \
rofi -dmenu -i -p "Press (Allow) on your phone screen, or set your USB settings to allow file transfert"
#+END_SRC
Now, lets get the actual path of our Android filesystem we wish to mount,
and lets unmount the previous temporary filesystem.
Now, lets get the actual path of our Android filesystem we wish to mount, and lets unmount the previous temporary filesystem.
#+BEGIN_SRC fish
set newchosen (jmtpfs -l | grep $bus | awk '{print $1 $2}' | sed 's/,$//')
sudo -A umount $mp
#+END_SRC
Now we cam mount the new filesystem and send a notification if everything
went well.
Now we cam mount the new filesystem and send a notification if everything went well.
#+BEGIN_SRC fish
jmtpfs -device=$newchosen $mp && \
notify-send -a "dmount" "🤖 Android Mounting" "Android device mounted to $mp."
@ -749,9 +595,7 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-mount-Mount_a_CD_drive-27278199
:END:
This part is way easier than the previous functions. As we will see, the
function =mountcd='s body is only three lines long. First, lets declare the
function.
This part is way easier than the previous functions. As we will see, the function =mountcd='s body is only three lines long. First, lets declare the function.
#+BEGIN_SRC fish
function mountcd
#+END_SRC
@ -761,8 +605,7 @@
set chosen (echo $cddrives | rofi -dmenu -i -p "Which CD drive?")
#+END_SRC
Well also get the mountpoint thanks to the =getmount= function described
earlier.
Well also get the mountpoint thanks to the =getmount= function described earlier.
#+BEGIN_SRC fish
getmount
#+END_SRC
@ -782,21 +625,17 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-mount-Ask_what_type_of_drive_we_want_to_mount-0c15cffa
:END:
The first thing we will be asked if different types of drives are detected is
which of these types the user wishes to mount. This is done with the function
=asktype= which is declared below.
The first thing we will be asked if different types of drives are detected is which of these types the user wishes to mount. This is done with the function =asktype= which is declared below.
#+BEGIN_SRC fish
function asktype
#+END_SRC
We will use a switch statement which will use our anwser to rofi about what
we wish to mount.
We will use a switch statement which will use our anwser to rofi about what we wish to mount.
#+BEGIN_SRC fish
switch (cat $TMPDRIVES | rofi -dmenu -i -p "Mount which drive?")
#+END_SRC
If we chose the option "USB", well mount a hard drive, partition or USB
drive. In which case well call the =mountusb= function.
If we chose the option "USB", well mount a hard drive, partition or USB drive. In which case well call the =mountusb= function.
#+BEGIN_SRC fish
case "USB"
mountusb
@ -813,8 +652,8 @@
case "CD"
mountcd
#+END_SRC
If nothing is selected, the function will naturally exit. Now, lets close
our switch statement and our function.
If nothing is selected, the function will naturally exit. Now, lets close our switch statement and our function.
#+BEGIN_SRC fish
end
end
@ -824,28 +663,23 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-mount-Launch_the_mounting_functions-218ad001
:END:
Now that we have declared our functions and set our variables, well read the
temporary file described in [[#Rofi-mount-Get_the_mountable_elements-24db7834][Get the mountable elements]]. The amount of lines
is passed in a switch statement.
Now that we have declared our functions and set our variables, well read the temporary file described in [[#Rofi-mount-Get_the_mountable_elements-24db7834][Get the mountable elements]]. The amount of lines is passed in a switch statement.
#+BEGIN_SRC fish
switch (wc -l < $TMPDRIVES)
#+END_SRC
If the file has no lines, i.e. it is empty, we have no mountable media. Lets
inform our user this is the case.
If the file has no lines, i.e. it is empty, we have no mountable media. Lets inform our user this is the case.
#+BEGIN_SRC fish
case 0
notify-send "No USB drive or Android device or CD detected" -a "dmount"
#+END_SRC
If we only have one line, we have only one type of mountable media. Well
pass this line to a second switch statement.
If we only have one line, we have only one type of mountable media. Well pass this line to a second switch statement.
#+BEGIN_SRC fish
case 1
switch (cat $TMPDRIVES)
#+END_SRC
This will allow the script to automatically detect what type of media it is,
and mount the corresponding function.
This will allow the script to automatically detect what type of media it is, and mount the corresponding function.
#+BEGIN_SRC fish
case "USB"
mountusb
@ -859,8 +693,7 @@
end
#+END_SRC
If we have more than one line, well have to ask the user what type of media
they want to mount.
If we have more than one line, well have to ask the user what type of media they want to mount.
#+BEGIN_SRC fish
case '*'
asktype
@ -883,13 +716,9 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/rofi-pass
:CUSTOM_ID: Rofi-pass-8335357f
:END:
=rofi-pass= is a simple utility that gets a password stored in the [[https://www.passwordstore.org/][=pass=]]
password manager with rofi as its interface, and then stores the password in
the clipboard.
=rofi-pass= is a simple utility that gets a password stored in the [[https://www.passwordstore.org/][=pass=]] password manager with rofi as its interface, and then stores the password in the clipboard.
Lets parse all the arguments passed to the script. If one of them is
=--type=, =-t= or =type=, the script will attempt to type the password to the
text area already selected without pasting the password to the clipboard.
Lets parse all the arguments passed to the script. If one of them is =--type=, =-t= or =type=, the script will attempt to type the password to the text area already selected without pasting the password to the clipboard.
#+BEGIN_SRC fish
for arg in $argv
switch $arg
@ -916,16 +745,14 @@
end | rofi -dmenu -i -p "Select your password")
#+END_SRC
Lets verify we actually selected a password and not just exited. If no
password was selected, lets simply exit the script.
Lets verify we actually selected a password and not just exited. If no password was selected, lets simply exit the script.
#+BEGIN_SRC fish
if test -z $password
exit
end
#+END_SRC
Depending on the arguments passed earlier, we might want some different
behavior.
Depending on the arguments passed earlier, we might want some different behavior.
#+BEGIN_SRC fish :noweb yes
if test $TYPE = "yes"
<<rofi-pass-type>>
@ -934,16 +761,13 @@
end
#+END_SRC
The default behavior is to copy the password to the clipboard for 45 seconds,
so lets do that.
The default behavior is to copy the password to the clipboard for 45 seconds, so lets do that.
#+NAME: rofi-pass-copy
#+BEGIN_SRC fish :noweb yes :tangle no
pass show -c $password 2> /dev/null
#+END_SRC
Else, if we passed =--type=, =-t= or =type= as an argument of the script, we
want it to attempt to type our password in the currently selected text input.
Lets do that.
Else, if we passed =--type=, =-t= or =type= as an argument of the script, we want it to attempt to type our password in the currently selected text input. Lets do that.
#+NAME: rofi-pass-type
#+BEGIN_SRC fish :noweb yes :tangle no
set -l IFS
@ -951,8 +775,7 @@
printf %s $pass | xvkbd -file -
#+END_SRC
To correctly get the password from =pass=, we need to parse the output and
only get the first line, hence the following command.
To correctly get the password from ~pass~, we need to parse the output and only get the first line, hence the following command.
#+NAME: rofi-pass-type-get-password
#+BEGIN_SRC fish :tangle no
set pass (pass show $password | string split -n \n)[1]
@ -963,15 +786,13 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/rofi-umount
:CUSTOM_ID: Rofi-umount-ddde1667
:END:
=rofiumount= is the counterpart of =rofimount= for unmounting our mounted
partitions.
~rofiumount~ is the counterpart of ~rofimount~ for unmounting our mounted partitions.
** Get the unmountable drives
:PROPERTIES:
:CUSTOM_ID: Rofi-umount-Get_the_unmountable_drives-89c71040
:END:
First, we will need to list all the drives that can be safely unmounted.
Lets run this.
First, we will need to list all the drives that can be safely unmounted. Lets run this.
#+BEGIN_SRC fish
set -g drives (lsblk -nrpo "name,type,size,mountpoint" | \
awk '$2=="part"&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
@ -998,8 +819,7 @@
touch $undrivefile
#+END_SRC
Depending on if the related variables are set, write the different types of
mounted drives in the temporary file.
Depending on if the related variables are set, write the different types of mounted drives in the temporary file.
#+BEGIN_SRC fish
test -n "$drives" && echo "USB" >> $undrivefile
test -n "$cds" && echo "CD" >> $undrivefile
@ -1010,8 +830,7 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-umount-Unmount_disk_partitions-0d425a47
:END:
The function =unmountusb= will take care of unmounting any drive we can
safely unmount. First, lets declare the function.
The function =unmountusb= will take care of unmounting any drive we can safely unmount. First, lets declare the function.
#+BEGIN_SRC fish
function unmountusb
#+END_SRC
@ -1023,14 +842,12 @@
awk '{print $1}')
#+END_SRC
Lets verify if the user actually selected any drive. If no, lets abort the
script.
Lets verify if the user actually selected any drive. If no, lets abort the script.
#+BEGIN_SRC fish
test -z "$chosen" && exit 0
#+END_SRC
Now, lets unmount the chosen drive and send a notification if it has been
done.
Now, lets unmount the chosen drive and send a notification if it has been done.
#+BEGIN_SRC fish
sudo -A umount $chosen && \
notify-send "💻 USB unmounting" "$chosen unmounted." -a "dumount"
@ -1045,8 +862,7 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-umount-Unmount_Android_device-ae1d5904
:END:
The function =unmountandroid= will take care of unmounting any mounted
Android device. First, lets declare our function.
The function =unmountandroid= will take care of unmounting any mounted Android device. First, lets declare our function.
#+BEGIN_SRC fish
function unmountandroid
#+END_SRC
@ -1061,8 +877,7 @@
test -z "$chosen" && exit 0
#+END_SRC
If a device has been chosen, lets unmount it and send a notification it has
been successfuly unmounted.
If a device has been chosen, lets unmount it and send a notification it has been successfuly unmounted.
#+BEGIN_SRC fish
sudo -A umount -l $chosen && \
notify-send "🤖 Android unmounting" "$chosen unmounted." -a "dumount"
@ -1077,8 +892,7 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-umount-Unmount_CD_drive-369a2f61
:END:
=unmountcd= will take care of unmounting any mounted CD drive. Lets declare
this function.
=unmountcd= will take care of unmounting any mounted CD drive. Lets declare this function.
#+BEGIN_SRC fish
function unmountcd
#+END_SRC
@ -1093,8 +907,7 @@
test -z "$chosen" && exit 0
#+END_SRC
If a drive has been chosen, lets unmount it and send a notification it has
been successfuly unmounted.
If a drive has been chosen, lets unmount it and send a notification it has been successfuly unmounted.
#+BEGIN_SRC fish
sudo -A umount -l $chosen && \
notify-send "💿 CD unmounting" "$chosen unmounted." -a "dumount"
@ -1109,21 +922,17 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-umount-Ask_what_type_of_drive_to_unmount-6287af48
:END:
If several types of unmountable drives are available, lets ask the user
which type to unmount based on the content of the temporary file declared in
[[#Rofi-umount-Get_the_unmountable_drives-89c71040][Get the unmountable drives]]. First, lets declare the function.
If several types of unmountable drives are available, lets ask the user which type to unmount based on the content of the temporary file declared in [[#Rofi-umount-Get_the_unmountable_drives-89c71040][Get the unmountable drives]]. First, lets declare the function.
#+BEGIN_SRC fish
function asktype
#+END_SRC
Lets create a switch statement to which will be passed the selection of the
user from rofi.
Lets create a switch statement to which will be passed the selection of the user from rofi.
#+BEGIN_SRC fish
switch (cat $undrivefile | rofi -dmenu -i -p "Unmount which type of device?")
#+END_SRC
Three types of values can be returned: "USB", "CD", or "Android". These
values will be used to launch their corresponding function.
Three types of values can be returned: "USB", "CD", or "Android". These values will be used to launch their corresponding function.
#+BEGIN_SRC fish
case 'USB'
unmountusb
@ -1147,21 +956,18 @@
:PROPERTIES:
:CUSTOM_ID: Rofi-umount-Launch_the_unmounting_functions-7c48a928
:END:
Now back to the body of our script, lets input in a switch case the number
of lines contained in our temporary file.
Now back to the body of our script, lets input in a switch case the number of lines contained in our temporary file.
#+BEGIN_SRC fish
switch (wc -l < $undrivefile)
#+END_SRC
If the file containes no lines. i.e. it is empty, nothing is to be unmounted.
Lets inform the user of that.
If the file containes no lines. i.e. it is empty, nothing is to be unmounted. Lets inform the user of that.
#+BEGIN_SRC fish
case 0
notify-send "No USB drive or Android device or CD to unmount" -a "dumount"
#+END_SRC
Else, if there is only one type of drive, well automatically let our script
choose based on the content of this sole line.
Else, if there is only one type of drive, well automatically let our script choose based on the content of this sole line.
#+BEGIN_SRC fish
case 1
switch (cat $undrivefile)
@ -1195,22 +1001,13 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/set-screens
:CUSTOM_ID: set-screens-01bd989a
:END:
~set-screens~ is a small script that allows the user to automatically set up
an external monitor. First, lets set some variables so we dont have to type
in hidden places some values that should be easily modifiable.
~set-screens~ is a small script that allows the user to automatically set up an external monitor. First, lets set some variables so we dont have to type in hidden places some values that should be easily modifiable.
#+BEGIN_SRC fish
set internal "eDP1"
set external "HDMI1"
#+END_SRC
Now, lets set the ~DETECTEDSCREEN~ variable with a simple ~grep~. If the
variable turns out to be empty, this means the display was not detected.
However, if its not, then it will be an array with its second value that
holds the maximum resolution the display can handle. It needs to be passed
through ~awk~ in order to get only the resolution itself and not the refresh
rate, but once weve got that, we can set our external monitor as the main
monitor with its maximum resolution. i3 is also restarted in order to properly
display the wallpaper and Polybar on the new screen.
Now, lets set the ~DETECTEDSCREEN~ variable with a simple ~grep~. If the variable turns out to be empty, this means the display was not detected. However, if its not, then it will be an array with its second value that holds the maximum resolution the display can handle. It needs to be passed through ~awk~ in order to get only the resolution itself and not the refresh rate, but once weve got that, we can set our external monitor as the main monitor with its maximum resolution. i3 is also restarted in order to properly display the wallpaper and Polybar on the new screen.
#+BEGIN_SRC fish
set externaldisplay (xrandr -q --current | grep -A 1 -i "$external connected")
if test -n "$externaldisplay"
@ -1224,10 +1021,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/sshbind
:CUSTOM_ID: sshbind-756fabb1
:END:
Something that I did not know for quite some time but that is actually crazy
useful about SSH is its ability to bind locally the port of a remote machine,
and vice versa. The syntax is actually very simple, but I prefer a more
intuitive way of writing it. Its usage is ~sshbind PORT FROMHOST TOHOST~.
Something that I did not know for quite some time but that is actually crazy useful about SSH is its ability to bind locally the port of a remote machine, and vice versa. The syntax is actually very simple, but I prefer a more intuitive way of writing it. Its usage is ~sshbind PORT FROMHOST TOHOST~.
#+BEGIN_SRC fish
ssh -L $argv[1]:$argv[3]:$argv[1] $argv[2] -N
#+END_SRC
@ -1237,8 +1031,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/starwars
:CUSTOM_ID: Starwars-654f8637
:END:
This is a one-liner that allows you to watch Star Wars episode 4 in ASCII art
in your terminal. Here is the code:
This is a one-liner that allows you to watch Star Wars episode 4 in ASCII art in your terminal. Here is the code:
#+BEGIN_SRC fish
telnet towel.blinkenlights.nl
#+END_SRC
@ -1248,16 +1041,9 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/tttapping
:CUSTOM_ID: Toggle_touchpad_tapping-23348b00
:END:
For some reasons, my firmware does not recognize the function key for toggling
the touchpad. Im not going to really complain about it since it lets me
program it like I want. Since I often dont need to completely deactivate the
touchpad, Ill instead toggle whether tapping is enabled or not when pressing
~XF86TouchpadToggle~. And for that, I need this small script that will
actually toggle it, and it will be used in my window manager configuration.
For some reasons, my firmware does not recognize the function key for toggling the touchpad. Im not going to really complain about it since it lets me program it like I want. Since I often dont need to completely deactivate the touchpad, Ill instead toggle whether tapping is enabled or not when pressing ~XF86TouchpadToggle~. And for that, I need this small script that will actually toggle it, and it will be used in my window manager configuration.
First lets declare some variables to make this script more personal. With my
current computer (a Gazelle by System76), the name of my touchpad is the
following:
First lets declare some variables to make this script more personal. With my current computer (a Gazelle by System76), the name of my touchpad is the following:
#+BEGIN_SRC fish
set TPNAME "ELAN0412:00 04F3:3162 Touchpad"
#+END_SRC
@ -1273,8 +1059,7 @@
grep -v "Default" | awk '{print $5}')
#+END_SRC
This will set ~TPSTATUS~ either to ~0~, meaning tapping is disabled, or to
~1~, meaning its enabled. I will consider any other value as being disabled.
This will set ~TPSTATUS~ either to ~0~, meaning tapping is disabled, or to ~1~, meaning its enabled. I will consider any other value as being disabled.
#+BEGIN_SRC fish
test [[ $TPSTATUS = "1" ]] && set NEWTPSTATUS 0 || set NEWTPSTATUS 1
#+END_SRC
@ -1302,8 +1087,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/wacom-setup
:CUSTOM_ID: Wacom_setup-331fb024
:END:
I made a small and quick utility to set up my Wacom tablet so it is only bound
to one screen.
I made a small and quick utility to set up my Wacom tablet so it is only bound to one screen.
** Set our variables
:PROPERTIES:
@ -1314,22 +1098,19 @@
function set_device
#+END_SRC
We need some variables in order to correctly set our tablet. First, lets get
declare what the name of our tablet is, and what the name of its touchpad is.
We need some variables in order to correctly set our tablet. First, lets get declare what the name of our tablet is, and what the name of its touchpad is.
#+BEGIN_SRC fish
set -g DEVICE "Wacom USB Bamboo PAD Pen stylus"
set -g DEVICETOUCH "Wacom USB Bamboo PAD Finger touch"
#+END_SRC
We will also modify two settings: the speed of the cursor on the touchpad,
and the scroll speed. Lets declare the name of these two settings.
We will also modify two settings: the speed of the cursor on the touchpad, and the scroll speed. Lets declare the name of these two settings.
#+BEGIN_SRC fish
set -g WACOMPROPTOUCHSPEED "Device Accel Velocity Scaling"
set -g WACOMPROPSCROLLPSEED "ScrollDistance"
#+END_SRC
To get the correct values for the area it can cover, well need to reset our
tablet.
To get the correct values for the area it can cover, well need to reset our tablet.
#+BEGIN_SRC fish
xsetwacom set "$DEVICE" ResetArea
#+END_SRC
@ -1350,9 +1131,7 @@
:PROPERTIES:
:CUSTOM_ID: Wacom_setup-Select_our_screen-7822c0c3
:END:
This function will allow us to select the screen on which the tablet will be
active. We can also select the option “desktop” so that all screens are
selected. Lets declare our function.
This function will allow us to select the screen on which the tablet will be active. We can also select the option “desktop” so that all screens are selected. Lets declare our function.
#+BEGIN_SRC fish
function set_screen
#+END_SRC
@ -1384,7 +1163,7 @@
echo $LINE | read -g WIDTH HEIGHT
#+END_SRC
If any of our =WIDTH= ou =HEIGHT= it empty, well have to abort the script.
If any of our ~WIDTH~ ou ~HEIGHT~ it empty, well have to abort the script.
#+BEGIN_SRC fish
if test -z $WIDTH || test -z $HEIGHT
exit 1
@ -1400,25 +1179,18 @@
:PROPERTIES:
:CUSTOM_ID: Wacom_setup-Adjust_the_tablet-342acaf3
:END:
This function will take care of adjusting our tablet to our screen. Lets
declare our function.
This function will take care of adjusting our tablet to our screen. Lets declare our function.
#+BEGIN_SRC fish
function adjust_device
#+END_SRC
If our screen is too high or too wide for our tablet, we will have to adjust
the height or width of the area used by the tablet. So lets get the
theoretical new height and width of the area.
If our screen is too high or too wide for our tablet, we will have to adjust the height or width of the area used by the tablet. So lets get the theoretical new height and width of the area.
#+BEGIN_SRC fish
set RATIOAREAY (math ceil \($AREAX \* $HEIGHT \/ $WIDTH\))
set RATIOAREAX (math ceil \($AREAY \* $WIDTH \/ $HEIGHT\))
#+END_SRC
Now, if the current height of the tablets area is greater than the
theoretical new area, it means the current area is too high. Otherwise, it
should be the other way around. Lets set =NEWAREAX= and =NEWAREAY= that will
be used to set the new area for the tablet.
Now, if the current height of the tablets area is greater than the theoretical new area, it means the current area is too high. Otherwise, it should be the other way around. Lets set =NEWAREAX= and =NEWAREAY= that will be used to set the new area for the tablet.
#+BEGIN_SRC fish
if test $AREAY -gt $RATIOAREAY
set -g NEWAREAX $AREAX
@ -1454,8 +1226,7 @@
:PROPERTIES:
:CUSTOM_ID: Wacom_setup-Lauch_the_functions-2ab8b4d9
:END:
Back to the main body of the script, we can now launch the functions
sequencially.
Back to the main body of the script, we can now launch the functions sequencially.
#+BEGIN_SRC fish
set_device
set_screen
@ -1467,10 +1238,7 @@
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/we
:CUSTOM_ID: Weather-4ed00bb0
:END:
A quick and useful script I often use is a ~curl~ request to [[http://v2.wttr.in/][v2.wttr.in]] to get
a weather forecast in the terminal. By default, I want the request to be about
the city I live in, but it is also possible for the script to accept as its
arguments a search inquiry.
A quick and useful script I often use is a ~curl~ request to [[http://v2.wttr.in/][v2.wttr.in]] to get a weather forecast in the terminal. By default, I want the request to be about the city I live in, but it is also possible for the script to accept as its arguments a search inquiry.
#+BEGIN_SRC fish
if count $argv > /dev/null
set -l SEARCH (string join '+' $argv)

View File

@ -1794,7 +1794,6 @@ One of the amazing features of org-mode is its literary programming capacities b
| sass |
| scheme |
| shell |
| swift |
#+NAME: org-babel-languages-gen
#+BEGIN_SRC emacs-lisp :exports none :tangle no :var languages=org-babel-languages-table[,0] :cache yes :results replace
@ -1803,7 +1802,7 @@ One of the amazing features of org-mode is its literary programming capacities b
"\n")
#+END_SRC
#+RESULTS[d8ef67cfac36191c43e0f20b9c0a024cb1e9413e]: org-babel-languages-gen
#+RESULTS[cf8b81f0da6306f8131e34be6d3742248fdb057b]: org-babel-languages-gen
#+begin_example
(C . t)
(dot . t)
@ -1815,7 +1814,6 @@ One of the amazing features of org-mode is its literary programming capacities b
(sass . t)
(scheme . t)
(shell . t)
(swift . t)
#+end_example
The corresponding code is as follows:
@ -2604,7 +2602,6 @@ I also want to always be in ~visual-line-mode~ so Emacs soft-wraps lines that ar
I also want for some non-programming modes to enable a hard-limit in terms of how many characters can fit on one line. The modes that benefit are ~message-mode~, ~org-mode~, ~text-mode~ and ~markdown-mode~.
#+BEGIN_SRC emacs-lisp
(mapc (lambda (x)
(add-hook x 'auto-fill-mode)
(add-hook x 'visual-line-mode))
'(message-mode-hook
text-mode-hook
@ -3005,16 +3002,15 @@ I want to see by default how much battery my computer has, so lets enable it:
:END:
As I will always say, orgmode is an amazing piece of software that deserves particular care and love. That is why I want to give it a unique look and feel compared to the rest of my Emacs configuration, in order to make it feel much more comfortable.
In order to make org-mode even sexier, lets enable ~variable-pitch-mode~ for org-mode so we can get some proportional font:
In order to make org-mode even sexier, lets enable ~variable-pitch-mode~ for org-mode so we can get some proportional font. Ill also remove ~auto-fill-mode~ which seems to stick to Orgmode like hell and I dont know why.
#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook 'variable-pitch-mode)
(add-hook 'org-mode-hook 'visual-line-mode)
(message "coucou")
(remove-hook 'org-mode-hook 'auto-fill-mode)
#+END_SRC
Fonts will play an important part in this, but so will colors and font size. The following code is largely based on the one found [[https://zzamboni.org/post/beautifying-org-mode-in-emacs/][on this blog post]].
#+BEGIN_SRC emacs-lisp
(message "Setting up some beautiful org-mode")
(let* ((font `(:font "Charis SIL"))
(head `(:inherit default :weight bold))
(fixed `(:inherit fixed-pitch :height 0.8)))
@ -3044,7 +3040,6 @@ Fonts will play an important part in this, but so will colors and font size. The
`(org-link ((t (:foreground ,phundrak/nord8 :underline t))))
'(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch) :height 0.8))))
'(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))))
(message "Org-mode is now beautiful")
#+END_SRC
Finally, lets limit the width of images inlined in org buffers to 400px:

View File

@ -11,12 +11,9 @@
:PROPERTIES:
:CUSTOM_ID: Presentation-340195eb
:END:
The file present in =~/.config/fish/config.fish= is the configuration file for
the [[https://fishshell.com/][fish shell]]. It contains custom functions, environment variables and
abbreviations.
The file present in =~/.config/fish/config.fish= is the configuration file for the [[https://fishshell.com/][fish shell]]. It contains custom functions, environment variables and abbreviations.
Just in case, we might need sometimes to declare the fish function
=fish_title= as =true=, so lets do so.
Just in case, we might need sometimes to declare the fish function =fish_title= as =true=, so lets do so.
#+BEGIN_SRC fish
function fish_title
true
@ -27,8 +24,7 @@
:PROPERTIES:
:CUSTOM_ID: Fish_from_within_Emacs-360c0a74
:END:
I sometimes call fish from within emacs, with =M-x ansi-term=. In this case,
the variable =TERM= needs to have the value =eterm-color=.
I sometimes call fish from within emacs, with =M-x ansi-term=. In this case, the variable =TERM= needs to have the value =eterm-color=.
#+BEGIN_SRC fish
if test -n "$EMACS"
set -x TERM eterm-color
@ -39,11 +35,7 @@
:PROPERTIES:
:CUSTOM_ID: Tramp_remote_access-72aedec2
:END:
When accessing from a remote machine our computer from Emacs, tramp needs a
precise shell appearance: a simple =$= followed by a space after which to put
the commands it needs to execute, and nothing else. Due to this, lets
deactivate and redefine some of the functions defining the appearance of
fish.
When accessing from a remote machine our computer from Emacs, tramp needs a precise shell appearance: a simple =$= followed by a space after which to put the commands it needs to execute, and nothing else. Due to this, lets deactivate and redefine some of the functions defining the appearance of fish.
#+BEGIN_SRC fish
if test "$TERM" = "dumb"
function fish_prompt
@ -59,10 +51,7 @@
:PROPERTIES:
:CUSTOM_ID: Regular_fish_shell_appearance-c3e532e1
:END:
Now, there is only one function I modify when it comes to the appearance of
fish when Im the one using it: the ~fish_greeting~ function. I use it to give
me an overview of my computers status, including its hostname, uptime, disks
usage, ram usage, swap usage, and networking.
Now, there is only one function I modify when it comes to the appearance of fish when Im the one using it: the ~fish_greeting~ function. I use it to give me an overview of my computers status, including its hostname, uptime, disks usage, ram usage, swap usage, and networking.
#+BEGIN_SRC fish
set RED '\033[0;31m'
set GREEN '\033[0;32m'
@ -135,15 +124,12 @@
:PROPERTIES:
:CUSTOM_ID: Global_variables-1c84df8b
:END:
In order to keep some other code clean, I set the ~$BROWSER~ variable so I
dont have to call my web browser directly but rather with this variable.
In order to keep some other code clean, I set the ~$BROWSER~ variable so I dont have to call my web browser directly but rather with this variable.
#+BEGIN_SRC fish
set -gx BROWSER firefox
#+END_SRC
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it
can get the sudo password. So, lets declare it.
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it can get the sudo password. So, lets declare it.
#+BEGIN_SRC fish
set -gx SUDO_ASKPASS ~/.local/bin/askpass
#+END_SRC
@ -152,10 +138,7 @@
:PROPERTIES:
:CUSTOM_ID: Global_variables-Development-76b3ff13
:END:
Now, lets declare our editor of choice, EmacsClient; not Emacs itself since
it will most often be just quick edits, nothing too heavy, if it is called
from the ~EDITOR~ variable (from Git, for example), or from the ~VISUAL~
variable.
Now, lets declare our editor of choice, EmacsClient; not Emacs itself since it will most often be just quick edits, nothing too heavy, if it is called from the ~EDITOR~ variable (from Git, for example), or from the ~VISUAL~ variable.
#+BEGIN_SRC fish
set -gx EDITOR emacsclient -c
set -gx VISUAL emacsclient -c
@ -176,28 +159,22 @@
set -gx CHROME_EXECUTABLE /usr/bin/chromium
#+END_SRC
Next, we have two variables from Deno, the Node.js destroyer. Its base
directory will be set in my XDG config directory, and its binaries will be
located in my local binaries directory (see below).
Next, we have two variables from Deno, the Node.js destroyer. Its base directory will be set in my XDG config directory, and its binaries will be located in my local binaries directory (see below).
#+BEGIN_SRC fish
set -gx DENO_DIR $HOME/.config/deno
set -gx DENO_INSTALL_ROOT $HOME/.local/bin/deno
#+END_SRC
Finally, some development packages require the =PKG_CONFIG_PATH= to be set,
so lets do so.
Finally, some development packages require the =PKG_CONFIG_PATH= to be set, so lets do so.
#+BEGIN_SRC fish
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
#+END_SRC
** $PATH
** ~$PATH~
:PROPERTIES:
:CUSTOM_ID: Global_variables-$PATH-e1320303
:END:
Some global variables might sometimes be needed and need to be modified. This
is for example the case with my ~PATH~ variable in which I add Rusts Cargos
binaries, Gos binaries and my own executables. And of course, dont forget
to add the already existing ~PATH~.
Some global variables might sometimes be needed and need to be modified. This is for example the case with my ~PATH~ variable in which I add Rusts Cargos binaries, Gos binaries and my own executables. And of course, dont forget to add the already existing ~PATH~.
#+NAME: extra-paths
| additional path | what it leads to |
@ -218,8 +195,7 @@
#+RESULTS[f1fff053cb9e2239f35571249763683a4a62e643]: generate-extra-paths
: $HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin $HOME/.gem/ruby/2.6.0/bin $HOME/.cabal/bin
The code below ensures the ~PATH~ is updated only at login, and every
location is addded only once.
The code below ensures the ~PATH~ is updated only at login, and every location is addded only once.
#+BEGIN_SRC fish :noweb yes
for p in <<generate-extra-paths()>>
if status is-login
@ -246,17 +222,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-System_monitoring-bd909755
:END:
Here I have some abbreviations which are quite useful when performing some
system monitoring. With =df=, we can get an overview of our filesystem usage,
while with =diskspace= we get some more precise information. =meminfo= is a
call to =free= with sane defaults, and similar to =meminfo=, we also have
=gpumeminfo= so we can get a quick look at the memory-related logs of our X
session. I also declared =cpuinfo= an alias of =lscpu= in order to keep
consistent with =meminfo=. =pscpu= gives us information on what the CPU is
running right now, and =pscpu10= limits that to the top 10 threads.
Similarly, =psmem= gives us information on the memory usage of the current
threads, and =psmem10= only the ten most important threads in terms of memory
usage.
Here I have some abbreviations which are quite useful when performing some system monitoring. With =df=, we can get an overview of our filesystem usage, while with =diskspace= we get some more precise information. =meminfo= is a call to =free= with sane defaults, and similar to =meminfo=, we also have =gpumeminfo= so we can get a quick look at the memory-related logs of our X session. I also declared =cpuinfo= an alias of =lscpu= in order to keep consistent with =meminfo=. =pscpu= gives us information on what the CPU is running right now, and =pscpu10= limits that to the top 10 threads. Similarly, =psmem= gives us information on the memory usage of the current threads, and =psmem10= only the ten most important threads in terms of memory usage.
#+NAME: mgmt-abbr
| abbreviation | command |
|--------------+---------------------------------------------------|
@ -279,18 +245,13 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-System_management_(packages_and_services)-7249fbb7
:END:
I added some of these abbreviations due to how often I have to write the
whole thing.
I added some of these abbreviations due to how often I have to write the whole thing.
*** Package management
:PROPERTIES:
:CUSTOM_ID: Abbreviations-System_management_(packages_and_services)-Package_management-efbcdf0f
:END:
The first command is =remove= which removes a package from my system, as
well as its dependencies no longer needed. =p=. =pacman='s or =yay='s. This
is why I simply type =purge=. And if I want to simply seach among the
=pacman= repos, I can type =search=. Otherwise, if I want to include AUR
results, Ill use =yay=.
The first command is =remove= which removes a package from my system, as well as its dependencies no longer needed. =p=. =pacman='s or =yay='s. This is why I simply type =purge=. And if I want to simply seach among the =pacman= repos, I can type =search=. Otherwise, if I want to include AUR results, Ill use =yay=.
#+NAME: pm-abbr
| abbreviation | command |
@ -308,10 +269,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-System_management_(packages_and_services)-Service_management-8c5ae482
:END:
I dont have the muscle memory of =systemctl=. So instead, I simply type
=c= when I want to do something user service related.
And if I want to manipulate system services, I can instead type a simple
capital =S=.
I dont have the muscle memory of =systemctl=. So instead, I simply type =c= when I want to do something user service related. And if I want to manipulate system services, I can instead type a simple capital =S=.
#+NAME: service-abbr
| abbreviation | command |
|--------------+-----------|
@ -325,15 +283,13 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Development-d6050ca4
:END:
A good amount of these commands are development related, especially when it
comes to compilation or Docker.
A good amount of these commands are development related, especially when it comes to compilation or Docker.
*** CMake
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Development-CMake-f2951675
:END:
I have the following abbreviations so I can quickly run CMake and create a
configuration for debug or release profiles.
I have the following abbreviations so I can quickly run CMake and create a configuration for debug or release profiles.
#+NAME: abbr-cmake
| abbreviation | command |
|--------------+----------------------------------|
@ -349,8 +305,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Development-Docker-2d0a1288
:END:
And of course, when it comes to Docker Compose, I don't have time to write
the full command, so I use these instead.
And of course, when it comes to Docker Compose, I don't have time to write the full command, so I use these instead.
#+NAME: abbr-docker
| abbreviation | command |
|--------------+------------------------------|
@ -374,13 +329,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Development-Text_editors-5a23df47
:END:
I greatly prefer to use Emacsclient as my main text editor; Emacs has
basically all I need. So, it's only normal I have an abbreviation to launch
a new instance of it. However, in a graphical environment, this will launch
a new graphical window of Emacs. To launch a terminal instance, I'll use
~enw~ (~nw~ stands for the option “nowindow” ~-nw~ of Emacs). I also wish to
completely stop using other text editors, such as ~vi~, ~vim~, ~nano~ and
~ed~, so let's all add their command as an abbreviation for Emacs.
I greatly prefer to use Emacsclient as my main text editor; Emacs has basically all I need. So, it's only normal I have an abbreviation to launch a new instance of it. However, in a graphical environment, this will launch a new graphical window of Emacs. To launch a terminal instance, I'll use ~enw~ (~nw~ stands for the option “nowindow” ~-nw~ of Emacs). I also wish to completely stop using other text editors, such as ~vi~, ~vim~, ~nano~ and ~ed~, so let's all add their command as an abbreviation for Emacs.
#+NAME: abbr-text-ed
| abbreviation | command |
@ -401,8 +350,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Development-Compilation-dd066050
:END:
By default, I set ~clang~, ~clang++~, ~gcc~ and ~g++~ to the latest
standard and with the ~-Wall~ flag activated.
By default, I set ~clang~, ~clang++~, ~gcc~ and ~g++~ to the latest standard and with the ~-Wall~ flag activated.
#+NAME: abbr-comp
| abbreviation | command |
|--------------+----------------------|
@ -420,9 +368,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Development-Git-5e5055c1
:END:
And let's face it: we all at one point just wanted to commit our code
without thinking about the message, to just get over with it. Don't worry,
I got you covered.
And let's face it: we all at one point just wanted to commit our code without thinking about the message, to just get over with it. Don't worry, I got you covered.
#+NAME: abbr-git
| abbreviation | command |
|--------------+-----------------------------------------------------|
@ -437,11 +383,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-LaTeX-76865eb9
:END:
Yes, although I use org-mode, I still have some use for LaTeX, especially
when it comes to PDF exports of my org files. Hence why I use the LaTeX
package manager. It is recommended to use ~tllocalmgr~ instead of ~tlmgr~,
but I can never remember the command, and the latter is faster to type, so
time for an abbreviation. Same goes for ~texhash~ which must be run as sudo.
Yes, although I use org-mode, I still have some use for LaTeX, especially when it comes to PDF exports of my org files. Hence why I use the LaTeX package manager. It is recommended to use ~tllocalmgr~ instead of ~tlmgr~, but I can never remember the command, and the latter is faster to type, so time for an abbreviation. Same goes for ~texhash~ which must be run as sudo.
#+NAME: latex-abbr
| abbreviation | command |
|--------------+--------------|
@ -457,14 +399,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Some_security_measures-489cb521
:END:
Some commands can be quite dangerous when not used properly, which is why I
added default flags and options so I can get warnings before things get ugly.
The =-i= and =-I= add prompts in case we might not want to do what we asked
the shell to do. Notice =lns= which creates symlinks, =rmd= which removes
directories, =rmf= which forces deletion, and =rmdf= which forces the
delition of a directory. Notice also the =--preserve-root= which will prevent
me from accidentally removing the root folder. I added the same option to
=chgrp=, =chmod=, and =chown=.
Some commands can be quite dangerous when not used properly, which is why I added default flags and options so I can get warnings before things get ugly. The =-i= and =-I= add prompts in case we might not want to do what we asked the shell to do. Notice =lns= which creates symlinks, =rmd= which removes directories, =rmf= which forces deletion, and =rmdf= which forces the delition of a directory. Notice also the =--preserve-root= which will prevent me from accidentally removing the root folder. I added the same option to =chgrp=, =chmod=, and =chown=.
#+NAME: sec-abbr
| abbreviation | command |
|--------------+--------------------------|
@ -489,13 +424,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Typos-370bbb27
:END:
Let's admit it, we all make typos from time to time in the shell, and some
are recurrent enough we make abbreviations or aliases of the correct command.
Well, I have some of my abbreviations which were make exactly because of
this. Sometimes for some reasons, my brain makes me write ~clean~ instead of
~clear~. So, let's just replace the former by the latter. I'm also very bad
at typing ~exit~. And sometimes I suck at typing ~htop~. ~q~ isn't a typo per
se, instead just a habit I have.
Let's admit it, we all make typos from time to time in the shell, and some are recurrent enough we make abbreviations or aliases of the correct command. Well, I have some of my abbreviations which were make exactly because of this. Sometimes for some reasons, my brain makes me write ~clean~ instead of ~clear~. So, let's just replace the former by the latter. I'm also very bad at typing ~exit~. And sometimes I suck at typing ~htop~. ~q~ isn't a typo per se, instead just a habit I have.
#+NAME: typo-abbr
| abbreviation | command |
|--------------+---------|
@ -514,53 +443,39 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Misc-c2631eb6
:END:
Finally, some miscellaneous abbreviations that don't really fit into any of
the above categories.
Finally, some miscellaneous abbreviations that don't really fit into any of the above categories.
*** Media
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Misc-Media-e4b85d56
:END:
Here you will find various commands related to media in general. the first
one is a command to play some chillhop from the [[https://www.youtube.com/user/Chillhopdotcom][Chillhop YouTube channel]]'s
livestream.
Here you will find various commands related to media in general. the first one is a command to play some chillhop from the [[https://www.youtube.com/user/Chillhopdotcom][Chillhop YouTube channel]]'s livestream.
#+BEGIN_SRC fish
abbr chill 'mpv --force-window=no --no-video "https://www.youtube.com/user/Chillhopdotcom/live" &'
#+END_SRC
When it comes to mpv, I do not want to force it to open a graphical window
if for example I want to listen to an audio file. I also do not want any
border on that window. So, I declared this abbreviation.
When it comes to mpv, I do not want to force it to open a graphical window if for example I want to listen to an audio file. I also do not want any border on that window. So, I declared this abbreviation.
#+BEGIN_SRC fish
abbr mpv 'mpv --no-border --force-window=no'
#+END_SRC
When I want to download a song from YouTube, I'll just use the command ~flac
videoIdentifier~ to get it through ~youtube-dl~.
When I want to download a song from YouTube, I'll just use the command ~flac videoIdentifier~ to get it through ~youtube-dl~.
#+BEGIN_SRC fish
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"'
#+END_SRC
I download a LOT of videos from YouTube, generally educative videos that I
do not want to lose to YouTube one day who will decide that such channel is
unworthy of their platform, or if the original author decides to delete
their videos or whatever. So, I use the abbreviation ~ytdl~ to download
either one video, or a whole YouTube channel.
I download a LOT of videos from YouTube, generally educative videos that I do not want to lose to YouTube one day who will decide that such channel is unworthy of their platform, or if the original author decides to delete their videos or whatever. So, I use the abbreviation ~ytdl~ to download either one video, or a whole YouTube channel.
#+BEGIN_SRC fish
abbr ytdl 'youtube-dl -f best -ciw -o "~/Videos/YouTube/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s"'
#+END_SRC
Some sane default options for ~sxiv~, a simple X image Viewer. This includes
playing GIFs and not displaying the filename below. Sxiv will also open in
fullscreen and will fit the displayed image to the frame. I also abbreviated
~feh~ to sxiv, old habits die hard.
Some sane default options for ~sxiv~, a simple X image Viewer. This includes playing GIFs and not displaying the filename below. Sxiv will also open in fullscreen and will fit the displayed image to the frame. I also abbreviated ~feh~ to sxiv, old habits die hard.
#+BEGIN_SRC fish
abbr sxiv 'sxiv -abfs f'
abbr feh 'sxiv -abfs f'
#+END_SRC
Finally, let's declare the following abbreviation that will launch an mpv
instance displaying my webcam:
Finally, let's declare the following abbreviation that will launch an mpv instance displaying my webcam:
#+BEGIN_SRC fish
abbr webcam 'mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0'
#+END_SRC
@ -569,9 +484,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Misc-Sudo-aef0214a
:END:
First, I make it so that ~sudo~ comes with the ~-A~ switch in order to call
my custom graphical script for getting my password (see [[file:bin.org::#Askpass-d0d7a8c0][askpass]]). I also
made it so ~please~ is an equivalent to ~sudo -A~ as a joke.
First, I make it so that ~sudo~ comes with the ~-A~ switch in order to call my custom graphical script for getting my password (see [[file:bin.org::#Askpass-d0d7a8c0][askpass]]). I also made it so ~please~ is an equivalent to ~sudo -A~ as a joke.
#+BEGIN_SRC fish
abbr please 'sudo -A'
#+END_SRC
@ -580,8 +493,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Misc-History-a2124b23
:END:
I also find it more intuitive and faster to just write ~hist~ instead of
~history~, so let's declare that.
I also find it more intuitive and faster to just write ~hist~ instead of ~history~, so let's declare that.
#+BEGIN_SRC fish
abbr hist history
#+END_SRC
@ -590,11 +502,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Misc-Compression-4fd4ffef
:END:
It seems it's just like many other people, but I cannot for the life of me
remember the syntax of ~tar~. So, I made the following abbreviations, and
one day hopefully, after seeing the abbreviations' expansion over and over
I'll remember the command like I did for the abbreviation of ~remove~ (see
[[#Abbreviations-System_management_(packages_and_services)-Package_management-efbcdf0f][Package management]]).
It seems it's just like many other people, but I cannot for the life of me remember the syntax of ~tar~. So, I made the following abbreviations, and one day hopefully, after seeing the abbreviations' expansion over and over I'll remember the command like I did for the abbreviation of ~remove~ (see [[#Abbreviations-System_management_(packages_and_services)-Package_management-efbcdf0f][Package management]]).
#+NAME: tar-abbr
| abbreviation | command |
|--------------+-----------|
@ -624,8 +532,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Misc-Network_Management-0b7fc91d
:END:
First, we have just =nmcli= with sane default options, that is a pretty output
with colors.
First, we have just =nmcli= with sane default options, that is a pretty output with colors.
#+BEGIN_SRC fish
abbr nmcli 'nmcli -p -c auto'
#+END_SRC
@ -634,11 +541,7 @@
:PROPERTIES:
:CUSTOM_ID: Abbreviations-Misc-NordVPN-09438638
:END:
Next, we have some NordVPN-related shortcuts. The first one is a simple
abbreviation to =nordvpn=. The second one is a shortcut to connect to a
server, and to disconnect from the current server. I also have a couple of
shortcuts to quickly connect to some preselected countries, mainly France,
Germany, Japan and the US.
Next, we have some NordVPN-related shortcuts. The first one is a simple abbreviation to =nordvpn=. The second one is a shortcut to connect to a server, and to disconnect from the current server. I also have a couple of shortcuts to quickly connect to some preselected countries, mainly France, Germany, Japan and the US.
#+NAME: nordvpn-abbr
| abbreviation | command |
|--------------+-------------------------|

View File

@ -11,17 +11,11 @@
:PROPERTIES:
:CUSTOM_ID: Presentation-9c7a53bf
:END:
*Before proceeding, be aware that I deprecated this i3 config on August 22nd,
2020, meaning I wont update it anymore unless I use it again some day in the
future. I will keep it on my website though.*
*Before proceeding, be aware that I deprecated this i3 config on August 22nd, 2020, meaning I wont update it anymore unless I use it again some day in the future. I will keep it on my website though.*
=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.
=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][Airbladers fork of i3]], =i3-gaps=. Some
configuration will not work with =i3=.
It is to be noted I am using [[https://github.com/Airblader/i3][Airbladers fork of i3]], =i3-gaps=. Some configuration will not work with =i3=.
#+BEGIN_SRC conf :exports none
# -*- mode: conf -*-
@ -35,22 +29,11 @@
:PROPERTIES:
:CUSTOM_ID: Variables_declaration-Global-1cf1bfe4
:END:
The first I do is declaring the modifier key and the alt key —I dont 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.
The first I do is declaring the modifier key and the alt key —I dont 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.
Lets 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.
Lets 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.
Ill 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.
Ill 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 |
@ -94,8 +77,7 @@
: set $right Right
: set $term st
Finally, some variables hold some long strings for commands I dont want to
have to type multiple times.
Finally, some variables hold some long strings for commands I dont 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)))
@ -117,8 +99,7 @@
<<generate-variables2()>>
#+END_SRC
Now comes the font for the window tiles. Honestly, this setting is useless
since we do not see it, but lets set it anyway.
Now comes the font for the window tiles. Honestly, this setting is useless since we do not see it, but lets set it anyway.
#+BEGIN_SRC conf
font Fira Sans Book:style=Book:pixelsize=10
#+END_SRC
@ -127,15 +108,9 @@
: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).
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).
Lets declare our floading modyfier. With floating windows, you can move them
around by clicking on the windows borders; but since we dont 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.
Lets declare our floading modyfier. With floating windows, you can move them around by clicking on the windows borders; but since we dont 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
@ -146,22 +121,18 @@
: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.
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.
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.
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
@ -170,9 +141,7 @@
: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.
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
@ -181,12 +150,7 @@
: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.
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
@ -195,17 +159,14 @@
: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.
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.
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.
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
@ -215,17 +176,13 @@
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.
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 wont see these colors much, so lets simply keep the default
values.
Some parameters are also available when it comes to the colors i3 uses. Honestly, we wont see these colors much, so lets simply keep the default values.
#+BEGIN_SRC conf
set_from_resource $fg i3wm.color7 #f0f0f0
set_from_resource $bg i3wm.color2 #f0f0f0
@ -242,9 +199,7 @@
: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.
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 |
|-------------+-------------+-----------|
@ -258,8 +213,7 @@
| Steam | Steam | 9 |
| Discord | discord | 10 |
The class table is used in the assignment in the i3 config file. For instance,
Gimps assignment will look like this:
The class table is used in the assignment in the i3 config file. For instance, Gimps assignment will look like this:
#+BEGIN_SRC conf :tangle no
assign [class="Gimp*"] 6
#+END_SRC
@ -287,12 +241,7 @@
<<generate-workspaces()>>
#+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.
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")
@ -309,9 +258,7 @@
: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 Ill try to make it readable
still.
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 Ill try to make it readable still.
Shortcuts are set like so:
#+BEGIN_SRC conf :tangle no
@ -329,9 +276,7 @@
: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.
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 |
|-------------------+----------------------+--------------------------------------------------|
@ -359,16 +304,13 @@
| $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 systems color configuration from it.
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 systems 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.
We also have some shortcuts to lock our screen, sleep, hibernate and shut down our computer.
#+NAME: computer-sh
| shortcut | command | what it does |
|---------------+----------------------------+------------------------|
@ -392,9 +334,7 @@
: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.
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 |
|-----------+---------+--------------------------------------------------------|
@ -428,9 +368,7 @@
: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 lets be honest, most people wont have ten screens to display all
ten workspaces at the same time, and frankly that would be impractical.
Just like windows, it is also possible to change focus between workspaces, because lets be honest, most people wont 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 |
|----------+--------------+-------------------------|
@ -472,8 +410,7 @@
:PROPERTIES:
:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Moving_containers-b97cf4ae
:END:
To move containers between the available screens, you have the following
shortcuts:
To move containers between the available screens, you have the following shortcuts:
#+NAME: containers-move-sh
| shortcut | command | what it does |
|------------------+--------------------------------+------------------------------------------------------------|
@ -508,8 +445,7 @@
: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:
It is also possible to move workspaces. The related shortcuts available are the following:
#+NAME: workspace-move-sh
| shortcut | command | what it does |
@ -528,10 +464,7 @@
: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 dont really use it anymore due to my main
keyboard which doesnt have any easy access to the functions keys, hence
mod+q.
To close windows, we have two main shortcuts: Alt+F4 and mod+q. The first one is here due to habits, but I dont really use it anymore due to my main keyboard which doesnt have any easy access to the functions keys, hence mod+q.
#+NAME: close-win-sh
| shortcut | command | what it does |
|----------+---------+-------------------------|
@ -547,10 +480,7 @@
: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.
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 |
|----------+-------------------+---------------------------------------------------|
@ -564,9 +494,7 @@
}
#+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~.
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 |
|----------+-------------------------------------+-------------------------------------------|
@ -580,10 +508,7 @@
| 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.
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
@ -597,16 +522,14 @@
: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:
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]].
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
@ -617,19 +540,9 @@
:PROPERTIES:
:CUSTOM_ID: Shortcuts-Window_and_workspace_management-Scratchpad_and_window_display-10d8d1f4
:END:
You can think of i3s 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 can think of i3s 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.
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 |
|--------------+-----------------+------------------------------------------------------|
@ -646,9 +559,7 @@
: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.
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 |
|-------------------+-----------------------------------------------+-----------------------------|
@ -667,18 +578,13 @@
:PROPERTIES:
:CUSTOM_ID: Shortcuts-Launching_software-0e088e69
:END:
A big part of my i3 shortcuts though are related to launching various
software. Ill 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.
A big part of my i3 shortcuts though are related to launching various software. Ill 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.
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 |
|--------------+---------------------------------------+-------------------------------------------------------|
@ -728,10 +634,7 @@
:PROPERTIES:
:CUSTOM_ID: Shortcuts-Launching_software-Screen_brightness-6855d53f
:END:
Here we have four commands for managing our screens 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 doesnt have dedicated keys or
we are using a keyboard which doesnt provide them.
Here we have four commands for managing our screens 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 doesnt have dedicated keys or we are using a keyboard which doesnt provide them.
#+NAME: brightness-sh
| shortcut | command | what it does |
|-----------------------+------------------------+---------------------------------------|
@ -749,10 +652,7 @@
: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.
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 |
|---------------------------+--------------------+--------------------------------|
@ -770,16 +670,14 @@
| $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.
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 ncmpcpps playlist editor |
| $mod+Shift+v | exec $term ncmpcpp -qs visualizer | Launch ncmpcpps visualizer |
We also have more general shortcuts, like how to manipulate the general
volume level.
We also have more general shortcuts, like how to manipulate the general volume level.
#+NAME: volume-sh
| shortcut | command | what it does |
|----------------------+----------------------------------------+----------------------|
@ -800,8 +698,7 @@
:PROPERTIES:
:CUSTOM_ID: Shortcuts-Launching_software-Rofi_utilities-b8eb5b95
:END:
We also have some utilities Ive written and which are interfaced with rofi.
Here are said shortcuts.
We also have some utilities Ive written and which are interfaced with rofi. Here are said shortcuts.
#+NAME: rofi-sh
| shortcut | command | what it does |
|-------------------+-----------------------+-----------------------------------------------------------------------|
@ -822,8 +719,7 @@
: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.
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 |
|-------------+------------------+---------------------------------|
@ -841,19 +737,14 @@
: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. Well use some
Emacs Lisp to determine on the configuration file export which screens names
to use.
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. Well 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.
Now, we just have to call this Emacs Lisp code as a noweb reference and execute it.
#+BEGIN_SRC conf :noweb yes
<<hostname-screen-management()>>
#+END_SRC
@ -862,8 +753,7 @@
: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:
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 |
|--------------------+-------------------------------------------+----------------------------------------|
@ -908,9 +798,7 @@
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. Lets launch our
policy kit manager if that is the case:
My travel laptop has a fingerprint reader which can be used as an authentification method when the root password is asked. Lets launch our policy kit manager if that is the case:
#+NAME: fingerprint-thinkpad
#+BEGIN_SRC emacs-lisp
(if (string= system-name "gampo")

View File

@ -9,12 +9,9 @@
:PROPERTIES:
:CUSTOM_ID: Presentation-981f2f04
:END:
This is my collection of dotfiles for my daily GNU/Linux environment, tweaked
to my liking. If you wish to get the same setup as mine, follow the
instructions below.
This is my collection of dotfiles for my daily GNU/Linux environment, tweaked to my liking. If you wish to get the same setup as mine, follow the instructions below.
For starters, here is the link to all the pages on my website that you might
find interesting. Ill describe them in more details below.
For starters, here is the link to all the pages on my website that you might find interesting. Ill describe them in more details below.
- [[file:installation.org][Arch Linux bootstrap script]]
- [[file:awesome.org][AwesomeWM configuration]]
- [[file:bin.org][Custom scripts]]
@ -29,25 +26,16 @@
- [[file:rustfmt.org][Rustfmt configuration]]
- [[file:tmux.org][Tmux configuration]]
As you can see, I personally use [[https://fishshell.com/][fish]] as my shell of choice, and [[https://www.gnu.org/software/emacs/][Emacs]] 28.0
(using the ~native-comp~ branch) using [[http://spacemacs.org][Spacemacs]] (still with Emacs keybinding
in Insert mode but with Evil in Normal mode) as my main text editor.
As you can see, I personally use [[https://fishshell.com/][fish]] as my shell of choice, and [[https://www.gnu.org/software/emacs/][Emacs]] 28.0 (using the ~native-comp~ branch) using [[http://spacemacs.org][Spacemacs]] (still with Emacs keybinding in Insert mode but with Evil in Normal mode) as my main text editor.
When it comes to my graphical UI, I do not have any desktop environment.
Instead, I have a tiling window manager, AwesomeWM. The historical first on my
configuration is [[https://github.com/Airblader/i3][i3-gaps]], an [[https://i3wm.org/][i3]] fork by [[https://github.com/Airblader/i3][Airblader]] with which I use two bars
generated by [[https://polybar.github.io/][Polybar]]. It used [[https://github.com/dylanaraps/pywal][pywal]] to define their color scheme, as well as
[[https://github.com/davatorium/rofi][rofi]]s color scheme. My other TWM and the one I currently use is [[https://awesomewm.org/][AwesomeWM]].
When it comes to my graphical UI, I do not have any desktop environment. Instead, I have a tiling window manager, AwesomeWM. The historical first on my configuration is [[https://github.com/Airblader/i3][i3-gaps]], an [[https://i3wm.org/][i3]] fork by [[https://github.com/Airblader/i3][Airblader]] with which I use two bars generated by [[https://polybar.github.io/][Polybar]]. It used [[https://github.com/dylanaraps/pywal][pywal]] to define their color scheme, as well as [[https://github.com/davatorium/rofi][rofi]]s color scheme. My other TWM and the one I currently use is [[https://awesomewm.org/][AwesomeWM]].
Finally, you can find my configuration for my ErgodoxEZ keyboard [[https://configure.ergodox-ez.com/ergodox-ez/layouts/5WrVw/latest/0][here]]. It is
optimized for usage with the Bépo layout set as a software layout, and for
shortcuts from i3.
Finally, you can find my configuration for my ErgodoxEZ keyboard [[https://configure.ergodox-ez.com/ergodox-ez/layouts/5WrVw/latest/0][here]]. It is optimized for usage with the Bépo layout set as a software layout, and for shortcuts from i3.
* Screenshots
:PROPERTIES:
:CUSTOM_ID: Screenshots-51f1cef3
:END:
#+CAPTION: Desktop with Neofetch in the terminal
[[./img/neofetch.png.webp]]
@ -63,15 +51,9 @@
:END:
- Emacs configuration perfectly tailored for my own use
- Beautiful and comfy i3 and polybar configuration
- And enough information below to get basically the same distro install as I
have on my main computer and my travel laptop.
- And enough information below to get basically the same distro install as I have on my main computer and my travel laptop.
Most of the org files you will find in this repos are the actual source code
of much of my config files. For instance, the bootstrap found in
[[file:installation.org][installation.org]] exports almost all of its code snippets to
[[file:.config/yadm/bootstrap][.config/yadm/bootstrap]] thanks to =M-x org-babel-tangle= from within Emacs.
Below I will also present and comment some of my short config files which do
not deserve to have a full org file dedicated to them.
Most of the org files you will find in this repos are the actual source code of much of my config files. For instance, the bootstrap found in [[file:installation.org][installation.org]] exports almost all of its code snippets to [[file:.config/yadm/bootstrap][.config/yadm/bootstrap]] thanks to =M-x org-babel-tangle= from within Emacs. Below I will also present and comment some of my short config files which do not deserve to have a full org file dedicated to them.
** Tiling Window Managers
:PROPERTIES:
@ -81,25 +63,19 @@
:PROPERTIES:
:CUSTOM_ID: Features-Tiling_Window_Managers-AwesomeWM-2eac61a9
:END:
AwesomeWM is the TWM I use the most on my computer between itself and i3. My
configuration for it is documented in detail in its corresponding document,
which you can find [[file:awesome.org][here]].
AwesomeWM is the TWM I use the most on my computer between itself and i3. My configuration for it is documented in detail in its corresponding document, which you can find [[file:awesome.org][here]].
*** i3 configuration (Deprecated)
:PROPERTIES:
:CUSTOM_ID: Features-Tiling_Window_Managers-i3_configuration-9c92e43c
:END:
The i3 configuration is detailed in its corresponding README which you can
find [[file:i3.org][here]]. Be aware I do not use i3 anymore, and I will not update it until
I may someday use it again. This was deprecated on August 22nd, 2020.
The i3 configuration is detailed in its corresponding README which you can find [[file:i3.org][here]]. Be aware I do not use i3 anymore, and I will not update it until I may someday use it again. This was deprecated on August 22nd, 2020.
** Polybar config (Deprecated)
:PROPERTIES:
:CUSTOM_ID: Features-Polybar_config_(Deprecated)-c8f95774
:END:
My annotated polybar config can be found [[file:polybar.org][here]], if you wish to use it. Be
aware I do not use polybar anymore, and I will not update it until I may
someday use it again. This was deprecated on August 22nd, 2020.
My annotated polybar config can be found [[file:polybar.org][here]], if you wish to use it. Be aware I do not use polybar anymore, and I will not update it until I may someday use it again. This was deprecated on August 22nd, 2020.
** Graphical tweaks
:PROPERTIES:
@ -118,10 +94,7 @@
:HEADER-ARGS: :mkdirp yes :tangle ~/.gtkrc-2.0
:CUSTOM_ID: Features-Graphical_tweaks-GTK_Settings-GTK2-General_configuration-eb1f1f3c
:END:
This file is tangled at ~$HOME/.gtkrc-2.0~. This is an equivalent for the
GTK3 configuration file you will see below, and it shares most of its
settings. First, lets select the Nordic theme for GTK2. Lets also set
the icon theme.
This file is tangled at ~$HOME/.gtkrc-2.0~. This is an equivalent for the GTK3 configuration file you will see below, and it shares most of its settings. First, lets select the Nordic theme for GTK2. Lets also set the icon theme.
#+BEGIN_SRC conf-unix
# -*- mode: unix-config -*-
gtk-theme-name="Nordic"
@ -151,14 +124,12 @@
[Filechooser Settings]
#+END_SRC
The first option alows me to open the file chooser in the current working
directory:
The first option alows me to open the file chooser in the current working directory:
#+BEGIN_SRC conf-unix
StartupMode=cwd
#+END_SRC
Next, setting the location mode to ~path-bar~ will show the path as buttons
that can be clicked rather than the full path.
Next, setting the location mode to ~path-bar~ will show the path as buttons that can be clicked rather than the full path.
#+BEGIN_SRC conf-unix
LocationMode=path-bar
#+END_SRC
@ -173,8 +144,7 @@
ShowSizeColumn=true
#+END_SRC
Now, lets choose the geometry of our file picker. These two first lines
set where the file picker appears:
Now, lets choose the geometry of our file picker. These two first lines set where the file picker appears:
#+BEGIN_SRC conf-unix
GeometryX=566
GeometryY=202
@ -186,8 +156,7 @@
GeometryHeight=400
#+END_SRC
With these two lines, we set how our files are sorted: by name, and in the
ascending order.
With these two lines, we set how our files are sorted: by name, and in the ascending order.
#+BEGIN_SRC conf-unix
SortColumn=name
SortOrder=ascending
@ -198,8 +167,7 @@
ViewMode=list-view
#+END_SRC
And finally, setting our icon view scale to ~-1~ sets the icon view to the
max size.
And finally, setting our icon view scale to ~-1~ sets the icon view to the max size.
#+BEGIN_SRC conf-unix
IconViewScale=-1
#+END_SRC
@ -209,15 +177,12 @@
:HEADER-ARGS: :mkdirp yes :tangle ~/.config/gtk-3.0/settings.ini
:CUSTOM_ID: Features-Graphical_tweaks-GTK_Settings-GTK3-3d6cba86
:END:
The following file helps me choosing the aspect of various GTK+ 3 software,
including their theme and icons. First, lets declare the header:
The following file helps me choosing the aspect of various GTK+ 3 software, including their theme and icons. First, lets declare the header:
#+BEGIN_SRC conf-unix
[Settings]
#+END_SRC
Now, lets hint to GTK that I prefer dark themes. This can have an
influence also on some websites that can detect this preference and
therefore set their own theme to dark by themselves.
Now, lets hint to GTK that I prefer dark themes. This can have an influence also on some websites that can detect this preference and therefore set their own theme to dark by themselves.
#+BEGIN_SRC conf-unix
gtk-application-prefer-dark-theme = true
#+END_SRC
@ -246,8 +211,7 @@
# gtk-xft-rgba=rgb
#+END_SRC
Since window decorations are handled by my WMs, I will leave this variable
empty.
Since window decorations are handled by my WMs, I will leave this variable empty.
#+BEGIN_SRC conf-unix
gtk-decoration-layout=
#+END_SRC
@ -256,28 +220,24 @@
:PROPERTIES:
:CUSTOM_ID: Features-Graphical_tweaks-Picom-b5b9a4dd
:END:
Picom is a standalone compositor for Xorg, and the successor to Compton,
itself successor to xcompmgr-dana, itself a fork of xcompmgr. You can find
my Picom configuration [[file:picom.org][here]].
Picom is a standalone compositor for Xorg, and the successor to Compton, itself successor to xcompmgr-dana, itself a fork of xcompmgr. You can find my Picom configuration [[file:picom.org][here]].
*** Xresources
:PROPERTIES:
:HEADER-ARGS: :mkdirp yes :tangle ~/.Xresources :exports code
:CUSTOM_ID: Features-Graphical_tweaks-Xresources-8b622de1
:END:
My Xresources file is very short. Indeed, it only contains two lines which
are dedicated to my =st= terminal to set its font and shell. The font is set
as follows.
My Xresources file is very short. Indeed, it only contains two lines which are dedicated to my =st= terminal to set its font and shell. The font is set as follows.
#+BEGIN_SRC conf
st.font: Fantasque Sans Mono:size=10:antialias=true
#+END_SRC
I can also set the transparency of st (my terminal emulator) like so:
#+BEGIN_SRC conf
st.alpha: 0.85
#+END_SRC
Next is the declaration of my color theme. It is based on the [[https://www.nordtheme.com/][Nord]] theme,
from their [[https://github.com/arcticicestudio/nord-xresources/][Git repository]].
Next is the declaration of my color theme. It is based on the [[https://www.nordtheme.com/][Nord]] theme, from their [[https://github.com/arcticicestudio/nord-xresources/][Git repository]].
#+BEGIN_SRC conf
#define nord0 #2E3440
#define nord1 #3B4252
@ -328,23 +288,18 @@
:PROPERTIES:
:CUSTOM_ID: Features-Text_and_source_code_editing-Emacs_configuration-ef937102
:END:
Emacs is my main text editor, which I use for almost everything. Because,
you know…
Emacs is my main text editor, which I use for almost everything. Because, you know…
#+begin_quote
Emacs is a great operating system, it just lacks a good text editor.
#+end_quote
You can find my Emacs config, based on Spacemacs, in my [[https://labs.phundrak.com/phundrak/dotfiles/src/branch/master/.spacemacs][.spacemacs]] file, and
my user configuration in my [[file:emacs.org][emacs.org]] file.
You can find my Emacs config, based on Spacemacs, in my [[https://labs.phundrak.com/phundrak/dotfiles/src/branch/master/.spacemacs][.spacemacs]] file, and my user configuration in my [[file:emacs.org][emacs.org]] file.
*** Nano (deprecated)
:PROPERTIES:
:CUSTOM_ID: Features-Text_and_source_code_editing-Nano-a9d4839f
:END:
Although it is a very simple piece of software, nano does offer some
customization. Mine can be found in my [[file:~/org/config-website/nano.org][nano.org]] file. Be aware I do not use
nano anymore, and I will not update it until I may someday use it again.
This was deprecated on August 28th, 2020.
Although it is a very simple piece of software, nano does offer some customization. Mine can be found in my [[file:~/org/config-website/nano.org][nano.org]] file. Be aware I do not use nano anymore, and I will not update it until I may someday use it again. This was deprecated on August 28th, 2020.
*** Rustfmt
:PROPERTIES:
@ -356,19 +311,13 @@
:PROPERTIES:
:CUSTOM_ID: Features-Custom_scripts_in_=PATH=-043e8c8e
:END:
I have written some scripts that help me daily accomplish some simple tasks,
like mounting and unmounting a drive or Android device, an emoji picker, a
utility to set up my Wacom tablet, and so on. You can find them stored in my
[[file:bin.org][bin.org]] file along with their detailed explanation in the README placed in
the same folder —which is actually their source code once the org-mode file
gets tangled.
I have written some scripts that help me daily accomplish some simple tasks, like mounting and unmounting a drive or Android device, an emoji picker, a utility to set up my Wacom tablet, and so on. You can find them stored in my [[file:bin.org][bin.org]] file along with their detailed explanation in the README placed in the same folder —which is actually their source code once the org-mode file gets tangled.
** Fish configuration with useful abbreviations
:PROPERTIES:
:CUSTOM_ID: Features-Fish_configuration_with_useful_abbreviations-c71ffba0
:END:
You can also find in my Fish shell configuration in my [[file:~/org/config-website/fish.org][fish.org]] file, which
contains my usual abbreviations.
You can also find in my Fish shell configuration in my [[file:~/org/config-website/fish.org][fish.org]] file, which contains my usual abbreviations.
** And some minor configuration files
:PROPERTIES:
@ -394,16 +343,12 @@
:HEADER-ARGS: :mkdirp yes :tangle ~/.gitignore_global
:CUSTOM_ID: Features-And_some_minor_configuration_files-Global_gitignore-42467108
:END:
Sometimes, there are some lines that always reappear in gitignores. So,
instead of always adding them, let git now that some elements are to be
ignored by default, hence the [[file:.gitignore_global][~/.gitignore_global]] file. First, we dont want
nanos backup files.
Sometimes, there are some lines that always reappear in gitignores. So, instead of always adding them, let git now that some elements are to be ignored by default, hence the [[file:.gitignore_global][~/.gitignore_global]] file. First, we dont want nanos backup files.
#+BEGIN_SRC text
~*
#+END_SRC
And object files and output binaries generated by =gcc= and the likes arent
welcome either.
And object files and output binaries generated by =gcc= and the likes arent welcome either.
#+BEGIN_SRC text
,*.out
,*.o
@ -413,24 +358,19 @@
:PROPERTIES:
:CUSTOM_ID: Features-Tmux_configuration-ce76e030
:END:
You can find my tmux configuration in [[file:tmux.org][tmux.org]]. It depends on the submodule
[[https://github.com/gpakosz/.tmux.git][.tmux]] by [[https://pempek.net/][Gregory Pakosz]].
You can find my tmux configuration in [[file:tmux.org][tmux.org]]. It depends on the submodule [[https://github.com/gpakosz/.tmux.git][.tmux]] by [[https://pempek.net/][Gregory Pakosz]].
* Dependencies
:PROPERTIES:
:CUSTOM_ID: Dependencies-ef5057dd
:END:
Of course, some dependencies are needed for my dotfiles to work well. Here is
a non-exhaustive list of software needed by these configuration files:
Of course, some dependencies are needed for my dotfiles to work well. Here is a non-exhaustive list of software needed by these configuration files:
- [[https://www.gnu.org/software/emacs/][GNU/Emacs]] >= 26.2
- [[http://spacemacs.org][Spacemacs]] (develop branch)
- My [[https://labs.phundrak.com/phundrak/conlang-layer][conlanging layer]]
- [[https://github.com/venmos/w3m-layer][Venmos]] [[https://github.com/venmos/w3m-layer][w3m layer]]
- The [[https://fishshell.com/][Fish shell]], using [[https://github.com/jorgebucaran/fisher][fisher]]
- [[https://lukesmith.xyz/][Luke Smith]]s [[https://github.com/LukeSmithxyz/st][fork]] of [[https://st.suckless.org/][st]]
- [[https://resloved.info/][Resloved]]s [[https://github.com/resloved/i3][i3-gaps-rounded]] fork of [[https://github.com/Airblader/i3][Airblader]]s [[https://github.com/Airblader/i3][i3-gaps]], itself a fork of [[https://i3wm.org/][i3]]
- [[https://github.com/yshui/compton][Compton]], more specificaly [[https://github.com/tryone144/compton][Tryone]]s [[https://github.com/tryone144/compton][fork]]
- [[https://github.com/dylanaraps/pywal/][pywal]]
- [[https://tools.suckless.org/dmenu/][dmenu]]
- [[https://github.com/enkore/j4-dmenu-desktop][j4-dmenu-desktop]]
- [[https://github.com/davatorium/rofi][Rofi]]
@ -447,17 +387,10 @@
:PROPERTIES:
:CUSTOM_ID: Installation-9ec2ae86
:END:
For an installation walkthrough of my Arch Linux installation, check out my
[[file:installation.org][installation.org]] file where I walk you through the first manual steps and
through the bootstrap you can execute to automatically take care of a lot of
elements.
For an installation walkthrough of my Arch Linux installation, check out my [[file:installation.org][installation.org]] file where I walk you through the first manual steps and through the bootstrap you can execute to automatically take care of a lot of elements.
* Licence
:PROPERTIES:
:CUSTOM_ID: Licence-48911096
: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
licence and as allowed by the licence, and if you fuck up something, its your
own responsibility.
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 licence and as allowed by the licence, and if you fuck up something, its your own responsibility.

View File

@ -13,33 +13,17 @@
:PROPERTIES:
:CUSTOM_ID: Introduction-cd5792cd
:END:
Here will be presented what I do to get my system up and running on a fresh
Arch Linux install. These installation instructions were written in order to
get an Arch Linux distribution up and running with the same configuration as
my main computers and my travelling laptops configuration.
Here will be presented what I do to get my system up and running on a fresh Arch Linux install. These installation instructions were written in order to get an Arch Linux distribution up and running with the same configuration as my main computers and my travelling laptops configuration.
* Install Arch Linux
:PROPERTIES:
:CUSTOM_ID: Install_Arch_Linux-ac7ad3b2
:END:
I usually install Arch from the [[https://www.archlinux.org/download/][vanilla ISO]], however I began using [[https://github.com/MatMoul/archfi][archfi]] to
install easily the distro (Ive done it so many times, I know how it works
now). Usually, my distros will be installed on two partitions: ~/home~ and ~/~
(root).
I usually install Arch from the [[https://www.archlinux.org/download/][vanilla ISO]], however I began using [[https://github.com/MatMoul/archfi][archfi]] to install easily the distro (Ive done it so many times, I know how it works now). Usually, my distros will be installed on two partitions: ~/home~ and ~/~ (root).
If the computer supports EFI bootloaders, the EFI partition will be mounted on
~/boot/efi~. I generally use ~systemd-boot~ as my boot manager, but if you are
more comfortable with another one, just install what you want. Be aware that
if you format your ~/boot~ partition, you will delete all boot managers that
already exist; so, if you are dual-booting, *DO NOT FORMAT IT*. Yes, I made
the mistake of wiping the Windows boot manager when I used to dual-boot.
If the computer supports EFI bootloaders, the EFI partition will be mounted on ~/boot/efi~. I generally use ~systemd-boot~ as my boot manager, but if you are more comfortable with another one, just install what you want. Be aware that if you format your ~/boot~ partition, you will delete all boot managers that already exist; so, if you are dual-booting, *DO NOT FORMAT IT*. Yes, I made the mistake of wiping the Windows boot manager when I used to dual-boot.
In order to use the ~suspend-then-hibernate~ systemd command, it is necessary
to have a swap partition at least twice the size of your installed RAM. That
is because when this command will be run, the system will try to save the
current state of your machine, stored in your RAM, to the swap filesystem. If
there is not enough space, the command will fail, and you wont be able to use
this command.
In order to use the ~suspend-then-hibernate~ systemd command, it is necessary to have a swap partition at least twice the size of your installed RAM. That is because when this command will be run, the system will try to save the current state of your machine, stored in your RAM, to the swap filesystem. If there is not enough space, the command will fail, and you wont be able to use this command. For instance, my current computer has 32GB of RAM, hence my SWAP partition is 16GB large.
** Get the latest, fastest mirrors
:PROPERTIES:
@ -52,20 +36,13 @@
--save /etc/pacman.d/mirrorlist --verbose
#+END_SRC
This will update the packages from your live ISO, and you will get the best
mirrors for your installation. Of course, change the countries accordingly to
your location. In my case, I am only interested in French, German, and
Belgian mirrors.
This will update the packages from your live ISO, and you will get the best mirrors for your installation. Of course, change the countries accordingly to your location. In my case, I am only interested in French, German, and Belgian mirrors.
** Install the system
:PROPERTIES:
:CUSTOM_ID: Install_Arch_Linux-Install_the_system-3ff49aa6
:END:
Then you can use a custom script to ease your installation of Arch if you do
not wish to do it manually. Personally, Ive done it several times already, I
know how the distro works, I just want to be able to install my distro
quickly now. Ill need to download the script with ~wget~, but apparently it
isnt installed by default on Arch ISOs anymore, so Ill need to install it.
Then you can use a custom script to ease your installation of Arch if you do not wish to do it manually. Personally, Ive done it several times already, I know how the distro works, I just want to be able to install my distro quickly now. Ill need to download the script with ~wget~, but apparently it isnt installed by default on Arch ISOs anymore, so Ill need to install it.
#+BEGIN_SRC sh
pacman -S wget
#+END_SRC
@ -77,29 +54,21 @@
sh archfi
#+END_SRC
Then, follow the instructions and install Arch Linux. Take the opportunity to
install as many packages as you need, mainly ~yay~ which I use as my package
manager (it is just a wrapper for ~pacman~) and AUR helper, and
~pacman-contrib~ which will help us installing some packages later.
Then, follow the instructions and install Arch Linux. Take the opportunity to install as many packages as you need, mainly ~yay~ which I use as my package manager (it is just a wrapper for ~pacman~) and AUR helper, and ~pacman-contrib~ which will help us installing some packages later.
Once your system is installed, reboot and remove your installation media from
your computer.
Once your system is installed, reboot and remove your installation media from your computer.
* Execute bootstrap
:PROPERTIES:
:HEADER-ARGS:fish: :tangle ~/.config/yadm/bootstrap :shebang "#!/usr/bin/fish" :exports code :mkdirp yes
:CUSTOM_ID: Execute_bootstrap-e37054ef
:END:
With the installation of Arch with ~archfi~, I will have [[https://github.com/Jguer/yay][yay]], an AUR helper,
installed. This will allow me to have some basic packages installed in order
to run the bootstrap described below. So, lets install ~fish~ (our shell
running the script), ~git~, and my dotfiles manager ~yadm~.
With the installation of Arch with ~archfi~, I will have [[https://github.com/Jguer/yay][yay]], an AUR helper, installed. This will allow me to have some basic packages installed in order to run the bootstrap described below. So, lets install ~fish~ (our shell running the script), ~git~, and my dotfiles manager ~yadm~.
#+BEGIN_SRC sh
yay -Sy fish git yadm
#+END_SRC
~yadm~ comes with a very handy feature: its bootstrap script. It can be
executed automatically once the dotfiles are cloned with yadm:
~yadm~ comes with a very handy feature: its bootstrap script. It can be executed automatically once the dotfiles are cloned with yadm:
#+BEGIN_SRC sh
yadm clone https://labs.phundrak.com/phundrak/dotfiles
# or if labs.phundrak.com is down or too slow for you
@ -112,8 +81,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Decrypt_private_yadm_files-68af7157
:END:
Some private files are stored encrypted in the repository of my yadm
dotfiles. I will need them later on during the bootstrap execution.
Some private files are stored encrypted in the repository of my yadm dotfiles. I will need them later on during the bootstrap execution.
#+BEGIN_SRC fish
if test "$USER" = 'phundrak'
yadm decrypt
@ -126,11 +94,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Get_a_correct_keyboard_layout-77d24b30
:END:
I use mainly the [[https://bepo.fr/wiki/Accueil][bépo]] layout, a French keyboard layout inspired by Dvorak
layouts, however I sometimes need to switch back to the standard French
AZERTY or the American QWERTY layout, so I make it so the Menu key switches
for me my layout between these three. This makes it so my xorg configuration
of my keyboard looks like this:
I use mainly the [[https://bepo.fr/wiki/Accueil][bépo]] layout, a French keyboard layout inspired by Dvorak layouts, however I sometimes need to switch back to the standard French AZERTY or the American QWERTY layout, so I make it so the Menu key switches for me my layout between these three. This makes it so my xorg configuration of my keyboard looks like this:
#+BEGIN_SRC fish
set keyboardconf \
'Section "InputClass"
@ -143,8 +107,7 @@
EndSection'
#+END_SRC
So, lets ask the user if they want to set it as their keyboard
configuration.
So, lets ask the user if they want to set it as their keyboard configuration.
#+BEGIN_SRC fish
printf "\n# Set keyboard layout #########################################################\n\n"
whiptail --yesno "Would you like to set your keyboard layout to the bépo layout?" 8 55
@ -157,8 +120,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Set_our_locale-e74d772a
:END:
I use two main locales, the French and US UTF-8 locales, and I like to keep
the Japanese locale activated just in case.
I use two main locales, the French and US UTF-8 locales, and I like to keep the Japanese locale activated just in case.
#+BEGIN_SRC fish
set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8"
#+END_SRC
@ -208,8 +170,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Create_some_folders-bf701387
:END:
Lets create some folders we might need for mounting our drives, Android
devices and CDs.
Lets create some folders we might need for mounting our drives, Android devices and CDs.
#+BEGIN_SRC fish
printf "\n# Create directories for mounting #############################################\n\n"
sudo mkdir -p /mnt/{USB,CD,Android}
@ -270,8 +231,7 @@
zeal
#+END_SRC
These are the minimum I would have in my own installation. You can edit it
however you want. Lets install those.
These are the minimum I would have in my own installation. You can edit it however you want. Lets install those.
#+BEGIN_SRC fish
printf "\n# Installing needed packages ##################################################\n\n"
sudo pacman -Syu
@ -284,9 +244,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Tangle_configuration_files_from_Org_files-cc524361
:END:
Before tangling our configuration files, we need to create some directories
first so our files can be properly tangled. Heres the list of directories we
need to create:
Before tangling our configuration files, we need to create some directories first so our files can be properly tangled. Heres the list of directories we need to create:
#+NAME: dirs-tangled-files
| $HOME/.config/awesome |
| $HOME/.config/awesome/theme |
@ -329,8 +287,7 @@
<<gen-dirs-tangle()>>
#+END_SRC
The next step is to tangle all the Org files. Here is the list of files that
are to be tangled:
The next step is to tangle all the Org files. Here is the list of files that are to be tangled:
#+NAME: tangled-files
| filename |
|-------------|
@ -406,13 +363,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Setting_up_Emacs:_Installing_Spacemacs-0b3d44b2
:END:
Now, the first thing we want to do with Emacs is install its Spacemacs
distribution. Well clone its =develop= branch into =~/.config/emacs=. We
need to do this prior to our dotfiles cloning because of some submodules
that are cloned within our =~/.config/emacs= directory, and git wont let us
clone Spacemacs in an already existing and non-empty directory. To make sure
it isnt one, lets delete any potentially existing =~/.config/emacs=
directory:
Now, the first thing we want to do with Emacs is install its Spacemacs distribution. Well clone its =develop= branch into =~/.config/emacs=. We need to do this prior to our dotfiles cloning because of some submodules that are cloned within our =~/.config/emacs= directory, and git wont let us clone Spacemacs in an already existing and non-empty directory. To make sure it isnt one, lets delete any potentially existing =~/.config/emacs= directory:
#+BEGIN_SRC fish
printf "\n# Installing Spacemacs ########################################################\n\n"
rm -rf $HOME/.config/emacs $HOME/.emacs* .spacemacs
@ -423,8 +374,7 @@
git clone --branch develop https://github.com/syl20bnr/spacemacs ~/.config/emacs
#+END_SRC
And we can restore what might have been deleted in our =~/.emacs.d/private=
directory:
And we can restore what might have been deleted in our =~/.emacs.d/private= directory:
#+BEGIN_SRC fish
yadm checkout -- ~/.config/emacs/private/
#+END_SRC
@ -437,14 +387,12 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Set_up_dotfiles-Update_our_dotfiles_remotes-5a0fe6f7
:END:
This line in the bootstrap script will test if the current user is using my
username. If yes, its probably me.
This line in the bootstrap script will test if the current user is using my username. If yes, its probably me.
#+BEGIN_SRC fish
if test "$USER" = 'phundrak'
#+END_SRC
If it is me installing and using these dotfiles, I want the remotes of my
dotfiles to be set to ssh remotes using my ssh keys.
If it is me installing and using these dotfiles, I want the remotes of my dotfiles to be set to ssh remotes using my ssh keys.
#+BEGIN_SRC fish
printf "\n# Update yadms remotes #######################################################\n\n"
yadm remote set-url origin git@labs.phundrak.com:phundrak/dotfiles.git
@ -466,8 +414,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Set_up_dotfiles-Update_our_submodules-3e921579
:END:
Now we can download the various dependencies of our dotfiles. To do so,
lets run the following command:
Now we can download the various dependencies of our dotfiles. To do so, lets run the following command:
#+BEGIN_SRC fish
printf "\n# Getting yadm susbmodules ####################################################\n\n"
yadm submodule update --init --recursive
@ -477,22 +424,19 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-3d38d98e
:END:
We have installed some packages which require some services to run. Lets
enable them.
We have installed some packages which require some services to run. Lets enable them.
*** Systemd-timesyncd
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-Systemd-timesyncd-d887e45b
:END:
This service enables time syncing with the NTP protocol, so I can be sure my
computers time is correct. The service first needs to be enabled:
This service enables time syncing with the NTP protocol, so I can be sure my computers time is correct. The service first needs to be enabled:
#+BEGIN_SRC fish
printf "\n# Enabling timesync ###########################################################\n\n"
sudo systemctl enable --now systemd-timesyncd
#+END_SRC
Now, let systemd know I want to use the NTP protocol to keep my computers
time synced.
Now, let systemd know I want to use the NTP protocol to keep my computers time synced.
#+BEGIN_SRC fish
sudo timedatectl set-ntp true
#+END_SRC
@ -501,14 +445,13 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-Docker-305e8309
:END:
First, lets activate Docker.
First, lets activate Docker on startup.
#+BEGIN_SRC fish
printf "\n# Enabling and starting Docker ################################################\n\n"
sudo systemctl enable --now docker
#+END_SRC
Now, if we wish it, we can be added to the =docker= group so we wont have
to type =sudo= each time we call Docker or Docker Compose.
Now, if we wish it, we can be added to the =docker= group so we wont have to type =sudo= each time we call Docker or Docker Compose.
#+BEGIN_SRC fish
read --prompt "echo 'Do you wish to be added to the `docker` group? (Y/n): ' " -l adddockergroup
if test $adddockergroup = 'y' || test $adddockergroup = "Y" || test $adddockergroup = ''
@ -520,11 +463,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-Emacs-c7785c21
:END:
Emacs will run as a user service, which means it wont be launched until we
log in. However, the service wont be started immediately, I personally
prefer to start a standalone instance in which installing and compiling the
Emacs packages will happen, and then once that is done I will start the
service.
Emacs will run as a user service, which means it wont be launched until we log in. However, the service wont be started immediately, I personally prefer to start a standalone instance in which installing and compiling the Emacs packages will happen, and then once that is done I will start the service.
#+BEGIN_SRC fish
printf "\n# Enabling Emacs as user service ##############################################\n\n"
systemctl --user enable emacs
@ -534,8 +473,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-Mpd-f0f5b9b7
:END:
Mpd will also use as a user service in order to get rid of some lines of
code in my configuration.
Mpd will also use as a user service in order to get rid of some lines of code in my configuration.
#+BEGIN_SRC fish
printf "\n# Enabling Mpd as a user service ##############################################\n\n"
mkdir -p ~/.config/mpd/playlists
@ -546,8 +484,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-SSH_server-204f5997
:END:
Maybe we want to activate an SSH server on our machine. If so, we can enable
it. Lets ask the question.
Maybe we want to activate an SSH server on our machine. If so, we can enable it. Lets ask the question.
#+BEGIN_SRC fish
whiptail --yesno 'Do you want to activate the ssh server?' 8 50
if test $status -eq 0
@ -560,9 +497,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-Ly-f4b161c0
:END:
Ly is a display manager based on ncurses which I find nice enough for me to
use (I generally dont like using display managers). Lets enable it, and
lets disable tty2 while were at it (Ly uses it to run X).
Ly is a display manager based on ncurses which I find nice enough for me to use (I generally dont like using display managers). Lets enable it, and lets disable tty2 while were at it (Ly uses it to run X).
#+BEGIN_SRC fish
sudo systemctl disable getty@tty2
sudo systemctl enable --now ly
@ -572,10 +507,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-Acpilight-39152794
:END:
~acpilight~ is our utility managing the brightness of our screen. There is
actually no service to enable here, but we must ensure the user is part of
the ~video~ group so we can modify the brightness of our screen without
using ~sudo~.
~acpilight~ is our utility managing the brightness of our screen. There is actually no service to enable here, but we must ensure the user is part of the ~video~ group so we can modify the brightness of our screen without using ~sudo~.
#+BEGIN_SRC fish
sudo usermod -aG video $USER
#+END_SRC
@ -584,20 +516,14 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Enable_some_services-NordVPN-75c1bd88
:END:
Thanks to the AUR package ~nordvpn-bin~, I no longer have to manually
maintain my VPN connections with OpenVPN. However, it requires a service
that we should activate:
Thanks to the AUR package ~nordvpn-bin~, I no longer have to manually maintain my VPN connections with OpenVPN. However, it requires a service that we should activate:
#+BEGIN_SRC fish
sudo systemctl enable --now nordvpnd
#+END_SRC
Lets also set its default protocol to UDP. This will allow me to use any
port while connected to any WiFi as long as the 443 port is available.
Because yes, I do connect to a WiFi that blocks some important ports, such
as the IMAP and SMTP ports. Thanks University of Paris 8 for being SO
paranoid.
Lets also set its default protocol to UDP. This will allow me to use any port while connected to any WiFi as long as the 443 port is available. Because yes, I do connect to a WiFi that blocks some important ports, such as the IMAP and SMTP ports. Thanks University of Paris 8 for being SO paranoid.
#+BEGIN_SRC fish
nordvpn s protocol udp
nordvpn s protocol tcp
#+END_SRC
** Symlink some system config files
@ -612,13 +538,11 @@
end
#+END_SRC
Lets also symlink the ~plock~ script ([[file:bin.org::#Lock-635fcb38][source here]]) to ~/usr/bin~ so
~xss-lock~ can find it.
Lets also symlink the ~plock~ script ([[file:bin.org::#Lock-635fcb38][source here]]) to ~/usr/bin~ so ~xss-lock~ can find it.
#+BEGIN_SRC fish
sudo ln -s (which plock) /usr/bin/plock
#+END_SRC
** Install packages from git
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Install_packages_from_git-7c6a6ea4
@ -632,8 +556,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Install_packages_from_git-Reveal.JS-bb4da0bf
:END:
I sometimes use Reveal.JS to make presentations, and I set its location in
my [[file:.spacemacs][dotspacemacs]] file to be in =~/fromGIT=, so lets clone it there.
I sometimes use Reveal.JS to make presentations, and I set its location in my [[file:.spacemacs][dotspacemacs]] file to be in =~/fromGIT=, so lets clone it there.
#+BEGIN_SRC fish
printf "\n# Install Reveal.JS ###########################################################\n\n"
cd ~/fromGIT
@ -648,17 +571,13 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Install_Rust-Install_the_toolchains-3480764a
:END:
When using Rust, I bounce between two toolchains, the ~stable~ toolchain and
the ~nightly~ toolchain, although I try to stick with Rust Stable. To
install them, I will use ~rustup~ which has already been installed
previously.
When using Rust, I bounce between two toolchains, the ~stable~ toolchain and the ~nightly~ toolchain, although I try to stick with Rust Stable. To install them, I will use ~rustup~ which has already been installed previously.
#+BEGIN_SRC fish
printf "\n# Install the rust toolchains, nightly is the default one #####################\n\n"
rustup default stable
#+END_SRC
This will both download the stable toolchain and set it as the default one.
Now to install the nightly toolchain, lets run this:
This will both download the stable toolchain and set it as the default one. Now to install the nightly toolchain, lets run this:
#+BEGIN_SRC fish
rustup toolchain install nightly
#+END_SRC
@ -667,8 +586,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Install_Rust-Install_some_utilities-c4a7c785
:END:
Well need some utilities when developing Rust from Emacs, namely ~rustfmt~
and ~racer~. Lets install them with ~cargo~.
Well need some utilities when developing Rust from Emacs, namely ~rustfmt~ and ~racer~. Lets install them with ~cargo~.
#+BEGIN_SRC fish
printf "\n# Add rust utilities ##########################################################\n\n"
cargo install rustfmt racer
@ -703,8 +621,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Install_some_python_packages-a4447a6f
:END:
Some packages will be needed from pip in order to get our Emacs setup
correctly working.
Some packages will be needed from pip in order to get our Emacs setup correctly working.
#+NAME: python-packages-table
| Package | Why |
|-----------------------------+-------------------------|
@ -732,8 +649,7 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Set_up_Chicken_(Scheme_interpreter-compiler)-3c1a3c4a
:END:
Chicken needs to be set up before being used. First, we need to install its
documentation.
Chicken needs to be set up before being used. First, we need to install its documentation.
#+BEGIN_SRC fish
printf "\n# Setting up Chicken ##########################################################\n\n"
chicken-install -s apropos chicken-doc
@ -749,15 +665,13 @@
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Set_up_our_fish_shell-f0741c22
:END:
The last thing we want to do is to set up our fish shell with some extensions
in order to improve the user experience.
The last thing we want to do is to set up our fish shell with some extensions in order to improve the user experience.
*** Install ~fisher~
:PROPERTIES:
:CUSTOM_ID: Execute_bootstrap-Set_up_our_fish_shell-Install_=fisher=-3a44531b
:END:
We will be using ~fisher~ as our extensions manager for Fish. Lets install
it.
We will be using ~fisher~ as our extensions manager for Fish. Lets install it.
#+BEGIN_SRC fish
printf "\n# Installing fisher ###########################################################\n\n"
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish

View File

@ -10,33 +10,21 @@
:PROPERTIES:
:CUSTOM_ID: Introduction-7e535842
:END:
*Before proceeding, be aware that I deprecated this nano config on August
28th, 2020, meaning I wont update it anymore unless I use it again some day
in the future. I will keep it on my website though.*
*Before proceeding, be aware that I deprecated this nano config on August 28th, 2020, meaning I wont update it anymore unless I use it again some day in the future. I will keep it on my website though.*
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
wont work or wont 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:
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 wont work or wont 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/=.
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=.)
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
@ -45,10 +33,7 @@
: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.
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
@ -62,8 +47,7 @@
unset casesensitive
#+END_SRC
Do regular-expression searches by default. Regular expressions in =nano= are
of the extended type (ERE).
Do regular-expression searches by default. Regular expressions in =nano= are of the extended type (ERE).
#+BEGIN_SRC conf
set regexp
#+END_SRC
@ -72,10 +56,7 @@
: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=.
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
@ -85,8 +66,7 @@
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.
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
@ -96,8 +76,7 @@
set linenumbers
#+END_SRC
Constantly display the cursor position in the status bar. This overrides the
option =quickblank=.
Constantly display the cursor position in the status bar. This overrides the option =quickblank=.
#+BEGIN_SRC conf
set constantshow
#+END_SRC
@ -111,21 +90,17 @@
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.
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).
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.
Remove trailing whitespace from wrapped lines when automatic hard-wrapping occurs or when text is justified.
#+BEGIN_SRC conf
set trimblanks
#+END_SRC
@ -134,10 +109,7 @@
: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.
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

View File

@ -32,15 +32,12 @@
:PROPERTIES:
:CUSTOM_ID: Core_Ncmpcpp_settings-Directories-28092c92
:END:
Ncmpcpp has two vital directories: the lyrics directory, and its own
configuration directory. The configuration for ncmpcpp is generally either in
~$HOME/.ncmpcpp/~ or in ~$XDG_CONFIG_HOME/ncmpcpp/~.
Ncmpcpp has two vital directories: the lyrics directory, and its own configuration directory. The configuration for ncmpcpp is generally either in ~$HOME/.ncmpcpp/~ or in ~$XDG_CONFIG_HOME/ncmpcpp/~.
#+BEGIN_SRC conf
ncmpcpp_directory = ~/.config/ncmpcpp
#+END_SRC
When it comes to the lyrics, be sure to set the directory to the same
directory pointed at by Mpd.
When it comes to the lyrics, be sure to set the directory to the same directory pointed at by Mpd.
#+BEGIN_SRC conf
lyrics_directory = ~/.lyrics
#+END_SRC
@ -49,12 +46,7 @@
:PROPERTIES:
:CUSTOM_ID: Core_Ncmpcpp_settings-MPD-a2a7452e
:END:
These settings tell ncmpcpp how to communicate with Mpd. Once again, be sure
to follow your own MPD settings. In my case, I am connecting to my local MPD
server, hence the ~localhost~ value of the variable below, and I did not
change the default port of MPD. My music is located at =~/Music=, and ncmpcpp
should connect pretty much immediately, although I allow a five seconds
timeout before ncmpcpp treats it as an error. Also, no crossfade please.
These settings tell ncmpcpp how to communicate with Mpd. Once again, be sure to follow your own MPD settings. In my case, I am connecting to my local MPD server, hence the ~localhost~ value of the variable below, and I did not change the default port of MPD. My music is located at =~/Music=, and ncmpcpp should connect pretty much immediately, although I allow a five seconds timeout before ncmpcpp treats it as an error. Also, no crossfade please.
#+BEGIN_SRC conf
mpd_host = localhost
mpd_port = 6600

View File

@ -11,36 +11,23 @@
:PROPERTIES:
:CUSTOM_ID: Introduction-5942aea3
:END:
[[https://github.com/dylanaraps/neofetch][Neofetch]] is a CLI utility used to display system information. It was written
in Bash, and thus its configuration file is written as a Bash script too. This
document was written with org-mode, and my configuration file is tangled from
the source blocks you will see below to ~~/.config/neofetch/config.conf~.
This configuration will only contain what I need. For any further information,
please refer to the [[https://github.com/dylanaraps/neofetch][original repository]] and [[https://github.com/dylanaraps/neofetch/wiki/Customizing-Info][its documentation]].
[[https://github.com/dylanaraps/neofetch][Neofetch]] is a CLI utility used to display system information. It was written in Bash, and thus its configuration file is written as a Bash script too. This document was written with org-mode, and my configuration file is tangled from the source blocks you will see below to ~~/.config/neofetch/config.conf~. This configuration will only contain what I need. For any further information, please refer to the [[https://github.com/dylanaraps/neofetch][original repository]] and [[https://github.com/dylanaraps/neofetch/wiki/Customizing-Info][its documentation]].
* The ~print_info~ functions
:PROPERTIES:
:CUSTOM_ID: The_print_info_functions-bb30763f
:END:
The ~print_info~ function is the function called by Neofetch in order to print
the system information it could fetch. In this function, well choose what to
display, and how. This function looks like this:
The ~print_info~ function is the function called by Neofetch in order to print the system information it could fetch. In this function, well choose what to display, and how. This function looks like this:
#+BEGIN_SRC sh :tangle no
print_info() {
# Print information here…
}
#+END_SRC
Generally, what we will display will be shown through the ~info~ function,
redefined inside Neofetch (this is not ~info(1)~). This ~info~ function
accepts one or two arguments. With one argument, such as with ~info memory~,
we can get a result that looks like ~5136MiB / 15873MiB~, while calling it
with two arguments will treat the first one as a prefix and the second one as
the interesting information; ~info "Memory" memory~ will look like
~Memory: 5136MiB / 15873MiB~. Here is what we want to display:
Generally, what we will display will be shown through the ~info~ function, redefined inside Neofetch (this is not ~info(1)~). This ~info~ function accepts one or two arguments. With one argument, such as with ~info memory~, we can get a result that looks like ~5136MiB / 15873MiB~, while calling it with two arguments will treat the first one as a prefix and the second one as the interesting information; ~info "Memory" memory~ will look like ~Memory: 5136MiB / 15873MiB~. Here is what we want to display:
#+NAME: info-elements-table
| Prefix | Information | What it does |
|----------+-------------+-----------------------------------|
|----------+-------------+------------------------------|
| | title | Username and hostname |
| | line_break | Insert a blank line |
| | cols | System theme |
@ -101,11 +88,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-9d4cfe88
:END:
Each of the following variable tunes a function that can be called in
~print_info~ described above. It is possible to tune them by modifying this
document or the configuration file itself, and they can be overridden by the
command line with flags passed to ~neofetch~. I will divide these variables in
two main categories: hardware and software-related properties.
Each of the following variable tunes a function that can be called in ~print_info~ described above. It is possible to tune them by modifying this document or the configuration file itself, and they can be overridden by the command line with flags passed to ~neofetch~. I will divide these variables in two main categories: hardware and software-related properties.
** Software
:PROPERTIES:
@ -175,7 +158,6 @@
:CUSTOM_ID: Information_settings-Software-OS-Packages-f836a58d
:END:
It is possible to show or hide Package Manager names.
- Default :: ~'tiny'~
- Values :: ~'on'~ / ~'tiny'~ / ~'off'~
- Flag :: ~--package_managers~
@ -195,8 +177,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-Shell-Shell_path-9eda636d
:END:
This allows to show either the path of the users shell, or simply its
name.
This allows to show either the path of the users shell, or simply its name.
- Default value :: ~"off"~
- Values ::
- ~"on"~
@ -205,9 +186,9 @@
- Examples ::
- on :: ~/bin/bash~
- off :: ~bash~
#+begin_src sh
+begin_src sh
shell_path="off"
#+end_src
+end_src
***** Shell version
:PROPERTIES:
@ -250,9 +231,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-IP_address-26df5e1d
:END:
It is possible to display the machines public IP address with the function
~ip~. The value below allows the user to change the website used to fetch
it.
It is possible to display the machines public IP address with the function ~ip~. The value below allows the user to change the website used to fetch it.
- Default value :: ~"http://ident.me"~
- Value :: ~"url"~
- Flag :: ~--ip_host~
@ -276,16 +255,13 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-Theming-ba7f1ccd
:END:
This section will allow the user to modify what Neofetch can and cannot
display about the machines theming —by this, I mean its GTK theme, its
icons and its default font.
This section will allow the user to modify what Neofetch can and cannot display about the machines theming —by this, I mean its GTK theme, its icons and its default font.
**** Shorten output
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-Theming-Shorten_output-cbef1fa4
:END:
With this value, it is possible to shorten the output of the computers
theming.
With this value, it is possible to shorten the output of the computers theming.
- Default value :: ~"off"~
- Values ::
- ~"on"~
@ -302,8 +278,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Software-Theming-Enable_or_disable_theming_display_for_GTK2-f4398571
:END:
It is possible to explicitely show or hide the computers theming with GTK2
with this variable.
It is possible to explicitely show or hide the computers theming with GTK2 with this variable.
- Default value :: ~"on"~
- Values ::
- ~"on"~
@ -330,6 +305,7 @@
- on :: ~Numix [GTK2], Adwaita [GTK3]~
- off :: ~Numix [GTK2]~
#+begin_src sh
gtk3="off"
#+end_src
** Hardware
@ -340,7 +316,6 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-CPU-eb0bcd7d
:END:
**** CPU brand
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_brand-5b25776b
@ -380,9 +355,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_speed_type-a24de48f
:END:
This allows Neofetch to know what type of speed it has to fetch regarding
the machines CPU. Any file in ~/sys/devices/system/cpu/cpu0/cpufreq~ can
be used as a value.
This allows Neofetch to know what type of speed it has to fetch regarding the machines CPU. Any file in ~/sys/devices/system/cpu/cpu0/cpufreq~ can be used as a value.
- Default value :: ~"bios_limit"~
- Values ::
- ~"scaling_cur_freq"~
@ -399,8 +372,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_speed_shorthand-0d15fe08
:END:
This value allows to show sorter CPU speed with less digits. This flag is
not supported in systems with CPU speed below 1GHz.
This value allows to show sorter CPU speed with less digits. This flag is not supported in systems with CPU speed below 1GHz.
- Default value :: ~"off"~
- Values ::
- ~"on"~
@ -417,8 +389,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_cores-30177354
:END:
With this variable, it is possible to display the number of cores that are
available in the CPU.
With this variable, it is possible to display the number of cores that are available in the CPU.
- Default value :: ~"logical"~
- Values ::
- ~"logical"~
@ -438,10 +409,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-CPU-CPU_temperature-a22e522c
:END:
This variable allows the user to hide or show the CPUs temperature, and if
shown, the user can display it in Celcius or Farenheit degrees. For FreeBSD
and NetBSD-based systems, youll need to enable the ~coretemp~ kernel
module. This only supports newer Intel processors.
This variable allows the user to hide or show the CPUs temperature, and if shown, the user can display it in Celcius or Farenheit degrees. For FreeBSD and NetBSD-based systems, youll need to enable the ~coretemp~ kernel module. This only supports newer Intel processors.
- Default value :: ~"off"~
- Values ::
- ~"C"~
@ -461,16 +429,13 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-GPU-2c842575
:END:
The function responsible for displaying information regarding the GPUs is
~gpu~. It will try to list all available GPUs and display what it knows
about them.
The function responsible for displaying information regarding the GPUs is ~gpu~. It will try to list all available GPUs and display what it knows about them.
**** GPU brand
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-GPU-GPU_brand-6e2da615
:END:
This value allows the user to hide or show the brand of their GPU in the
output of ~gpu~.
This value allows the user to hide or show the brand of their GPU in the output of ~gpu~.
- Default value :: ~"on"~
- Values ::
- ~"on"~
@ -488,8 +453,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-GPU-Which_GPU_to_display-f40d3aac
:END:
This allows the user to choose which GPU appears in the output of the
function ~gpu~.
This allows the user to choose which GPU appears in the output of the function ~gpu~.
- Default value :: ~"all"~
- Values ::
- ~"all"~
@ -513,8 +477,7 @@
:PROPERTIES:
:CUSTOM_ID: Information_settings-Hardware-Resolution-b768f865
:END:
This will try to list all the connected screens and display their resolution
individually. It is possible to display the refresh rate or to hide it.
This will try to list all the connected screens and display their resolution individually. It is possible to display the refresh rate or to hide it.
- Default value :: ~"off"~
- Values ::
- ~"on"~

View File

@ -9,25 +9,18 @@
:PROPERTIES:
:CUSTOM_ID: Introduction-a5320326
:END:
Picom is the successor to Compton, a standalone compositor for Xorg. It
provides compositing for WM that do not provide any, such as i3. I am
currently using [[https://github.com/ibhagwan/picom][ibhagwans fork of compton]] which provides the ~dual-kawase~
blur from [[https://github.com/tryone144/compton][tryones compton]] and rounded corners from [[https://github.com/sdhand/picom][sdhands compton]].
Picom is the successor to Compton, a standalone compositor for Xorg. It provides compositing for WM that do not provide any, such as i3. I am currently using [[https://github.com/ibhagwan/picom][ibhagwans fork of compton]] which provides the ~dual-kawase~ blur from [[https://github.com/tryone144/compton][tryones compton]] and rounded corners from [[https://github.com/sdhand/picom][sdhands compton]].
* Shadows
:PROPERTIES:
:CUSTOM_ID: Shadows-f4ffbb27
:END:
The following enables client-side shadows on windows. Note desktop windows
(windows with ~_NET_WM_WINDOW_TYPE_DESKTOP~) never get shadow, unless
explicitly requested using the wintypes option. I personally deactivated
shadows because they dont work out too well with rounded corners.
The following enables client-side shadows on windows. Note desktop windows (windows with ~_NET_WM_WINDOW_TYPE_DESKTOP~) never get shadow, unless explicitly requested using the wintypes option. I personally deactivated shadows because they dont work out too well with rounded corners.
#+BEGIN_SRC conf
shadow = false;
#+END_SRC
The blur radius radius for shadows is measured in pixels, and it defaults to
12px.
The blur radius radius for shadows is measured in pixels, and it defaults to 12px.
#+BEGIN_SRC conf
shadow-radius = 7;
#+END_SRC
@ -97,26 +90,19 @@
:END:
Options in this subheader *will not* be exported to my configuration file.
Thanks to this value, Picom can avoid drawing shadows on dock or panel
windows. This option is deprecated, and users should use the ~wintypes~
option in their config file instead.
Thanks to this value, Picom can avoid drawing shadows on dock or panel windows. This option is deprecated, and users should use the ~wintypes~ option in their config file instead.
| Default value | ~false~ |
#+BEGIN_SRC conf
no-dock-shadow = false;
#+END_SRC
This option allows Picom not to draw on drag-and-drop windows. This option is
deprecated, and users should use the ~wintypes~ option in their config file
instead.
This option allows Picom not to draw on drag-and-drop windows. This option is deprecated, and users should use the ~wintypes~ option in their config file instead.
| Default value | ~false~ |
#+BEGIN_SRC conf
no-dnd-shadow = false;
#+END_SRC
~shadow-ignore-shaped~ is also deprecated. It used to indicate Picom not to
paint shadows on shaped windows. Note shaped windows here means windows
setting their shape through X Shape extension. Those using ARGB background
are beyond Picoms control. Since it is deprecated, you could instead use
~shadow-ignore-shaped~ is also deprecated. It used to indicate Picom not to paint shadows on shaped windows. Note shaped windows here means windows setting their shape through X Shape extension. Those using ARGB background are beyond Picoms control. Since it is deprecated, you could instead use
#+BEGIN_SRC conf :tangle no
shadow-exclude = 'bounding_shaped'
#+END_SRC
@ -133,15 +119,12 @@
:PROPERTIES:
:CUSTOM_ID: Rounded_corners-33bfcd20
:END:
A great feature added by ibhagwans fork of compton is the addition of rounded
corners from sdhands fork, and the Kawase blur (described [[#Background_blurring-55835066][here]]) from
tryone144s fork. Here we can see the declaration of the corners radius:
A great feature added by ibhagwans fork of picom is the addition of rounded corners from sdhands fork, and the Kawase blur (described [[#Background_blurring-55835066][here]]) from tryone144s fork. Here we can see the declaration of the corners radius:
#+BEGIN_SRC conf
corner-radius = 9.0;
#+END_SRC
It is also possible to exclude some windows from getting their corners
rounded. I personally excluded any window generated by AwesomeWM.
It is also possible to exclude some windows from getting their corners rounded. I personally excluded any window generated by AwesomeWM.
#+BEGIN_SRC conf
rounded-corners-exclude = [
"_NET_WM_WINDOW_TYPE@[0]:a = '_NET_WM_WINDOW_TYPE_DOCK'"
@ -152,17 +135,13 @@
:PROPERTIES:
:CUSTOM_ID: Fading-419d8047
:END:
Picom has the ability to create some fading effects on windows when opening or
closing or when the opacity changes. The following parameter toggles this
feature on or off. However, its behavior can be changed with
~no-fading-openclose~.
Picom has the ability to create some fading effects on windows when opening or closing or when the opacity changes. The following parameter toggles this feature on or off. However, its behavior can be changed with ~no-fading-openclose~.
| Default value | ~false~ |
#+BEGIN_SRC conf
fading = true
#+END_SRC
These values controls the opacity change between steps while fading in and
out.
These values controls the opacity change between steps while fading in and out.
| Default value | ~0.028~ (fade-in), ~0.03~ (fade-out) |
| Min value | ~0.01~ |
| Max value | ~1.0~ |
@ -178,8 +157,7 @@
fade-delta = 20;
#+END_SRC
It is possible to exclude some windows that should not be faded with a
specified list of conditions.
It is possible to exclude some windows that should not be faded with a specified list of conditions.
| Default value | ~[]~ |
#+BEGIN_SRC conf
fade-exclude = [ "class_g = 'mpv'" ];
@ -191,8 +169,7 @@
no-fading-openclose = true;
#+END_SRC
Finally, this option is a workaround for Openbox, Fluxbox and others by not
fading destroyed ARGB windows with WM frame.
Finally, this option is a workaround for Openbox, Fluxbox and others by not fading destroyed ARGB windows with WM frame.
| Default value | ~false~ |
#+BEGIN_SRC conf
no-fading-destroyed-argb = false
@ -202,9 +179,7 @@
:PROPERTIES:
:CUSTOM_ID: Transparency_and_opacity-6c6b36d2
:END:
Picom is also able to create some opacity or transparency for windows,
depending on their state or on some user-defined rules. For instance, the
following value describes the opacity of inactive windows.
Picom is also able to create some opacity or transparency for windows, depending on their state or on some user-defined rules. For instance, the following value describes the opacity of inactive windows.
| Default value | ~1.0~ |
| Min value | ~0.1~ |
| Max value | ~1.0~ |
@ -212,8 +187,7 @@
inactive-opacity = 0.6;
#+END_SRC
On the other hand, it is possible to declare a default opacity for active
windows.
On the other hand, it is possible to declare a default opacity for active windows.
| Default value | ~1.0~ |
| Min value | ~0.1~ |
| Max value | ~1.0~ |
@ -237,15 +211,13 @@
# menu-opacity = 0.9;
#+END_SRC
~inactive-opacity-override~ allows the user to let inactive opacity set by
~-i~ override the ~_NET_WM_OPACITY_ values of windows.
~inactive-opacity-override~ allows the user to let inactive opacity set by ~-i~ override the ~_NET_WM_OPACITY_ values of windows.
| Default value | ~true~ |
#+BEGIN_SRC conf
inactive-opacity-override = true;
#+END_SRC
While it is possible to alter opacity on inactive windows, it is also possible
to dim them.
While it is possible to alter opacity on inactive windows, it is also possible to dim them.
| Default value | ~1.0~ |
| Min value | ~0.1~ |
| Max value | ~1.0~ |
@ -253,8 +225,7 @@
# inactive-dim = 1.0
#+END_SRC
It is also possible to use a fixed inactive dim value, instead of adjusting
according to window opacity.
It is also possible to use a fixed inactive dim value, instead of adjusting according to window opacity.
| Default value | ~1.0~ |
| Min value | ~0.1~ |
| Max value | ~1.0~ |
@ -262,31 +233,23 @@
# inactive-dim-fixed = 1.0
#+END_SRC
It is also possible to specify a list of conditions of windows that should
always be considered focused.
It is also possible to specify a list of conditions of windows that should always be considered focused.
| Default value | ~[]~ |
#+BEGIN_SRC conf
focus-exclude = [ "class_g = 'mpv'" ];
#+END_SRC
The user can also specify a list of opacity rules, in the format
~PERCENT:PATTERN~, like ~50:name *= "Firefox"~. picom-trans is recommended
over this. Note we don't make any guarantee about possible conflicts with
other programs that set ~_NET_WM_WINDOW_OPACITY~ on frame or client windows.
The user can also specify a list of opacity rules, in the format ~PERCENT:PATTERN~, like ~50:name *= "Firefox"~ . ~picom-trans~ is recommended over this. Note we don't make any guarantee about possible conflicts with other programs that set ~_NET_WM_WINDOW_OPACITY~ on frame or client windows.
| Default value | ~[]~ |
#+BEGIN_SRC conf
opacity-rule = [
"85:class_g = 'Polybar'",
# "55:class_g *?= 'Rofi'",
];
opacity-rule = [];
#+END_SRC
* Background blurring
:PROPERTIES:
:CUSTOM_ID: Background_blurring-55835066
:END:
The following are the parameters for background blurring, see the \*BLUR\*
section for more information.
The following are the parameters for background blurring, see the \*BLUR\* section for more information.
#+BEGIN_SRC conf
blur: {
method = "dual_kawase";
@ -297,30 +260,25 @@
}
#+END_SRC
This value enables or disables the blur for the background of semi-transparent
or ARGB windows. It has bad performances though, with driver-dependent
behavior. The name of the switch may change without prior notifications.
This value enables or disables the blur for the background of semi-transparent or ARGB windows. It has bad performances though, with driver-dependent behavior. The name of the switch may change without prior notifications.
| Default value | ~false~ |
#+BEGIN_SRC conf
blur-background = true;
#+END_SRC
Blur background of windows when the window frame is not opaque. If true, this
implies the value ~true~ for ~blur-background~.
Blur background of windows when the window frame is not opaque. If true, this implies the value ~true~ for ~blur-background~.
| Default value | ~false~ |
#+BEGIN_SRC conf
blur-background-frame = true;
#+END_SRC
The following determines whether to use fixed blur strength rather than
adjusting according to window opacity.
The following determines whether to use fixed blur strength rather than adjusting according to window opacity.
| Default value | ~false~ |
#+BEGIN_SRC conf
blur-background-fixed = false;
#+END_SRC
Specify the blur convolution kernel, with the format
~"5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"~.
Specify the blur convolution kernel, with the format ~"5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"~.
| Default value | ~""~ |
#+BEGIN_SRC conf
# blur-kern = "3x3box";
@ -341,15 +299,13 @@
:PROPERTIES:
:CUSTOM_ID: General_settings-41398de7
:END:
Daemonize process. Fork to background after initialization. Causes issues
with certain (badly-written) drivers.
Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
| Default value | ~false~ |
#+BEGIN_SRC conf
daemon = true;
#+END_SRC
Picom has three backends it can use: ~xrender~, ~glx~, and ~xr_glx_hybrid~.
GLX backend is typically much faster but depends on a sane driver.
Picom has three backends it can use: ~xrender~, ~glx~, and ~xr_glx_hybrid~. GLX backend is typically much faster but depends on a sane driver.
| Default value | ~xrender~ |
#+BEGIN_SRC conf
backend = "glx";
@ -361,73 +317,60 @@
vsync = true;
#+END_SRC
Enable remote control via D-Bus. See the *D-BUS API* section below for more
details.
Enable remote control via D-Bus. See the *D-BUS API* section below for more details.
| Default value | ~false~ |
#+BEGIN_SRC conf
dbus = false;
#+END_SRC
Try to detect WM windows (a non-override-redirect window with no child that
has ~WM_STATE~) and markz them as active.
Try to detect WM windows (a non-override-redirect window with no child that has ~WM_STATE~) and markz them as active.
| Default value | ~false~ |
#+BEGIN_SRC conf
mark-wmwin-focused = true;
#+END_SRC
Mark override-redirect windows that doesn't have a child window with
~WM_STATE~ focused.
Mark override-redirect windows that doesn't have a child window with ~WM_STATE~ focused.
| Default value | ~false~ |
#+BEGIN_SRC conf
mark-ovredir-focused = true;
#+END_SRC
Try to detect windows with rounded corners and don't consider them shaped
windows. The accuracy is not very high, unfortunately.
Try to detect windows with rounded corners and don't consider them shaped windows. The accuracy is not very high, unfortunately.
| Default value | ~false~ |
#+BEGIN_SRC conf
detect-rounded-corners = true;
#+END_SRC
Detect ~_NET_WM_OPACITY~ on client windows, useful for window managers not
passing ~_NET_WM_OPACITY~ of client windows to frame windows.
Detect ~_NET_WM_OPACITY~ on client windows, useful for window managers not passing ~_NET_WM_OPACITY~ of client windows to frame windows.
| Default value | ~false~ |
#+BEGIN_SRC conf
detect-client-opacity = true;
#+END_SRC
Specify refresh rate of the screen. If not specified or 0, picom will try
detecting this with X RandR extension.
Specify refresh rate of the screen. If not specified or 0, picom will try detecting this with X RandR extension.
| Default value | ~60~ |
#+BEGIN_SRC conf
refresh-rate = 60;
refresh-rate = 120;
#+END_SRC
Limit picom to repaint at most once every 1 / ~refresh_rate~ second to boost
performance. This should not be used with
Limit picom to repaint at most once every 1 / ~refresh_rate~ second to boost performance. This should not be used with
#+BEGIN_SRC text :tangle no
vsync drm/opengl/opengl-oml
#+END_SRC
as they essentially does sw-opti's job already, unless you wish to specify a
lower refresh rate than the actual value.
as they essentially does sw-opti's job already, unless you wish to specify a lower refresh rate than the actual value.
| Default value | ~""~ |
#+BEGIN_SRC conf
# sw-opti =;
#+END_SRC
Use EWMH ~_NET_ACTIVE_WINDOW~ to determine currently focused window, rather
than listening to ~FocusIn~/~FocusOut~ event. Might have more accuracy,
provided that the WM supports it.
Use EWMH ~_NET_ACTIVE_WINDOW~ to determine currently focused window, rather than listening to ~FocusIn~/~FocusOut~ event. Might have more accuracy, provided that the WM supports it.
| Default value | ~false~ |
#+BEGIN_SRC conf
# use-ewmh-active-win = false;
#+END_SRC
Unredirect all windows if a full-screen opaque window is detected, to maximize
performance for full-screen windows. Known to cause flickering when
redirecting/unredirecting windows. paint-on-overlay may make the flickering
less obvious.
Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows. Known to cause flickering when redirecting/unredirecting windows. paint-on-overlay may make the flickering less obvious.
| Default value | ~false~ |
#+BEGIN_SRC conf
unredir-if-possible = false;
@ -439,91 +382,67 @@
unredir-if-possible-delay = 0;
#+END_SRC
Conditions of windows that shouldn't be considered full-screen for
unredirecting screen.
Conditions of windows that shouldn't be considered full-screen for unredirecting screen.
| Default value | ~[]~ |
#+BEGIN_SRC conf
unredir-if-possible-exclude = [];
#+END_SRC
Use ~WM_TRANSIENT_FOR~ to group windows, and consider windows in the same
group focused at the same time.
Use ~WM_TRANSIENT_FOR~ to group windows, and consider windows in the same group focused at the same time.
| Default value | ~false~ |
#+BEGIN_SRC conf
detect-transient = true;
#+END_SRC
Use ~WM_CLIENT_LEADER~ to group windows, and consider windows in the same
group focused at the same time. ~WM_TRANSIENT_FOR~ has higher priority if
detect-transient is enabled, too.
Use ~WM_CLIENT_LEADER~ to group windows, and consider windows in the same group focused at the same time. ~WM_TRANSIENT_FOR~ has higher priority if detect-transient is enabled, too.
| Default value | ~false~ |
#+BEGIN_SRC conf
detect-client-leader = true;
#+END_SRC
Resize damaged region by a specific number of pixels. A positive value
enlarges it while a negative one shrinks it. If the value is positive, those
additional pixels will not be actually painted to screen, only used in blur
calculation, and such. (Due to technical limitations, with use-damage, those
pixels will still be incorrectly painted to screen.) Primarily used to fix the
line corruption issues of blur, in which case you should use the blur radius
value here (e.g. with a 3x3 kernel, you should use ~--resize-damage 1~, with a
5x5 one you use ~--resize-damage 2~, and so on). May or may not work with
*--glx-no-stencil*. Shrinking doesn't function correctly.
Resize damaged region by a specific number of pixels. A positive value enlarges it while a negative one shrinks it. If the value is positive, those additional pixels will not be actually painted to screen, only used in blur calculation, and such. (Due to technical limitations, with use-damage, those pixels will still be incorrectly painted to screen.) Primarily used to fix the line corruption issues of blur, in which case you should use the blur radius value here (e.g. with a 3x3 kernel, you should use ~--resize-damage 1~, with a 5x5 one you use ~--resize-damage 2~, and so on). May or may not work with ~--glx-no-stencil~. Shrinking doesn't function correctly.
| Default value | ~1~ |
#+BEGIN_SRC conf
resize-damage = 1;
#+END_SRC
Specify a list of conditions of windows that should be painted with inverted
color. Resource-hogging, and is not well tested.
Specify a list of conditions of windows that should be painted with inverted color. Resource-hogging, and is not well tested.
| Default value | ~[]~ |
#+BEGIN_SRC conf
invert-color-include = [];
#+END_SRC
Disable the use of damage information. This cause the whole screen to be
redrawn everytime, instead of the part of the screen has actually changed.
Potentially degrades the performance, but might fix some artifacts. The
opposing option is use-damage
Disable the use of damage information. This cause the whole screen to be redrawn everytime, instead of the part of the screen has actually changed. Potentially degrades the performance, but might fix some artifacts. The opposing option is use-damage
| Default value | ~false~ |
#+BEGIN_SRC conf
use-damage = false;
#+END_SRC
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are
finished before picom starts drawing. Needed on nvidia-drivers with GLX
backend for some users.
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are finished before picom starts drawing. Needed on nvidia-drivers with GLX backend for some users.
| Default value | ~false~ |
#+BEGIN_SRC conf
xrender-sync-fence = false;
#+END_SRC
Force all windows to be painted with blending. Useful if you have a
glx-fshader-win that could turn opaque pixels transparent.
Force all windows to be painted with blending. Useful if you have a glx-fshader-win that could turn opaque pixels transparent.
| Default value | ~false~ |
#+BEGIN_SRC conf
force-win-blend = false;
#+END_SRC
Do not use EWMH to detect fullscreen windows. Reverts to checking if a window
is fullscreen based only on its size and coordinates.
Do not use EWMH to detect fullscreen windows. Reverts to checking if a window is fullscreen based only on its size and coordinates.
| Default value | ~false~ |
#+BEGIN_SRC conf
no-ewmh-fullscreen = false;
#+END_SRC
Dimming bright windows so their brightness doesn't exceed this set value.
Brightness of a window is estimated by averaging all pixels in the window, so
this could comes with a performance hit. Setting this to 1.0 disables this
behaviour. Requires ~--use-damage~ to be disabled.
Dimming bright windows so their brightness doesn't exceed this set value. Brightness of a window is estimated by averaging all pixels in the window, so this could comes with a performance hit. Setting this to 1.0 disables this behaviour. Requires ~--use-damage~ to be disabled.
| Default value | ~1.0~ |
#+BEGIN_SRC conf
max-brightness = 1.0;
#+END_SRC
Make transparent windows clip other windows like non-transparent windows do,
instead of blending on top of them.
Make transparent windows clip other windows like non-transparent windows do, instead of blending on top of them.
| Default value | ~false~ |
#+BEGIN_SRC conf
transparent-clipping = false;
@ -535,18 +454,13 @@
- ~info~
- ~warn~
- ~error~
in increasing level of importance. Case doesn't matter. If using the "TRACE"
log level, it's better to log into a file using ~--log-file~, since it can
generate a huge stream of logs.
in increasing level of importance. Case doesn't matter. If using the "TRACE" log level, it's better to log into a file using ~--log-file~, since it can generate a huge stream of logs.
| Default value | ~"debug"~ |
#+BEGIN_SRC conf
log-level = "warn";
#+END_SRC
Set the log file. If ~--log-file~ is never specified, logs will be written to
stderr. Otherwise, logs will to written to the given file, though some of the
early logs might still be written to the stderr. When setting this option from
the config file, it is recommended to use an absolute path.
Set the log file. If ~--log-file~ is never specified, logs will be written to stderr. Otherwise, logs will to written to the given file, though some of the early logs might still be written to the stderr. When setting this option from the config file, it is recommended to use an absolute path.
| Default value | ~''~ |
#+BEGIN_SRC conf
# log-file = '/path/to/your/log/file';
@ -564,8 +478,7 @@
# write-pid-path = '/path/to/your/log/file';
#+END_SRC
Window type settings. ~WINDOW_TYPE~ is one of the 15 window types defined in
EWMH standard:
Window type settings. ~WINDOW_TYPE~ is one of the 15 window types defined in EWMH standard:
- ~"unknown"~
- ~"desktop"~
- ~"dock"~
@ -584,16 +497,9 @@
Following per window-type options are available:
- fade, shadow :: Controls window-type-specific shadow and fade settings.
- opacity :: Controls default opacity of the window type.
- focus :: Controls whether the window of this type is to be always considered
focused. (By default, all window types except "normal" and "dialog" has this
on.)
- full-shadow :: Controls whether shadow is drawn under the parts of the
window that you normally won't be able to see. Useful when the window has
parts of it transparent, and you want shadows in those areas.
- redir-ignore :: Controls whether this type of windows should cause screen to
become redirected again after been unredirected. If you have
unredir-if-possible set, and doesn't want certain window to cause
unnecessary screen redirection, you can set this to `true`.
- focus :: Controls whether the window of this type is to be always considered focused. (By default, all window types except "normal" and "dialog" has this on.)
- full-shadow :: Controls whether shadow is drawn under the parts of the window that you normally won't be able to see. Useful when the window has parts of it transparent, and you want shadows in those areas.
- redir-ignore :: Controls whether this type of windows should cause screen to become redirected again after been unredirected. If you have unredir-if-possible set, and doesn't want certain window to cause unnecessary screen redirection, you can set this to `true`.
#+BEGIN_SRC conf
wintypes:
{
@ -609,26 +515,19 @@
:PROPERTIES:
:CUSTOM_ID: General_settings-GLX_backend-specific_options-43892981
:END:
Avoid using stencil buffer, useful if you don't have a stencil buffer. Might
cause incorrect opacity when rendering transparent content (but never
practically happened) and may not work with blur-background. Tests show a 15%
performance boost. Recommended.
Avoid using stencil buffer, useful if you don't have a stencil buffer. Might cause incorrect opacity when rendering transparent content (but never practically happened) and may not work with blur-background. Tests show a 15% performance boost. Recommended.
| Default value | ~false~ |
#+BEGIN_SRC conf
glx-no-stencil = true;
#+END_SRC
Avoid rebinding pixmap on window damage. Probably could improve performance
on rapid window content changes, but is known to break things on some drivers
(LLVMpipe, xf86-video-intel, etc.). Recommended if it works.
Avoid rebinding pixmap on window damage. Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). Recommended if it works.
| Default value | ~false~ |
#+BEGIN_SRC conf
glx-no-rebind-pixmap = false;
#+END_SRC
Use specified GLSL fragment shader for rendering window contents. See
~compton-default-fshader-win.glsl~ and
~compton-fake-transparency-fshader-win.glsl~ in the source tree for examples.
Use specified GLSL fragment shader for rendering window contents. See ~compton-default-fshader-win.glsl~ and ~compton-fake-transparency-fshader-win.glsl~ in the source tree for examples.
| Default value | ~''~ |
#+BEGIN_SRC conf :tangle no
glx-fshader-win = '';

View File

@ -12,24 +12,14 @@
:PROPERTIES:
:CUSTOM_ID: Presentation-4e723f32
:END:
*Before proceeding, be aware that I deprecated this polybar config on August
22nd, 2020, meaning I wont update it anymore unless I use it again some day
in the future. I will keep it on my website though.*
*Before proceeding, be aware that I deprecated this polybar config on August 22nd, 2020, meaning I wont update it anymore unless I use it again some day in the future. I will keep it on my website though.*
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.
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]].
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.
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
@ -62,34 +52,23 @@
#+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:
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,
lets declare our default background and foreground colors with their
alternative option.
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, lets 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, lets declare an alert
color.
Polybar is also aware of alerts sent by window managers such as i3 when a window opens in an unfocused workspace. For that, lets declare an alert color.
#+BEGIN_SRC conf-windows
alert = #bd2c40
#+END_SRC
@ -98,20 +77,17 @@
: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:
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.
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.
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
@ -120,31 +96,17 @@
: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.
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.
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
<<position-bar-top>>
#+END_SRC
#+NAME: position-bar-top
#+BEGIN_SRC conf-windows :exports none :tangle no
width = 100%
@ -152,23 +114,18 @@
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.
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 arent 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.
Each module will have some padding around it, so that modules arent 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 doesnt include any system tray, so lets disable that.
#+BEGIN_SRC conf-windows
tray-position = none
@ -178,32 +135,21 @@
: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 bars background will be of
the same color as the main background color declared earlier, and the same
goes for the foreground.
As explained above, we declared some global variables when it comes to colors, and this is where they will be used. The bars 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 wont 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.
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 wont 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.
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
@ -213,20 +159,12 @@
: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:
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:
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 its used |
|--------------+----------------------------------------------------+-----------------+-----------------------|
@ -236,7 +174,6 @@
| 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
@ -264,19 +201,13 @@
#+BEGIN_SRC conf-windows
<<font-ws-config(text="font",table=fonts-polybar)>>
#+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.
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, well get the title of the
focused window, and to the left well have the date and time.
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, well get the title of the focused window, and to the left well have the date and time.
#+NAME: modules-generate
#+BEGIN_SRC emacs-lisp :var table=top-modules :results value :cache yes
(setq right '()
@ -325,8 +256,7 @@
: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.
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
@ -335,8 +265,7 @@
: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:
The variables are the same as above, but two of them will be slightly modified:
#+BEGIN_SRC conf-windows
bottom = true
border-size = 0
@ -350,21 +279,13 @@
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 arent modified.
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 arent modified.
#+BEGIN_SRC conf-windows
<<padding-bar>>
<<module-margin-bar>>
<<monitor-bar>>
#+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.
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
@ -376,8 +297,7 @@
: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.
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
<<bar-colors>>
<<line-border-color>>
@ -388,8 +308,7 @@
: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 whats going
on, see [[#Declaration_of_the_bars-Top_bar_declaration-Fonts_and_locale-70a25466][Fonts and locale]] of the top bar.
Again, nothing changes from the top bar, so for more info on whats 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
<<locale-bar>>
<<font-ws-config(text="font",table=fonts-polybar)>>
@ -399,9 +318,7 @@
: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:
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 |
|----------------+----------+---------------------------------|
@ -415,7 +332,6 @@
| memory | right | RAM usage |
| temperature | right | CPU temperature |
| custom-battery | right | Battery usage |
Heres the corresponding configuration:
#+ATTR_LATEX: :options breaklines
#+BEGIN_SRC conf-windows
@ -423,20 +339,13 @@
#+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.
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 dont 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.
Before we begin to describe the different modules, I would like to point out something that will be repeated multiple times if I dont 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}
@ -453,62 +362,39 @@
: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~.
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~.
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.
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.
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.
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 wont need this module which is aimed
at laptop users. Feel free to remove it if you do not need it.
Of course, users on desktop computers wont 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 lets declare it as such:
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 lets 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.
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.
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")
@ -519,26 +405,18 @@
mount-0 = /
<<include-home-partition()>>
#+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, well simply use
their label.
Now we can set the format of our module. There are two mains formats, one for mounted and one for unmounted mountpoints. For both, well simply use their label.
#+BEGIN_SRC conf-windows
format-mounted = <label-mounted>
format-unmounted = <label-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.
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 well simply have a message telling us about that,
and the foreground color will use the alternative foreground color described
earlier.
If the volume is unmounted (which should be worrying considering the mountpoints chosen), then well 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}
@ -548,11 +426,7 @@
: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.
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
@ -566,10 +440,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Hardware-ACPI_backlight-9eaeaa79
:END:
This module indicates the backlight level of a screen thanks to the ACPI
Linux module. There isnt much to tell about the module itself other than it
inherits the module described above, [[#Modules-Hardware-Xbacklight-2901c504][xbacklight]]. It also sets which driver
should be used, in this case the ~intel_backlight~ driver.
This module indicates the backlight level of a screen thanks to the ACPI Linux module. There isnt much to tell about the module itself other than it inherits the module described above, [[#Modules-Hardware-Xbacklight-2901c504][xbacklight]]. It also sets which driver should be used, in this case the ~intel_backlight~ driver.
#+BEGIN_SRC conf-windows
[module/backlight-acpi]
inherit = module/xbacklight
@ -581,22 +452,18 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Hardware-CPU-365dcb98
:END:
This module indicates how much of the CPU is being used. As shown below, I
made it so we can see the load on each core. The first thing to do is to
declare the module as an internal module dedicated to the CPU.
This module indicates how much of the CPU is being used. As shown below, I made it so we can see the load on each core. The first thing to do is to declare the module as an internal module dedicated to the CPU.
#+BEGIN_SRC conf-windows
[module/cpu]
type = internal/cpu
#+END_SRC
Now, we can set the refresh rate in seconds of the module. I like it at two
seconds:
Now, we can set the refresh rate in seconds of the module. I like it at two seconds:
#+BEGIN_SRC conf-windows
interval = 2
#+END_SRC
Now, lets declare what will be displayed. The format will be a computer
emoji followed by ramp characters.
Now, lets declare what will be displayed. The format will be a computer emoji followed by ramp characters.
#+BEGIN_SRC conf-windows
format = <label> <ramp-coreload>
format-prefix = "💻 "
@ -620,9 +487,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Hardware-Memory-2f2f9475
:END:
Similarly to the CPU module, it is possible for Polybar to display the RAM
load of the computer. As above, lets declare this module as an internal
module to Polybar:
Similarly to the CPU module, it is possible for Polybar to display the RAM load of the computer. As above, lets declare this module as an internal module to Polybar:
#+BEGIN_SRC conf-windows
[module/memory]
type = internal/memory
@ -649,17 +514,13 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Hardware-Wlan-3457f36b
:END:
It is possible for Polybar to display the name of the current WiFi network
the computer is connected to. For that, we first need to declare the Wlan
module as an internal module of Polybar.
It is possible for Polybar to display the name of the current WiFi network the computer is connected to. For that, we first need to declare the Wlan module as an internal module of Polybar.
#+BEGIN_SRC conf-windows
[module/wlan]
type = internal/network
#+END_SRC
Now, we should set the name of the interface. As this depends on the
hardware I am using, I am going to rely on the machines hostname and on
some Elisp code to get this setting right.
Now, we should set the name of the interface. As this depends on the hardware I am using, I am going to rely on the machines hostname and on some Elisp code to get this setting right.
#+NAME: name-wlan-interface
#+BEGIN_SRC emacs-lisp :exports code :tangle no
(cond ((string= system-name "Marpa") "wlp8s0")
@ -675,9 +536,7 @@
interval = 3.0
#+END_SRC
The format of the module when connected to a network will the the display of
the antenna emoji, followed by the name of the network. When disconnected,
the module will simply be empty.
The format of the module when connected to a network will the the display of the antenna emoji, followed by the name of the network. When disconnected, the module will simply be empty.
#+BEGIN_SRC conf-windows
format-connected = <label-connected>
format-connected-prefix = "📶 "
@ -688,15 +547,13 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Hardware-Ethernet-dc749304
:END:
Just like any other module, the ethernet module has to be declared as an
internal module.
Just like any other module, the ethernet module has to be declared as an internal module.
#+BEGIN_SRC conf-windows
[module/eth]
type = internal/network
#+END_SRC
And just like the Wlan module, it requires an interface which can vary
depending on the machine I am using, hence this piece of Elisp:
And just like the Wlan module, it requires an interface which can vary depending on the machine I am using, hence this piece of Elisp:
#+NAME: name-eth-interface
#+BEGIN_SRC emacs-lisp :exports code :tangle no
(cond ((string= system-name "Marpa") "enp9s0")
@ -707,9 +564,7 @@
interface = <<name-eth-interface()>>
#+END_SRC
The format of this module will be the local address of the computer on the
network, and it will be prefixed by a desktop computer emoji. Meanwhile,
when disconnected, the module wont be visible.
The format of this module will be the local address of the computer on the network, and it will be prefixed by a desktop computer emoji. Meanwhile, when disconnected, the module wont be visible.
#+BEGIN_SRC conf-windows
format-connected = <<label-connected>>
format-connected-prefix = "🖥 "
@ -726,23 +581,20 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Hardware-Volume-ebf9f7a4
:END:
The volume module in Polybar is linked to its internal bindings to ALSA.
Lets declare it accordingly.
The volume module in Polybar is linked to its internal bindings to ALSA. Lets declare it accordingly.
#+BEGIN_SRC conf-windows
[module/volume]
type = internal/alsa
#+END_SRC
Its format is quite simple: if the audio is not muted, it is then prefixed
with a speaker emoji, followed by the volume percentage.
Its format is quite simple: if the audio is not muted, it is then prefixed with a speaker emoji, followed by the volume percentage.
#+BEGIN_SRC conf-windows
format-volume = <label-volume>
format-volume-prefix = "🔈 "
label-volume = %percentage%%
#+END_SRC
If the audio is muted, then the only thing the user will see is the muted
speaker emoji followed by the text “muted”.
If the audio is muted, then the only thing the user will see is the muted speaker emoji followed by the text “muted”.
#+BEGIN_SRC conf-windows
format-muted-prefix = "🔇 "
label-muted = muted
@ -757,8 +609,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Hardware-Temperature-a9f08cde
:END:
The temperature module checks the temperature of the CPU, and warns the user
above a certain threshold of heat, in my case if my CPU is above 60°C.
The temperature module checks the temperature of the CPU, and warns the user above a certain threshold of heat, in my case if my CPU is above 60°C.
#+BEGIN_SRC conf-windows
[module/temperature]
type = internal/temperature
@ -766,9 +617,7 @@
warn-temperature = 60
#+END_SRC
The format of the module is the thermometer emoji followed by the
temperature of the CPU. If the CPU becomes too hot, the text will change
color for the secondary foreground color.
The format of the module is the thermometer emoji followed by the temperature of the CPU. If the CPU becomes too hot, the text will change color for the secondary foreground color.
#+BEGIN_SRC conf-windows
format = <label>
format-underline = #f50a4d
@ -790,21 +639,14 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-Window_title-3f931641
:END:
This modules aim is to simply provide the name of the currently focused
window given by Xorg. This module is an internal module to polybar, that is
to say it is built-in, and is of the type ~xwindow~. So, lets declare the
module accordingly, including the piece of common code declared at the
beginning of the chapter:
This modules aim is to simply provide the name of the currently focused window given by Xorg. This module is an internal module to polybar, that is to say it is built-in, and is of the type ~xwindow~. So, lets declare the module accordingly, including the piece of common code declared at the beginning of the chapter:
#+BEGIN_SRC conf-windows
[module/xwindow]
type = internal/xwindow
<<mod-prefix-col>>
#+END_SRC
Now we can take care of the label, which is the actual text that will be
displayed. In our case, we want the label to be the title of the current X
window, hence the value of ~label~, and we dont want it to be too long,
though Im not sure Ive often seen window titles longer than 70 characters.
Now we can take care of the label, which is the actual text that will be displayed. In our case, we want the label to be the title of the current X window, hence the value of ~label~, and we dont want it to be too long, though Im not sure Ive often seen window titles longer than 70 characters.
#+BEGIN_SRC conf-windows
label = %title%
label-maxlen = 70
@ -814,18 +656,13 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-i3-db36ddfb
:END:
Now comes the module for i3 interaction. Thanks to this module, it is
possible to show which workspaces are active and focused, and it is possible
to change workspaces by clicking on the ones displayed in the bar. First,
lets declare it; it is an internal module by the way.
Now comes the module for i3 interaction. Thanks to this module, it is possible to show which workspaces are active and focused, and it is possible to change workspaces by clicking on the ones displayed in the bar. First, lets declare it; it is an internal module by the way.
#+BEGIN_SRC conf-windows
[module/i3]
type = internal/i3
#+END_SRC
Now, lets display only the workspaces that are on the current output. This
means if a workspace is either inactive or on another screen or output, it
wont be displayed.
Now, lets display only the workspaces that are on the current output. This means if a workspace is either inactive or on another screen or output, it wont be displayed.
#+BEGIN_SRC conf-windows
pin-workspaces = true
#+END_SRC
@ -835,10 +672,7 @@
index-sort = true
#+END_SRC
I dont want to be able to scroll through the workspaces when my mouse is
hovering the module: when it happens, most of the time it was done
accidentally. So lets deactivate that. However, I sometimes like to click
on them to switch from one another, so well keep that activated.
I dont want to be able to scroll through the workspaces when my mouse is hovering the module: when it happens, most of the time it was done accidentally. So lets deactivate that. However, I sometimes like to click on them to switch from one another, so well keep that activated.
#+BEGIN_SRC conf-windows
enable-scroll = false
wrapping-scroll = false
@ -851,24 +685,17 @@
strip-wsnumbers = false
#+END_SRC
An on the topic of workspaces name, ~fuzzy-match~ allows the user to use
fuzzy search for workspaces name when we will be applying custom names
below. Not really useful since I only use the default workspaces name, but
its good to have it enabled by default.
An on the topic of workspaces name, ~fuzzy-match~ allows the user to use fuzzy search for workspaces name when we will be applying custom names below. Not really useful since I only use the default workspaces name, but its good to have it enabled by default.
#+BEGIN_SRC conf-windows
fuzzy-match = true
#+END_SRC
The label format is described first by its label, but also by one of its
three possible modes: focused, visible or unfocused. These will be discussed
later, but for now lets simply set our format.
The label format is described first by its label, but also by one of its three possible modes: focused, visible or unfocused. These will be discussed later, but for now lets simply set our format.
#+begin_src conf-windows
format = <label-state> <label-mode>
#+end_src
We also wand to set the label mode to be whichever mode the workspace
described by polybar is in. This label will also have a padding of 2 pixels,
and the text will be written in white.
We also wand to set the label mode to be whichever mode the workspace described by polybar is in. This label will also have a padding of 2 pixels, and the text will be written in white.
#+begin_src conf-windows
label-mode = %mode%
label-mode-padding = 2
@ -879,9 +706,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-i3-Workspace_icons-89237191
:END:
Now, lets name our workspaces. We can give them whatever name we want them
to have, but I just like the aesthetics of Japanese characters, so lets go
with the kanji equivalent of the number of the workspaces.
Now, lets name our workspaces. We can give them whatever name we want them to have, but I just like the aesthetics of Japanese characters, so lets go with the kanji equivalent of the number of the workspaces.
#+NAME: ws-names
| workspace number | name |
|------------------+------|
@ -901,8 +726,7 @@
<<font-ws-config(text="ws",table=ws-names)>>
#+END_SRC
In case we create a workspace which isnt named from ~0~ to ~9~, I want it
to appear as is.
In case we create a workspace which isnt named from ~0~ to ~9~, I want it to appear as is.
#+begin_src conf-windows
ws-icon-default = %index%
#+end_src
@ -911,11 +735,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-i3-Focused_workspaces-0ca3b93d
:END:
Now we can define the label itself. First, we will need to define the label
when the workspace is focused. Well simply take the alternative background
for the focused label, and the underline will be defined from Xrdbs 8th
color, with yellow as the fallback color. It will also have a two pixels
padding. The text itself will be the dynamic icons declared above.
Now we can define the label itself. First, we will need to define the label when the workspace is focused. Well simply take the alternative background for the focused label, and the underline will be defined from Xrdbs 8th color, with yellow as the fallback color. It will also have a two pixels padding. The text itself will be the dynamic icons declared above.
#+begin_src conf-windows
label-focused = %icon%
label-focused-background = ${colors.background-alt}
@ -927,13 +747,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-i3-Visible_workspaces-4be78e50
:END:
The ~visible~ label is related to the ~focused~ labels since it is
describing workspaces that can be seen, but are not currently focused, i.e.
a workspace that appears on another screen than the one currently used so
it is visible, but it isnt focused. The difference with the ~unfocused~
workspaces is that the latter are neither focused nor visible. As you can
see, we are simply using all of the declarations from above for the focused
labels so we can ensure they appear the same way the focused labels do.
The ~visible~ label is related to the ~focused~ labels since it is describing workspaces that can be seen, but are not currently focused, i.e. a workspace that appears on another screen than the one currently used so it is visible, but it isnt focused. The difference with the ~unfocused~ workspaces is that the latter are neither focused nor visible. As you can see, we are simply using all of the declarations from above for the focused labels so we can ensure they appear the same way the focused labels do.
#+begin_src conf-windows
label-visible = ${self.label-focused}
label-visible-background = ${self.label-focused-background}
@ -945,9 +759,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-i3-Unfocused_workspaces-13063042
:END:
When it comes to the unfocused label, there wont be any custom background
or underline, so well just copy the two remaining lines from the focused
labels for unfocused labels.
When it comes to the unfocused label, there wont be any custom background or underline, so well just copy the two remaining lines from the focused labels for unfocused labels.
#+begin_src conf-windows
label-unfocused = %icon%
label-unfocused-padding = 2
@ -957,12 +769,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-i3-Urgent_workspaces-ed2bd93c
:END:
Lastly, we get our urgent workspaces: workspaces in which most of the time
its just a popup that appeared or a software that finally launched itself
while working on something else on another workspace. To make it a bit more
unique, lets declare its background as being the color 0 from xrdb, with
some dark red as the fallback color. And as the other labels, the text will
be the icon and it will have a two pixels padding.
Lastly, we get our urgent workspaces: workspaces in which most of the time its just a popup that appeared or a software that finally launched itself while working on something else on another workspace. To make it a bit more unique, lets declare its background as being the color 0 from xrdb, with some dark red as the fallback color. And as the other labels, the text will be the icon and it will have a two pixels padding.
#+begin_src conf-windows
label-urgent = %icon%
label-urgent-background = ${xrdb:color0:#bd2c40}
@ -973,9 +780,7 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-Mpd-4b1ec78e
:END:
Mpd is a music server for GNU/Linux systems that interfaces will several
front-ends, including ncmpcpp (the main one I use), ncmpcpp and mpc. It also
interfaces with polybar thanks to some built in commands.
Mpd is a music server for GNU/Linux systems that interfaces will several front-ends, including ncmpcpp (the main one I use), ncmpcpp and mpc. It also interfaces with polybar thanks to some built in commands.
First, lets declare our module as an internal module.
#+BEGIN_SRC conf-windows
@ -983,17 +788,14 @@
type = internal/mpd
#+END_SRC
The next thing we want to do is set the label for the module: we will
display both the title and the name of the artist of the song playing. The
maximum length will be 70 characters.
The next thing we want to do is set the label for the module: we will display both the title and the name of the artist of the song playing. The maximum length will be 70 characters.
#+BEGIN_SRC conf-windows
label-song = %title% - %artist%
label-song-maxlen = 70
label-song-ellipsis = true
#+END_SRC
While Mpd is online, the format of the module should be the control icons
and then the song label.
While Mpd is online, the format of the module should be the control icons and then the song label.
#+BEGIN_SRC conf-windows
format-online = <icon-prev> <toggle> <icon-next> <label-song>
icon-prev = ⏭
@ -1003,8 +805,7 @@
icon-next = ⏭
#+END_SRC
If Mpd is offline, then I would like to display a short messages that tells
the user so.
If Mpd is offline, then I would like to display a short messages that tells the user so.
#+BEGIN_SRC conf-windows
format-offline = <label-offline>
label-offline = 🎵 mpd is offline
@ -1014,23 +815,20 @@
:PROPERTIES:
:CUSTOM_ID: Modules-Software-Date-f7338626
:END:
This module is really simple: it gives the current date. It is an internal
module, and as declared below, it updates every second:
This module is really simple: it gives the current date. It is an internal module, and as declared below, it updates every second:
#+BEGIN_SRC conf-windows
[module/date]
type = internal/date
interval = 1
#+END_SRC
The main date and time format is the standard one, following the ISO-8601
standard.
The main date and time format is the standard one, following the ISO-8601 standard.
#+BEGIN_SRC conf-windows
date = %Y-%m-%d
time = %H-%M-%S
#+END_SRC
It also has an alternative format which I occasionally use, which displays
the date and time in the Japanese format.
It also has an alternative format which I occasionally use, which displays the date and time in the Japanese format.
#+BEGIN_SRC conf-windows
date-alt = %A %d, %B
time-alt = %H:%M:%S
@ -1054,6 +852,5 @@
[fn:1] [[https://github.com/polybar/polybar/wiki/Fonts][https://github.com/polybar/polybar/wiki/Fonts]]
# LocalWords: Siji pixelsize Fira Mincho IPAMincho Unifont unifont fontformat
# LocalWords: truetype antialias xwindow wlan eth acpi cpu

View File

@ -10,9 +10,7 @@
:PROPERTIES:
:CUSTOM_ID: Introduction-465e99fe
:END:
The ~.rustfmt.toml~ file located in the ~$HOME~ directory is a global
configuration file for Rusts code formatters, such as ~rustfmt~. In this
file, you can find how my Rust code is always formatted.
The ~.rustfmt.toml~ file located in the ~$HOME~ directory is a global configuration file for Rusts code formatters, such as ~rustfmt~. In this file, you can find how my Rust code is always formatted.
* General settings
:PROPERTIES:
@ -22,22 +20,18 @@
#+BEGIN_SRC toml
edition = "2018"
#+END_SRC
Put single-expression functions on a single line.
#+BEGIN_SRC toml
fn_single_line = true
#+END_SRC
Format string literals where necessary.
#+BEGIN_SRC toml
format_strings = true
#+END_SRC
Maximum width of each line
#+BEGIN_SRC toml
max_width = 80
#+END_SRC
Merge multiple imports into a single nested import.
#+BEGIN_SRC toml
merge_imports = true
@ -47,21 +41,16 @@
:PROPERTIES:
:CUSTOM_ID: Structs_and_Enums-6a2a856d
:END:
The maximum length of enum variant having discriminant, that gets vertically
aligned with others. Variants without discriminants would be ignored for the
purpose of alignment.
The maximum length of enum variant having discriminant, that gets vertically aligned with others. Variants without discriminants would be ignored for the purpose of alignment.
Note that this is not how much whitespace is inserted, but instead the longest
variant name that doesn't get ignored when aligning.
Note that this is not how much whitespace is inserted, but instead the longest variant name that doesn't get ignored when aligning.
#+BEGIN_SRC toml
enum_discrim_align_threshold = 20
#+END_SRC
The maximum diff of width between struct fields to be aligned with each other.
#+BEGIN_SRC toml
struct_field_align_threshold = 20
#+END_SRC
Reorder impl items. ~type~ and ~const~ are put first, then macros and methods.
#+BEGIN_SRC toml
reorder_impl_items = true
@ -75,17 +64,14 @@
#+BEGIN_SRC toml
normalize_comments = true
#+END_SRC
Break comments to fit on the line.
#+BEGIN_SRC toml
wrap_comments = true
#+END_SRC
Report ~FIXME~ items in comments.
#+BEGIN_SRC toml
report_fixme = "Always"
#+END_SRC
Report ~TODO~ items in comments.
#+BEGIN_SRC toml
todo = "Always"
@ -99,7 +85,6 @@
#+BEGIN_SRC toml
format_code_in_doc_comments = true
#+END_SRC
Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
#+BEGIN_SRC toml
normalize_doc_attributes = true
@ -109,17 +94,14 @@
:PROPERTIES:
:CUSTOM_ID: Whitespace-e8792b44
:END:
Use tab characters for indentation, spaces for alignment.
#+BEGIN_SRC toml
hard_tabs = false
#+END_SRC
Number of spaces per tab.
#+BEGIN_SRC toml
tab_spaces = 4
#+END_SRC
I want newlines to always be Unix style.
#+BEGIN_SRC toml
newline_style = "Unix"

View File

@ -10,40 +10,33 @@
:PROPERTIES:
:CUSTOM_ID: Presentation-0b37c6c0
:END:
I dont really use tmux often, but I certainly do like a nice presentation and
useful features, hence this configuration. This config file is inspired by
gpakoszs tmux configuration repo you can find [[https://github.com/gpakosz/.tmux][here]].
I dont really use tmux often, but I certainly do like a nice presentation and useful features, hence this configuration. This config file is inspired by gpakoszs tmux configuration repo you can find [[https://github.com/gpakosz/.tmux][here]].
* Windows and pane creation
:PROPERTIES:
:CUSTOM_ID: Windows_and_pane_creation-66275518
:END:
Whether if a new *window* will retain the current path. Possible values are:
- true
- false (default)
- ~true~
- ~false~ (default)
#+BEGIN_SRC conf-unix
tmux_conf_new_window_retain_current_path=true
#+END_SRC
Whether if a new *pane* should retain the current path. Possible values are:
- true (default)
- false
- ~true~ (default)
- ~false~
#+BEGIN_SRC conf-unix
tmux_conf_new_window_retain_current_path=true
#+END_SRC
Whether or not tmux should attempt to reconnect to the current ssh session.
This is still experimental. Possible values are:
- true
- false (default)
Whether or not tmux should attempt to reconnect to the current ssh session. This is still experimental. Possible values are:
- ~true~
- ~false~ (default)
#+BEGIN_SRC conf-unix
tmux_conf_new_pane_reconnect_ssh=true
#+END_SRC
Whether tmux should prompt for new session name when creating a new one.
Possible values are:
- true
- false (default)
Whether tmux should prompt for new session name when creating a new one. Possible values are:
- ~true~
- ~false~ (default)
#+BEGIN_SRC conf-unix
tmux_conf_new_session_prompt=false
#+END_SRC
@ -52,28 +45,23 @@
:PROPERTIES:
:CUSTOM_ID: Display-d5ae1908
:END:
Whether to activate RGB 24-bit color support (only available in tmux >= 2.2).
Possible values are:
- true
- false (default)
Whether to activate RGB 24-bit color support (only available in tmux >= 2.2). Possible values are:
- ~true~
- ~false~ (default)
#+BEGIN_SRC conf-unix
tmux_conf_theme_24b_colour=false
#+END_SRC
These variables are for chosing the window style. I use the default one.
#+BEGIN_SRC conf-unix
tmux_conf_theme_window_fg='default'
tmux_conf_theme_window_bg='default'
#+END_SRC
Whether the focused pane should be highlighted (only available in tmux >=
2.1). Possible values are:
- true
- false (default)
Whether the focused pane should be highlighted (only available in tmux >= 2.1). Possible values are:
- ~true~
- ~false~ (default)
#+BEGIN_SRC conf-unix
tmux_conf_theme_highlight_focused_pane=false
#+END_SRC
Set the terminal title. Built-in variables are:
- =#{circled_window_index}=
- =#{circled_session_name}=
@ -84,10 +72,7 @@
#+BEGIN_SRC conf-unix
tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W'
#+END_SRC
These variables set the left/right separators between sections. With the
current values, you dont need to install Powerline, but only fonts patched
with Powerline symbols or the standalone PowerlineSymbols.otf font.
These variables set the left/right separators between sections. With the current values, you dont need to install Powerline, but only fonts patched with Powerline symbols or the standalone PowerlineSymbols.otf font.
#+BEGIN_SRC conf-unix
tmux_conf_theme_left_separator_main='\uE0B0'
tmux_conf_theme_left_separator_sub='\uE0B1'
@ -99,58 +84,47 @@
:PROPERTIES:
:CUSTOM_ID: Display-Colors_and_style-0994a014
:END:
Colors displayed in tmux can be chosen thanks to the following variables. Any
color should be formatted as a hexadecimal RGB value preceded by a pound sign
=#= (e.g. =#00afff= for light blue) or =default= to let our terminal set it
for us.
Colors displayed in tmux can be chosen thanks to the following variables. Any color should be formatted as a hexadecimal RGB value preceded by a pound sign =#= (e.g. =#00afff= for light blue) or =default= to let our terminal set it for us.
Choose the style of the pane borders. Possible values are:
- thin (default)
- fat
- ~thin~ (default)
- ~fat~
#+BEGIN_SRC conf-unix
tmux_conf_theme_pane_border_style=thin
#+END_SRC
Declare what the colors of the focused pane should be. The first variable
specifies the foreground color, the other the background color.
Declare what the colors of the focused pane should be. The first variable specifies the foreground color, the other the background color.
#+BEGIN_SRC conf-unix
tmux_conf_theme_focused_pane_fg='default'
tmux_conf_theme_focused_pane_bg='#0087d7'
#+END_SRC
Here you can set the colors of the pane borders.
#+BEGIN_SRC conf-unix
tmux_conf_theme_pane_border='#444444'
tmux_conf_theme_pane_active_border='#00afff'
#+END_SRC
With these variables, you can set the colors for the pane indicators.
#+BEGIN_SRC conf-unix
tmux_conf_theme_pane_indicator='#00afff'
tmux_conf_theme_pane_active_indicator='#00afff'
#+END_SRC
These variables set the colors and the style of the status line.
#+BEGIN_SRC conf-unix
tmux_conf_theme_message_fg='#000000'
tmux_conf_theme_message_bg='#ffff00'
tmux_conf_theme_message_attr='bold'
#+END_SRC
Same as above for the status line command style.
#+BEGIN_SRC conf-unix
tmux_conf_theme_message_command_fg='#ffff00'
tmux_conf_theme_message_command_bg='#000000'
tmux_conf_theme_message_command_attr='bold'
#+END_SRC
These variables set the style of the window modes.
#+BEGIN_SRC conf-unix
tmux_conf_theme_mode_fg='#000000'
tmux_conf_theme_mode_bg='#ffff00'
tmux_conf_theme_mode_attr='bold'
#+END_SRC
Set the style of the status line.
#+BEGIN_SRC conf-unix
tmux_conf_theme_status_fg='#8a8a8a'
@ -170,7 +144,6 @@
tmux_conf_theme_window_status_bg='#080808'
tmux_conf_theme_window_status_attr='none'
#+END_SRC
Sets the format of the window status. Built-in variables are:
- =#{circled_window_index}=
- =#{circled_session_name}=
@ -181,14 +154,12 @@
#+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_format='#I #W'
#+END_SRC
Sets the colors and style of the current window status.
#+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_current_fg='#000000'
tmux_conf_theme_window_status_current_bg='#00afff'
tmux_conf_theme_window_status_current_attr='bold'
#+END_SRC
Sets the format of the currentwindow status. Built-in variables are:
- =#{circled_window_index}=
- =#{circled_session_name}=
@ -199,30 +170,25 @@
#+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_current_format='#I #W'
#+END_SRC
Sets the window activity status style.
#+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_activity_fg='default'
tmux_conf_theme_window_status_activity_bg='default'
tmux_conf_theme_window_status_activity_attr='underscore'
#+END_SRC
Sets the window bell status style.
#+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_bell_fg='#ffff00'
tmux_conf_theme_window_status_bell_bg='default'
tmux_conf_theme_window_status_bell_attr='blink,bold'
#+END_SRC
Sets the window last status style.
#+BEGIN_SRC conf-unix
tmux_conf_theme_window_status_last_fg='#00afff'
tmux_conf_theme_window_status_last_bg='default'
tmux_conf_theme_window_status_last_attr='none'
#+END_SRC
Sets the left and right content of the status bar of tmux. Sections should be
separated with =|=, subsections with =,=. The built-in values are:
Sets the left and right content of the status bar of tmux. Sections should be separated with =|=, subsections with =,=. The built-in values are:
- =#{battery_bar}=
- =#{battery_hbar}=
- =#{battery_percentage}=
@ -247,21 +213,18 @@
tmux_conf_theme_status_left=' ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} '
tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} '
#+END_SRC
Sets the left status style and colors.
#+BEGIN_SRC conf-unix
tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4'
tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff'
tmux_conf_theme_status_left_attr='bold,none,none'
#+END_SRC
Sets the right status style and colors.
#+BEGIN_SRC conf-unix
tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000'
tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4'
tmux_conf_theme_status_right_attr='none,none,bold'
#+END_SRC
Set the pairing indicator, its style and its attribute.
#+BEGIN_SRC conf-unix
tmux_conf_theme_pairing='👓 ' # U+1F453
@ -269,7 +232,6 @@
tmux_conf_theme_pairing_bg='none'
tmux_conf_theme_pairing_attr='none'
#+END_SRC
Set the pairing indicator, its style and its attribute.
#+BEGIN_SRC conf-unix
# prefix indicator
@ -278,7 +240,6 @@
tmux_conf_theme_prefix_bg='none'
tmux_conf_theme_prefix_attr='none'
#+END_SRC
Set the root indicator, its style and its attribute.
#+BEGIN_SRC conf-unix
tmux_conf_theme_root='!'
@ -286,7 +247,6 @@
tmux_conf_theme_root_bg='none'
tmux_conf_theme_root_attr='bold,blink'
#+END_SRC
Set the synchronized indicator, its style and its attribute.
#+BEGIN_SRC conf-unix
tmux_conf_theme_synchronized='🔒' # U+1F512
@ -294,49 +254,39 @@
tmux_conf_theme_synchronized_bg='none'
tmux_conf_theme_synchronized_attr='none'
#+END_SRC
Set the battery bar symbols.
#+BEGIN_SRC conf-unix
tmux_conf_battery_bar_symbol_full='◼'
tmux_conf_battery_bar_symbol_empty='◻'
#+END_SRC
Set the battery bar length in terms of amount of symbols. Possible values
are:
Set the battery bar length in terms of amount of symbols. Possible values are:
- =auto=
- an integer number, e.g. 5
#+BEGIN_SRC conf-unix
tmux_conf_battery_bar_length='auto'
#+END_SRC
Set the battery bar palette. Possible values are:
- =gradient= (default)
- =heat=
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
value preceded by a pound symbol =#=.
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB value preceded by a pound symbol =#=.
#+BEGIN_SRC conf-unix
tmux_conf_battery_bar_palette='gradient'
#tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000'
#+END_SRC
Set the hbar palette. Possible values are:
- =gradient= (default)
- =heat=
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
value preceded by a pound symbol =#=.
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB value preceded by a pound symbol =#=.
#+BEGIN_SRC conf-unix
tmux_conf_battery_hbar_palette='gradient'
#+END_SRC
Set the vbar palette. Possible values are:
- =gradient= (default)
- =heat=
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB
value preceded by a pound symbol =#=.
- =color_full_fg,color_empty_fg,color_bg= with each being an hexadecimal RGB value preceded by a pound symbol =#=.
#+BEGIN_SRC conf-unix
tmux_conf_battery_vbar_palette='gradient'
#+END_SRC
Set symbols used to indicate whether the battery is charging or discharging.
#+BEGIN_SRC conf-unix
tmux_conf_battery_status_charging='⚡ ' # U+26A1
@ -345,10 +295,7 @@
# tmux_conf_battery_status_discharging='↓' # U+2193
#tmux_conf_battery_status_charging='🔌 ' # U+1F50C
#+END_SRC
Set the clock style. If it is displayed on the right side of the status bar,
it might be better to use =%I:%M %p= rather than =%R= in
=tmux_conf_theme_status_right=.
Set the clock style. If it is displayed on the right side of the status bar, it might be better to use =%I:%M %p= rather than =%R= in =tmux_conf_theme_status_right=.
#+BEGIN_SRC conf-unix
tmux_conf_theme_clock_colour='#00afff'
tmux_conf_theme_clock_style='24'
@ -358,10 +305,9 @@
:PROPERTIES:
:CUSTOM_ID: Clipboard-66d0d03a
:END:
Whether if in copy mode, copying the selection also copies to the OS
clipboard. Possible values are:
- true
- false (default)
Whether if in copy mode, copying the selection also copies to the OS clipboard. Possible values are:
- ~true~
- ~false~ (default)
#+BEGIN_SRC conf-unix
tmux_conf_copy_to_os_clipboard=false
#+END_SRC
@ -370,27 +316,20 @@
:PROPERTIES:
:CUSTOM_ID: User_customizations-c913b5d7
:END:
Here we can override or undo some setting from settings from tmux. First, we
can increase the history size.
Here we can override or undo some setting from settings from tmux. First, we can increase the history size.
#+BEGIN_SRC conf-unix
set -g history-limit 10000
#+END_SRC
We can also start with mouse mode enabled. But I dont.
#+BEGIN_SRC conf-unix
#set -g mouse on
#+END_SRC
Whether or not Vi mode should be enabled. But really, we should rather export
the =VISUAL= or =EDITOR= environment variables, see the tmux manual. Although
I dont, as said in my dotfish, I prefer to use Emacs.
Whether or not Vi mode should be enabled. But really, we should rather export the =VISUAL= or =EDITOR= environment variables, see the tmux manual. Although I dont, as said in my dotfish, I prefer to use Emacs.
#+BEGIN_SRC conf-unix
#set -g status-keys vi
#set -g mode-keys vi
#+END_SRC
Replace =C-b= by =C-a= instead of using both prefixes. I personally prefer to
just use =C-b=, hence why the lines are commented.
Replace =C-b= by =C-a= instead of using both prefixes. I personally prefer to just use =C-b=, hence why the lines are commented.
#+BEGIN_SRC conf-unix
# set -gu prefix2
# unbind C-a
@ -398,7 +337,6 @@
# set -g prefix C-a
# bind C-a send-prefix
#+END_SRC
Move the status line to the top.
#+BEGIN_SRC conf-unix
#set -g status-position top