[Org, Emacs] Do not add spaces in front of code in src blocks
By default, org-mode will add two spaces before code lines in the org file itself. This does not change how code is edited when editing a code block through `org-edit-special' but when copy/pasting code or editing it directly from the org file, it can be troublesome. Setting `org-src-preserve-indentation' to `t' prevents org from adding these two spaces.
This commit is contained in:
parent
c12164d9bb
commit
d4f11b612d
@ -33,7 +33,7 @@ and source code of my configuration file which can be extracted to
|
||||
First of all, some initialization is needed, and this initialization is about
|
||||
math randomness. So, let’s initialize the ~random~ method of the ~math~ library:
|
||||
#+BEGIN_SRC lua
|
||||
math.randomseed(os.time())
|
||||
math.randomseed(os.time())
|
||||
#+END_SRC
|
||||
|
||||
In order to be able to load libraries properly, I first need to make sure
|
||||
@ -41,7 +41,7 @@ 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")
|
||||
pcall(require, "luarocks.loader")
|
||||
#+END_SRC
|
||||
|
||||
Next, we’ll also load the following libraries
|
||||
@ -58,7 +58,7 @@ Next, we’ll also load the following libraries
|
||||
|
||||
#+NAME: imported-libraries
|
||||
#+BEGIN_SRC emacs-lisp :var libs=table-imported-libraries :cache yes
|
||||
(mapconcat (lambda (x) (format "local %s = require(\"%s\")"
|
||||
(mapconcat (lambda (x) (format "local %s = require(\"%s\")"
|
||||
(cadr x)
|
||||
(car x)))
|
||||
libs
|
||||
@ -81,17 +81,17 @@ Here is the actual code in the config file:
|
||||
|
||||
I also want to be able to autofocus the first window when I go to another workspace, so let’s require that:
|
||||
#+BEGIN_SRC lua
|
||||
require("awful.autofocus")
|
||||
require("awful.autofocus")
|
||||
#+END_SRC
|
||||
|
||||
And finally, I want to be able to declare some shortcuts specific to some apps
|
||||
thanks to the hotkeys help widget.
|
||||
#+BEGIN_SRC lua
|
||||
require("awful.hotkeys_popup.keys")
|
||||
require("awful.hotkeys_popup.keys")
|
||||
#+END_SRC
|
||||
By the way, let’s initialize the ~random~ method of the ~math~ library:
|
||||
#+BEGIN_SRC lua
|
||||
math.randomseed(os.time())
|
||||
math.randomseed(os.time())
|
||||
#+END_SRC
|
||||
|
||||
* Error handling
|
||||
@ -101,16 +101,16 @@ By the way, let’s initialize the ~random~ method of the ~math~ library:
|
||||
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
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({ preset = naughty.config.presets.critical,
|
||||
title = "Oops, there were errors during startup!",
|
||||
text = awesome.startup_errors })
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
And this code handles runtime errors after startup thanks to signals.
|
||||
#+BEGIN_SRC lua
|
||||
do
|
||||
do
|
||||
local in_error = false
|
||||
awesome.connect_signal("debug::error", function (err)
|
||||
-- Make sure we don't go into an endless error loop
|
||||
@ -122,7 +122,7 @@ And this code handles runtime errors after startup thanks to signals.
|
||||
text = tostring(err) })
|
||||
in_error = false
|
||||
end)
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Variable definitions
|
||||
@ -138,7 +138,7 @@ 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")
|
||||
beautiful.init("/home/phundrak/.config/awesome/nord/theme.lua")
|
||||
#+END_SRC
|
||||
|
||||
** Default terminal and text editor
|
||||
@ -149,8 +149,8 @@ The two following variables are set so that I don’t need to go over my whole
|
||||
config file in order to modify which terminal or text editor I use, not that I
|
||||
do it often though.
|
||||
#+BEGIN_SRC lua
|
||||
terminal = "kitty"
|
||||
editor = os.getenv("EDITOR") or "emacsclient -c -a emacs"
|
||||
terminal = "kitty"
|
||||
editor = os.getenv("EDITOR") or "emacsclient -c -a emacs"
|
||||
#+END_SRC
|
||||
|
||||
** Keys
|
||||
@ -163,11 +163,11 @@ Another usual value for this is ~Mod1~, which is the Alt key, but it has greater
|
||||
chances of interfering with other software. I also defined some other obvious
|
||||
variables in order to make my code cleaner later on.
|
||||
#+BEGIN_SRC lua
|
||||
modkey = "Mod4"
|
||||
shift = "Shift"
|
||||
control = "Control"
|
||||
meta = "Mod1"
|
||||
alt = "Mod1" -- Just in case
|
||||
modkey = "Mod4"
|
||||
shift = "Shift"
|
||||
control = "Control"
|
||||
meta = "Mod1"
|
||||
alt = "Mod1" -- Just in case
|
||||
#+END_SRC
|
||||
|
||||
* Custom functions
|
||||
@ -185,12 +185,12 @@ variables in order to make my code cleaner later on.
|
||||
This function sets a random wallpaper from the directory
|
||||
=~/Pictures/Wallpapers=, see [[file:bin.org::#pape-update-bdecbadf][pape-update]] in my custom scripts.
|
||||
#+BEGIN_SRC lua
|
||||
local function set_random_pape()
|
||||
local function set_random_pape()
|
||||
awful.spawn.with_shell("pape-update")
|
||||
naughty.notify({ preset = naughty.config.presets.normal,
|
||||
title = "Wallpaper change",
|
||||
text = "Done!"})
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
*** Restore previous wallpaper
|
||||
@ -200,9 +200,9 @@ This function sets a random wallpaper from the directory
|
||||
I also wrote the following function that will restore the previously set
|
||||
wallpaper:
|
||||
#+BEGIN_SRC lua
|
||||
local function set_wallpaper(_)
|
||||
local function set_wallpaper(_)
|
||||
awful.spawn.with_shell("nitrogen --restore")
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Layout manipulation
|
||||
@ -212,12 +212,12 @@ wallpaper:
|
||||
The following function is used by a shortcut described below in
|
||||
[[#Keybindings-Clients-f9f96d60]].
|
||||
#+BEGIN_SRC lua
|
||||
local function client_go_back()
|
||||
local function client_go_back()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Clients manipulation
|
||||
@ -225,7 +225,7 @@ The following function is used by a shortcut described below in
|
||||
:CUSTOM_ID: Custom_functions-Clients_manipulation-7e958fed
|
||||
:END:
|
||||
#+BEGIN_SRC lua
|
||||
local function restore_minimized_clients()
|
||||
local function restore_minimized_clients()
|
||||
local c = awful.client.restore()
|
||||
-- Focus restored client
|
||||
if c then
|
||||
@ -233,35 +233,35 @@ The following function is used by a shortcut described below in
|
||||
"request::activate", "key.unminimize", {raise = true}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
local function toggle_fullscreen_client(c)
|
||||
local function toggle_fullscreen_client(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
local function toggle_maximized(c)
|
||||
local function toggle_maximized(c)
|
||||
c.maximized = not c.maximized
|
||||
c:raise()
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
local function toggle_vertical_maximized(c)
|
||||
local function toggle_vertical_maximized(c)
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
c:raise()
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
local function toggle_horizontal_maximized(c)
|
||||
local function toggle_horizontal_maximized(c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c:raise()
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Tag manipulation
|
||||
@ -269,45 +269,45 @@ The following function is used by a shortcut described below in
|
||||
:CUSTOM_ID: Custom_functions-Tag_manipulation-5fc67669
|
||||
:END:
|
||||
#+BEGIN_SRC lua
|
||||
local function view_tag_n(i)
|
||||
local function view_tag_n(i)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[i]
|
||||
if tag then
|
||||
tag:view_only()
|
||||
end
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
local function toggle_tag_n(i)
|
||||
local function toggle_tag_n(i)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[i]
|
||||
if tag then
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
local function move_focused_to_tag_n(i)
|
||||
local function move_focused_to_tag_n(i)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[i]
|
||||
if tag then
|
||||
client.focus:move_to_tag(tag)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
local function toggle_focused_client_to_tag_n(i)
|
||||
local function toggle_focused_client_to_tag_n(i)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[i]
|
||||
if tag then
|
||||
client.focus:toggle_tag(tag)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Awesome prompt
|
||||
@ -315,14 +315,14 @@ The following function is used by a shortcut described below in
|
||||
:CUSTOM_ID: Custom_functions-Awesome_prompt-de4fde50
|
||||
:END:
|
||||
#+BEGIN_SRC lua
|
||||
local function invoke_lua_execute_prompt()
|
||||
local function invoke_lua_execute_prompt()
|
||||
awful.prompt.run {
|
||||
prompt = "Run Lua code: ",
|
||||
textbox = awful.screen.focused().promptbox.widget,
|
||||
exe_callback = awful.util.eval,
|
||||
history_path = awful.util.get_cache_dir() .. "/history_eval"
|
||||
}
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Layouts
|
||||
@ -353,7 +353,7 @@ them, and their order in the table is their order in Awesome.
|
||||
|
||||
#+NAME: list-layouts
|
||||
#+BEGIN_SRC emacs-lisp :var layouts=table-layouts :cache yes
|
||||
(mapconcat (lambda (layout)
|
||||
(mapconcat (lambda (layout)
|
||||
(let ((enabled-p (string= (cadr layout) "yes"))
|
||||
(layout (car layout)))
|
||||
(when enabled-p
|
||||
@ -380,9 +380,9 @@ awful.layout.suit.spiral.dwindle,
|
||||
|
||||
Here is the code that activates these layouts:
|
||||
#+BEGIN_SRC lua
|
||||
awful.layout.layouts = {
|
||||
awful.layout.layouts = {
|
||||
<<list-layouts()>>
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
* Top bar
|
||||
@ -399,7 +399,7 @@ below.
|
||||
:END:
|
||||
#+NAME: make-menu
|
||||
#+BEGIN_SRC emacs-lisp :var menu=table-main-menu
|
||||
(mapconcat (lambda (item)
|
||||
(mapconcat (lambda (item)
|
||||
(format "{ \"%s\", %s }"
|
||||
(car item)
|
||||
(mapconcat #'identity (cdr item) ", ")))
|
||||
@ -424,9 +424,9 @@ Awesome:
|
||||
|
||||
And here is the actual code:
|
||||
#+BEGIN_SRC lua
|
||||
awesomewm_menu = {
|
||||
awesomewm_menu = {
|
||||
<<make-menu(menu=table-awesome-menu)>>
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
Next, let’s create the main menu that will be used on ~S-w~ and at the top left
|
||||
@ -439,7 +439,7 @@ of the window:
|
||||
|
||||
Here is the actual code:
|
||||
#+BEGIN_SRC lua
|
||||
mainmenu = awful.menu({ items = {
|
||||
mainmenu = awful.menu({ items = {
|
||||
<<make-menu(menu=table-main-menu)>>
|
||||
}})
|
||||
#+END_SRC
|
||||
@ -447,13 +447,13 @@ Here is the actual code:
|
||||
For now it only has two entries: the Awesome menu and opening a terminal, I will
|
||||
add some more later probably. Let’s specify it as being our main launcher:
|
||||
#+BEGIN_SRC lua
|
||||
launcher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
||||
launcher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
||||
menu = mainmenu })
|
||||
#+END_SRC
|
||||
|
||||
Finally, let’s declare the menubar’s terminal for applications that require it.
|
||||
#+BEGIN_SRC lua
|
||||
menubar.utils.terminal = terminal
|
||||
menubar.utils.terminal = terminal
|
||||
#+END_SRC
|
||||
|
||||
** Widgets
|
||||
@ -462,12 +462,12 @@ Finally, let’s declare the menubar’s terminal for applications that require
|
||||
:END:
|
||||
Let’s declare the keyboard map indicator and switcher for the top bar:
|
||||
#+BEGIN_SRC lua
|
||||
keyboardlayout = awful.widget.keyboardlayout()
|
||||
keyboardlayout = awful.widget.keyboardlayout()
|
||||
#+END_SRC
|
||||
|
||||
Let’s also create a clock widget:
|
||||
#+BEGIN_SRC lua
|
||||
textclock = wibox.widget.textclock()
|
||||
textclock = wibox.widget.textclock()
|
||||
#+END_SRC
|
||||
|
||||
** Tag list
|
||||
@ -478,9 +478,9 @@ 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(
|
||||
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
|
||||
@ -493,7 +493,7 @@ 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)
|
||||
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
|
||||
@ -501,7 +501,7 @@ 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)
|
||||
awful.button({ modkey }, 1, awful.tag.viewtoggle)
|
||||
#+END_SRC
|
||||
|
||||
Right clicks are dedicated to window tagging. A simple right click will untag
|
||||
@ -509,22 +509,22 @@ 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)
|
||||
awful.button({ }, 3, function(t)
|
||||
if client.focus then
|
||||
client.focus:move_to_tag(t)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
However, a right click combined with the modkey will add the clicked tag to the
|
||||
currently focused window, making it visible to both tags.
|
||||
#+NAME: tag-mod-right-click
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ modkey }, 3, function(t)
|
||||
awful.button({ modkey }, 3, function(t)
|
||||
if client.focus then
|
||||
client.focus:toggle_tag(t)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
The scroll wheel is treated as clicks just as any right or left clicks and can
|
||||
@ -532,25 +532,25 @@ be interpreted by Awesome. They can prove useful when it comes to tags. If a
|
||||
scroll up is detected over tags, then Awesome will display the previous tag.
|
||||
#+NAME: tag-simple-scroll-up
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end)
|
||||
awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end)
|
||||
#+END_SRC
|
||||
|
||||
Otherwise, if a scroll down is detected, the next tag will be displayed.
|
||||
#+NAME: tag-simple-scroll-down
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end)
|
||||
awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end)
|
||||
#+END_SRC
|
||||
|
||||
So, here’s the actual configuration code for the taglist:
|
||||
#+BEGIN_SRC lua
|
||||
local taglist_buttons = gears.table.join(
|
||||
local taglist_buttons = gears.table.join(
|
||||
<<tag-simple-left-click>>,
|
||||
<<tag-mod-left-click>>,
|
||||
<<tag-simple-right-click>>,
|
||||
<<tag-mod-right-click>>,
|
||||
<<tag-simple-scroll-up>>,
|
||||
<<tag-simple-scroll-down>>
|
||||
)
|
||||
)
|
||||
#+END_SRC
|
||||
|
||||
** Tasks list
|
||||
@ -560,9 +560,9 @@ So, here’s the actual configuration code for the taglist:
|
||||
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(
|
||||
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
|
||||
@ -570,7 +570,7 @@ 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)
|
||||
awful.button({ }, 1, function (c)
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
@ -580,7 +580,7 @@ window will be minimized.
|
||||
{raise = true}
|
||||
)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
If the right click is detected, then a list of all the opened clients is invoked
|
||||
@ -588,36 +588,36 @@ so we can switch to another (and if needed switch visible tag). The width of
|
||||
this list will be 250px.
|
||||
#+NAME: task-simple-right-click
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ }, 3, function()
|
||||
awful.button({ }, 3, function()
|
||||
awful.menu.client_list({ theme = { width = 250 } })
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
If a scroll up is detected, then let’s select the previous client in the
|
||||
tasklist.
|
||||
#+NAME: task-simple-scroll-up
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ }, 4, function ()
|
||||
awful.button({ }, 4, function ()
|
||||
awful.client.focus.byidx(1)
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
If a scroll down is detected, then let’s select the next client in the tasklist.
|
||||
#+NAME: task-simple-scroll-down
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ }, 5, function ()
|
||||
awful.button({ }, 5, function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
So, here’s the actual code for the tasklist:
|
||||
#+BEGIN_SRC lua
|
||||
local tasklist_buttons = gears.table.join(
|
||||
local tasklist_buttons = gears.table.join(
|
||||
<<task-simple-left-click>>,
|
||||
<<task-simple-right-click>>,
|
||||
<<task-simple-scroll-up>>,
|
||||
<<task-simple-scroll-down>>
|
||||
)
|
||||
)
|
||||
#+END_SRC
|
||||
|
||||
* Theme and display
|
||||
@ -634,16 +634,16 @@ should be redisplayed since it won’t necessarily fit the new geometry of the
|
||||
screen. And remember, I have a [[#Custom_functions-Wallpaper-related_functions-Restore_previous_wallpaper-8b5bc08c][function that does exactly that]]! Let’s connect
|
||||
this function to the geometry change signal:
|
||||
#+BEGIN_SRC lua
|
||||
screen.connect_signal("property::geometry", set_wallpaper)
|
||||
screen.connect_signal("property::geometry", set_wallpaper)
|
||||
#+END_SRC
|
||||
|
||||
If a new screen gets connected, it will need to get a new wallpaper. A lot needs
|
||||
to be done, and all the following lines of code will be inside a block like
|
||||
this:
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
-- Code to be executed goes here
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
So, due the code block above, if you see any reference to ~s~ in the code blocks
|
||||
@ -652,7 +652,7 @@ below, it will refer to the screen being set up by the function.
|
||||
First, let’s set its wallpaper:
|
||||
#+NAME: screen-set-pape
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
set_wallpaper()
|
||||
set_wallpaper()
|
||||
#+END_SRC
|
||||
|
||||
Next, let’s build a list of tags for the screen. *Be aware that each screen has
|
||||
@ -660,7 +660,7 @@ 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])
|
||||
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }, s, awful.layout.layouts[1])
|
||||
#+END_SRC
|
||||
|
||||
Next, let’s create the taglist widget. It will use the ~taglist_buttons~
|
||||
@ -668,11 +668,11 @@ Next, let’s create the taglist widget. It will use the ~taglist_buttons~
|
||||
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 {
|
||||
s.taglist = awful.widget.taglist {
|
||||
screen = s,
|
||||
filter = awful.widget.taglist.filter.all,
|
||||
buttons = taglist_buttons
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
A tasklist widget will also get created thanks with the ~tasklist_button~
|
||||
@ -681,17 +681,17 @@ widget above, the tasklist will only display the screen’s current tags thanks
|
||||
its filter.
|
||||
#+NAME: screen-tasklist-widget
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
s.tasklist = awful.widget.tasklist {
|
||||
s.tasklist = awful.widget.tasklist {
|
||||
screen = s,
|
||||
filter = awful.widget.tasklist.filter.currenttags,
|
||||
buttons = tasklist_buttons
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
A promptbox will also be created for the screen:
|
||||
#+NAME: screen-promptbox
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
s.promptbox = awful.widget.prompt()
|
||||
s.promptbox = awful.widget.prompt()
|
||||
#+END_SRC
|
||||
|
||||
Then, Let’s create an imagebox widget in which will be contained an icon
|
||||
@ -701,8 +701,8 @@ next layout will be loaded; otherwise if a right click or a scroll down is
|
||||
detected, the previous layout will be loaded.
|
||||
#+NAME: screen-layout-indicator
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
s.layoutbox = awful.widget.layoutbox(s)
|
||||
s.layoutbox:buttons(gears.table.join(
|
||||
s.layoutbox = awful.widget.layoutbox(s)
|
||||
s.layoutbox:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function () awful.layout.inc( 1) end),
|
||||
awful.button({ }, 3, function () awful.layout.inc(-1) end),
|
||||
awful.button({ }, 4, function () awful.layout.inc( 1) end),
|
||||
@ -712,7 +712,7 @@ detected, the previous layout will be loaded.
|
||||
Now it is time to create the widget, a ~wibox~ that will contain our bar.
|
||||
#+NAME: screen-wibox-widget
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
s.wibox = awful.wibar({ position = "top", screen = s })
|
||||
s.wibox = awful.wibar({ position = "top", screen = s })
|
||||
#+END_SRC
|
||||
|
||||
Finally, let’s set up our bar. Since it is a horizontal bar, its layout will be
|
||||
@ -721,7 +721,7 @@ 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 {
|
||||
s.wibox:setup {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{ -- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
@ -737,12 +737,12 @@ the system tray, the clock and the layout indicator will be on the right.
|
||||
textclock,
|
||||
s.layoutbox,
|
||||
},
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
In the end, our code looks like this:
|
||||
#+BEGIN_SRC lua
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
<<screen-set-pape>>
|
||||
<<screen-taglist>>
|
||||
<<screen-taglist-widget>>
|
||||
@ -751,7 +751,7 @@ In the end, our code looks like this:
|
||||
<<screen-layout-indicator>>
|
||||
<<screen-wibox-widget>>
|
||||
<<screen-wibox-setup>>
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
* Mouse bindings
|
||||
@ -762,9 +762,9 @@ 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(
|
||||
root.buttons(gears.table.join(
|
||||
awful.button({}, 3, function() mainmenu:toggle() end)
|
||||
))
|
||||
))
|
||||
#+END_SRC
|
||||
|
||||
I will also set three mouse bindings for when the mouse is above a client:
|
||||
@ -777,7 +777,7 @@ I will also set three mouse bindings for when the mouse is above a client:
|
||||
focusing it and making it a floating client.
|
||||
|
||||
#+BEGIN_SRC lua
|
||||
clientbuttons = gears.table.join(
|
||||
clientbuttons = gears.table.join(
|
||||
awful.button({ }, 1, function (c)
|
||||
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
||||
end),
|
||||
@ -794,7 +794,7 @@ I will also set three mouse bindings for when the mouse is above a client:
|
||||
c.floating = true
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
)
|
||||
)
|
||||
#+END_SRC
|
||||
|
||||
* Keybindings
|
||||
@ -830,7 +830,7 @@ Here is a description of the tables displayed below:
|
||||
|
||||
#+NAME: gen-sc-text
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(lambda (x)
|
||||
(lambda (x)
|
||||
(let ((key (nth 0 x))
|
||||
(modifiers (nth 1 x))
|
||||
(lambda-p (pcase (nth 2 x)
|
||||
@ -863,7 +863,7 @@ Here is a description of the tables displayed below:
|
||||
|
||||
#+NAME: gen-sc-glob
|
||||
#+BEGIN_SRC emacs-lisp :var table=sc-client
|
||||
(mapconcat
|
||||
(mapconcat
|
||||
<<gen-sc-text>>
|
||||
(seq-filter (lambda (x)
|
||||
(let ((clientkey-p (nth 6 x)))
|
||||
@ -875,7 +875,7 @@ Here is a description of the tables displayed below:
|
||||
|
||||
#+NAME: gen-sc-client
|
||||
#+BEGIN_SRC emacs-lisp :var table=sc-client :cache yes
|
||||
(mapconcat
|
||||
(mapconcat
|
||||
<<gen-sc-text>>
|
||||
(seq-filter (lambda (keybind)
|
||||
(string= "yes" (nth 6 keybind)))
|
||||
@ -885,7 +885,7 @@ Here is a description of the tables displayed below:
|
||||
|
||||
#+NAME: sc-tag-num-gen
|
||||
#+BEGIN_SRC emacs-lisp :var input=sc-tag-num :results drawer :wrap src lua
|
||||
(let (result)
|
||||
(let (result)
|
||||
(dotimes (i 10 result)
|
||||
(let* ((j (+ 1 i)))
|
||||
(setq result
|
||||
@ -894,7 +894,7 @@ Here is a description of the tables displayed below:
|
||||
(lambda (line)
|
||||
(format
|
||||
"awful.key({%s},\"#%d\",function() %s%d) end,
|
||||
\t{description=\"%s%d\",group=\"%s\"})"
|
||||
\t{description=\"%s%d\",group=\"%s\"})"
|
||||
(nth 1 line) (+ j 9) (nth 2 line) j
|
||||
(nth 3 line) j (nth 4 line)))
|
||||
input
|
||||
@ -908,7 +908,7 @@ 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(
|
||||
globalkeys = gears.table.join(
|
||||
-- Awesome
|
||||
<<gen-sc-glob(sc-awesome)>>,
|
||||
-- App
|
||||
@ -930,13 +930,13 @@ declared in the ~globalkeys~ variable, which will be added then to ~root.keys~
|
||||
-- Misc
|
||||
<<gen-sc-glob(sc-misc)>>,
|
||||
<<sc-tag-num-gen()>>
|
||||
)
|
||||
root.keys(globalkeys)
|
||||
)
|
||||
root.keys(globalkeys)
|
||||
|
||||
clientkeys = gears.table.join(
|
||||
clientkeys = gears.table.join(
|
||||
-- Client
|
||||
<<gen-sc-client(sc-client)>>
|
||||
)
|
||||
)
|
||||
#+END_SRC
|
||||
|
||||
** Applications
|
||||
@ -1152,19 +1152,19 @@ 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 = {
|
||||
awful.rules.rules = {
|
||||
-- Rules here
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
# Block for exporting rules from below
|
||||
#+BEGIN_SRC lua :exports none
|
||||
awful.rules.rules = {
|
||||
awful.rules.rules = {
|
||||
<<rules-universal>>,
|
||||
<<rules-floating>>,
|
||||
<<rules-titlebars>>,
|
||||
<<rules-default-tags>>
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
For more documentation on rules and their syntax, you can read the [[https://awesomewm.org/doc/api/libraries/awful.rules.html][official
|
||||
@ -1177,11 +1177,11 @@ documentation]].
|
||||
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 = {},
|
||||
{ rule = {},
|
||||
properties = {
|
||||
-- List of properties
|
||||
}
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
Here is the list of properties with their value to apply to all clients, and a
|
||||
@ -1201,7 +1201,7 @@ short explanation as to what they do.
|
||||
|
||||
#+NAME: rules-universal-properties
|
||||
#+BEGIN_SRC emacs-lisp :tangle no :exports none :var properties=rules-universal-properties-table :cache yes
|
||||
(mapconcat (lambda (x)
|
||||
(mapconcat (lambda (x)
|
||||
(format "%s = %s"
|
||||
(car x)
|
||||
(cadr x)))
|
||||
@ -1248,7 +1248,7 @@ declare a rule that will match any of the provided conditions:
|
||||
|
||||
#+NAME: rules-floating-conditions
|
||||
#+BEGIN_SRC emacs-lisp :exports none :tangle no :var conditions=rules-floating-conditions-table :cache yes
|
||||
(mapconcat (lambda (x)
|
||||
(mapconcat (lambda (x)
|
||||
(format "%s = { \"%s\" }" (car x) (cadr x)))
|
||||
conditions
|
||||
",\n")
|
||||
@ -1266,9 +1266,9 @@ 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 = {
|
||||
{ rule_any = {
|
||||
<<rules-floating-conditions()>>
|
||||
}, properties = { floating = true }}
|
||||
}, properties = { floating = true }}
|
||||
#+END_SRC
|
||||
|
||||
** Titlebars
|
||||
@ -1278,9 +1278,9 @@ as you can see below:
|
||||
Any normal or dialog client will get a titlebar. This is enabled like so:
|
||||
#+NAME: rules-titlebars
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
{ rule_any = {type = { "normal", "dialog" }
|
||||
{ rule_any = {type = { "normal", "dialog" }
|
||||
}, properties = { titlebars_enabled = true }
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
** Default tag for clients
|
||||
@ -1304,7 +1304,7 @@ to which tag by default.
|
||||
|
||||
#+NAME: rules-default-tags-generate
|
||||
#+BEGIN_SRC emacs-lisp :tangle no :exports none :cache yes :var tags=rules-default-tags-table
|
||||
(mapconcat (lambda (x)
|
||||
(mapconcat (lambda (x)
|
||||
(format "{rule = {%s = \"%s\"}, properties = {screen = 1, tag = \"%d\"} }"
|
||||
(nth 0 x) (nth 1 x) (nth 2 x)))
|
||||
tags
|
||||
@ -1325,7 +1325,7 @@ to which tag by default.
|
||||
This is what these rules look like:
|
||||
#+NAME: rules-default-tags
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
<<rules-default-tags-generate()>>
|
||||
<<rules-default-tags-generate()>>
|
||||
#+END_SRC
|
||||
|
||||
* Signals
|
||||
@ -1344,14 +1344,14 @@ 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)
|
||||
client.connect_signal("manage", function (c)
|
||||
awful.client.movetoscreen(c, mouse.screen)
|
||||
if awesome.startup
|
||||
and not c.size_hints.user_position
|
||||
and not c.size_hints.program_position then
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
** Titlebar creation
|
||||
@ -1363,13 +1363,13 @@ 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)
|
||||
client.connect_signal("request::titlebars", function(c)
|
||||
local buttons = gears.table.join(
|
||||
<<signal-titlebar-button1>>,
|
||||
<<signal-titlebar-button3>>
|
||||
)
|
||||
<<signal-titlebar-create>>
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
The function has two main parts: the creation of the titlebar buttons (mouse
|
||||
@ -1378,29 +1378,29 @@ 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(
|
||||
local buttons = gears.table.join(
|
||||
-- Buttons declared here
|
||||
)
|
||||
)
|
||||
#+END_SRC
|
||||
|
||||
You can see a left click will enable the user to raise the window, but also it
|
||||
will enable the user to move the window (if it is floating of course).
|
||||
#+NAME: signal-titlebar-button1
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ }, 1, function()
|
||||
awful.button({ }, 1, function()
|
||||
c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||
awful.mouse.client.move(c)
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
A right click on the titlebar will also raise the window, but will instead allow
|
||||
the user to resize the client.
|
||||
#+NAME: signal-titlebar-button3
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.button({ }, 3, function()
|
||||
awful.button({ }, 3, function()
|
||||
c:emit_signal("request::activate", "titlebar", {raise = true})
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
Next comes the actual creation of the titlebar for the client ~c~. For that, we
|
||||
@ -1408,9 +1408,9 @@ call ~awful.titlebar()~, tell it where the titlebar should be relative to the
|
||||
client and what its setup should be. The full call should look like so:
|
||||
#+NAME: signal-titlebar-create
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
awful.titlebar(c, {position="left", size = 22}) : setup {
|
||||
awful.titlebar(c, {position="left", size = 22}) : setup {
|
||||
<<signal-titlebar-setup>>
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
In the setup, I need to repeat to Awesome the titlebar should be on the left of
|
||||
@ -1433,21 +1433,21 @@ vertically aligned, and then I can declare my bottom elements:
|
||||
aligned
|
||||
#+NAME: signal-titlebar-setup
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
{ -- Top
|
||||
{ -- Top
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
awful.titlebar.widget.maximizedbutton(c),
|
||||
layout = wibox.layout.fixed.vertical()
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
layout = wibox.layout.fixed.vertical()
|
||||
}, -- Middle
|
||||
{ -- Bottom
|
||||
}, -- Middle
|
||||
{ -- Bottom
|
||||
awful.titlebar.widget.floatingbutton(c),
|
||||
layout = wibox.layout.fixed.vertical()
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
position = "left"
|
||||
},
|
||||
layout = wibox.layout.align.vertical,
|
||||
position = "left"
|
||||
#+END_SRC
|
||||
|
||||
** Changes of focus
|
||||
@ -1459,9 +1459,9 @@ makes windows hovered by the user’s mouse focused. Just for completeness’ sa
|
||||
I included it in this document, but be aware this won’t be tangled into my
|
||||
configuration file and focus will not follow my mouse.
|
||||
#+BEGIN_SRC lua :tangle no
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||
end)
|
||||
end)
|
||||
#+END_SRC
|
||||
|
||||
It is also possible to change the color of the borders based on client focus.
|
||||
@ -1469,8 +1469,8 @@ While my clients don’t have any border, they do have a titlebar which color
|
||||
changes based on the client’s focus. This is handled by the following code
|
||||
snippet:
|
||||
#+BEGIN_SRC lua
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
#+end_SRC
|
||||
|
||||
* Autostart
|
||||
@ -1482,7 +1482,7 @@ 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")
|
||||
awful.spawn.with_shell("autostart")
|
||||
#+END_SRC
|
||||
|
||||
* What to do now :noexport:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -47,8 +47,8 @@ partition is 16GB large.
|
||||
:END:
|
||||
When you boot into the live ISO, execute the following command:
|
||||
#+BEGIN_SRC sh
|
||||
pacman -Sy reflector
|
||||
reflector -c FR -c DE -c BE -l 200 -p http -p https --sort rate \
|
||||
pacman -Sy reflector
|
||||
reflector -c FR -c DE -c BE -l 200 -p http -p https --sort rate \
|
||||
--save /etc/pacman.d/mirrorlist --verbose
|
||||
#+END_SRC
|
||||
|
||||
@ -67,14 +67,14 @@ how the distro works, I just want to be able to install my distro quickly now.
|
||||
I’ll need to download the script with ~wget~, but apparently it isn’t installed
|
||||
by default on Arch ISOs anymore, so I’ll need to install it.
|
||||
#+BEGIN_SRC sh
|
||||
pacman -S wget
|
||||
pacman -S wget
|
||||
#+END_SRC
|
||||
|
||||
Now, let’s grab the script. You can check it on [[https://github.com/matmoul/archfi][Github]].
|
||||
#+BEGIN_SRC sh
|
||||
wget archfi.sf.net/archfi
|
||||
# Or from matmoul.github.io/archfi if SourceForge is down
|
||||
sh archfi
|
||||
wget archfi.sf.net/archfi
|
||||
# Or from matmoul.github.io/archfi if SourceForge is down
|
||||
sh archfi
|
||||
#+END_SRC
|
||||
|
||||
Then, follow the instructions and install Arch Linux. Take the opportunity to
|
||||
@ -90,28 +90,32 @@ your computer.
|
||||
:HEADER-ARGS:fish: :tangle ~/.config/yadm/bootstrap :shebang "#!/usr/bin/fish" :exports code :mkdirp yes
|
||||
:CUSTOM_ID: Execute_bootstrap-e37054ef
|
||||
:END:
|
||||
The first thing I will do is add the [[https://github.com/archlinuxcn/repo][ArchLinuxCN]] repository so I can get access
|
||||
to ~paru~.
|
||||
The first thing I will do is add the [[https://aur.chaotic.cx/][Chaotic AUR]] repository so I can
|
||||
get access to ~paru~ as well as some AUR packages without the need of an
|
||||
AUR helper (ironic considering ~paru~ is one)..
|
||||
#+BEGIN_SRC sh
|
||||
printf '[archlinuxcn]\nServer = https://repo.archlinuxcn.org/$arch\n' | sudo tee -a /etc/pacman.conf
|
||||
sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
|
||||
sudo pacman-key --lsign-key 3056513887B78AEB
|
||||
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
|
||||
printf '[chaotic-aur]\nServer = /etc/pacman.d/chaotic-mirrorlist\n' | sudo tee -a /etc/pacman.conf
|
||||
#+END_SRC
|
||||
|
||||
I can now install ~fish~, ~git~, and ~paru~:
|
||||
#+BEGIN_SRC sh
|
||||
sudo pacman -S fish git paru
|
||||
sudo pacman -S fish git paru
|
||||
#+END_SRC
|
||||
|
||||
And now that ~paru~ is available, we can install ~yadm~:
|
||||
#+BEGIN_SRC sh
|
||||
paru -S yadm
|
||||
paru -S 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:
|
||||
#+BEGIN_SRC sh
|
||||
yadm clone https://labs.phundrak.com/phundrak/dotfiles
|
||||
# or if labs.phundrak.com is down or too slow for you
|
||||
#yadm clone https://github.com/phundrak/dotfiles
|
||||
yadm clone https://labs.phundrak.com/phundrak/dotfiles
|
||||
# or if labs.phundrak.com is down or too slow for you
|
||||
#yadm clone https://github.com/phundrak/dotfiles
|
||||
#+END_SRC
|
||||
|
||||
Let’s take a look at what it does.
|
||||
@ -123,11 +127,11 @@ Let’s take a look at what it does.
|
||||
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'
|
||||
if test "$USER" = 'phundrak'
|
||||
yadm decrypt
|
||||
else
|
||||
else
|
||||
whiptail --yesno "Decrypt private files?" 8 40 && yadm decrypt
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Get a correct keyboard layout
|
||||
@ -140,24 +144,24 @@ 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"
|
||||
set keyboardconf \
|
||||
'Section "InputClass"
|
||||
Identifier "system-keyboard"
|
||||
MatchIsKeyboard "on"
|
||||
Option "XkbLayout" "fr"
|
||||
Option "XkbModel" "pc104"
|
||||
Option "XkbVariant" "bepo_afnor"
|
||||
Option "XkbOptions" "caps:ctrl_modifier"
|
||||
EndSection'
|
||||
EndSection'
|
||||
#+END_SRC
|
||||
|
||||
So, let’s 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
|
||||
if test $status -eq 0
|
||||
printf "\n# Set keyboard layout #########################################################\n\n"
|
||||
whiptail --yesno "Would you like to set your keyboard layout to the bépo layout?" 8 55
|
||||
if test $status -eq 0
|
||||
echo $keyboardconf | sudo tee /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Set our locale
|
||||
@ -167,12 +171,12 @@ So, let’s ask the user if they want to set it as their keyboard configuration.
|
||||
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"
|
||||
set mylocales "en_US.UTF-8 UTF-8" "fr_FR.UTF-8 UTF-8" "ja_JP.UTF-8 UTF-8"
|
||||
#+END_SRC
|
||||
|
||||
I’ll let the user accept them one by one.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Set locale ##################################################################\n\n"
|
||||
printf "\n# Set locale ##################################################################\n\n"
|
||||
|
||||
for item in $mylocales
|
||||
whiptail --yesno "Set the \"$item\" locale?" 8 40
|
||||
@ -184,29 +188,29 @@ I’ll let the user accept them one by one.
|
||||
|
||||
This is my configuration I usually use when it comes to my locale.
|
||||
#+BEGIN_SRC fish
|
||||
set localeconf "LANG=en_DK.UTF-8
|
||||
LC_COLLATE=C
|
||||
LC_NAME=fr_FR.UTF-8
|
||||
LC_IDENTIFICATION=fr_FR.UTF-8
|
||||
LC_TELEPHONE=fr_FR.UTF-8
|
||||
LC_MONETARY=fr_FR.UTF-8
|
||||
LC_PAPER=fr_FR.UTF-8
|
||||
LC_ADDRESS=fr_FR.UTF-8
|
||||
LC_MEASUREMENT=fr_FR.UTF-8"
|
||||
set localeconf "LANG=en_DK.UTF-8
|
||||
LC_COLLATE=C
|
||||
LC_NAME=fr_FR.UTF-8
|
||||
LC_IDENTIFICATION=fr_FR.UTF-8
|
||||
LC_TELEPHONE=fr_FR.UTF-8
|
||||
LC_MONETARY=fr_FR.UTF-8
|
||||
LC_PAPER=fr_FR.UTF-8
|
||||
LC_ADDRESS=fr_FR.UTF-8
|
||||
LC_MEASUREMENT=fr_FR.UTF-8"
|
||||
#+END_SRC
|
||||
|
||||
Let’s set it as our system’s locale if the user whishes to.
|
||||
#+BEGIN_SRC fish
|
||||
whiptail --yesno "Do you agree to have the following locale set?\n\n $localeconf" 20 43
|
||||
if test $status -eq 0
|
||||
whiptail --yesno "Do you agree to have the following locale set?\n\n $localeconf" 20 43
|
||||
if test $status -eq 0
|
||||
echo $localeconf | sudo tee /etc/locale.conf
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
Now we can generate our locale!
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Generate locale #############################################################\n\n"
|
||||
sudo locale-gen
|
||||
printf "\n# Generate locale #############################################################\n\n"
|
||||
sudo locale-gen
|
||||
#+END_SRC
|
||||
|
||||
** Create some folders
|
||||
@ -216,9 +220,9 @@ Now we can generate our locale!
|
||||
Let’s 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}
|
||||
sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android}
|
||||
printf "\n# Create directories for mounting #############################################\n\n"
|
||||
sudo mkdir -p /mnt/{USB,CD,Android}
|
||||
sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android}
|
||||
#+END_SRC
|
||||
|
||||
** Set user’s shell to fish
|
||||
@ -227,11 +231,11 @@ and CDs.
|
||||
:END:
|
||||
First of all, the bootstrap shell will set the user’s shell to fish.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Set fish as the default shell ###############################################\n\n"
|
||||
whiptail --yesno "Set the current user’s default shell to fish?" 8 50
|
||||
if test $status -eq 0 -a ! "$SHELL" = '/usr/bin/fish'
|
||||
printf "\n# Set fish as the default shell ###############################################\n\n"
|
||||
whiptail --yesno "Set the current user’s default shell to fish?" 8 50
|
||||
if test $status -eq 0 -a ! "$SHELL" = '/usr/bin/fish'
|
||||
chsh -s /usr/bin/fish
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Install basic packages
|
||||
@ -240,49 +244,49 @@ First of all, the bootstrap shell will set the user’s shell to fish.
|
||||
:END:
|
||||
Let’s set in a custom varible what packages we’ll be needing.
|
||||
#+BEGIN_SRC fish
|
||||
set PACKAGES \
|
||||
acpi acpilight adobe-source-han-sans-jp-fonts arc-gtk-theme asar ascii \
|
||||
aspell-en aspell-fr awesome awesome-terminal-fonts awesome-freedesktop-git \
|
||||
base-devel bashtop bat biber bitwarden-bin bluez-firmware bluez-utils bzip2 \
|
||||
chicken chromium clisp corrupter-git cppcheck cppreference \
|
||||
cppreference-devhelp cpupower discord-canary discount docker docker-compose \
|
||||
dockerfile-language-server-bin doxygen emacs emacs-org-mode exa exfat-utils \
|
||||
farbfeld fd ffmpegthumbnailer findutils firefox flake8 flat-remix-gtk freeglut \
|
||||
fzf gcc-libs gdb gimp gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts \
|
||||
gnuplot go go-tools golangci-lint-bin graphviz htop hugo i3lock-color \
|
||||
inetutils isync inter-font javascript-typescript-langserver js-beautify \
|
||||
jfsutils jmtpfs kitty lain-git libxft-bgra linux-headers lldb logrotate meson \
|
||||
minted man-db man-pages mpc mpd mpd-rich-presence-discord-git mpv mupdf-tools \
|
||||
nano ncdu ncmpcpp nemo-fileroller nemo-preview neofetch netctl \
|
||||
network-manager-applet networkmanager networkmanager-openvpn \
|
||||
nm-connection-editor nodejs-vmd nomacs nordic-theme-git nordvpn-bin \
|
||||
noto-fonts-emoji npm ntfs-3g numlockx obs-studio openssh otf-fandol \
|
||||
otf-ipafont p7zip pacman-contrib pandoc-bin pass pavucontrol pdfpc picom-git \
|
||||
powerline-fonts prettier pulseaudio-bluetooth python-autoflake python-epc \
|
||||
python-importmagic python-language-server python-nose python-pip python-poetry \
|
||||
python-ptvsd python-pytest qt5-imageformats qemu r raw-thumbnailer reflector \
|
||||
ripgrep rofi rsync rtv ruby-rb-fsevent ruby-sass rustup samba scrot sent \
|
||||
shadow siji-git simplescreenrecorder sshfs sxiv texlive-bibtexextra \
|
||||
texlive-fontsextra texlive-formatsextra texlive-humanities \
|
||||
texlive-langjapanese texlive-pictures texlive-pstricks texlive-publishers \
|
||||
texlive-science tldr tmux tree ttf-arphic-uming ttf-baekmuk ttf-charis-sil \
|
||||
ttf-dejavu ttf-google-fonts-opinionated-git ttf-hanazono ttf-joypixels \
|
||||
ttf-koruri ttf-liberation ttf-monapo ttf-sazanami ttf-tibetan-machine \
|
||||
typescript typescript-language-server-bin unicode-emoji unrar usbutils \
|
||||
valgrind vscode-css-languageserver-bin vscode-html-languageserver-bin w3m wget \
|
||||
x11-ssh-askpass xclip xdg-user-dirs-gtk xfce-polkit xidlehook xfsprogs \
|
||||
xorg-drivers xorg-server xorg-xinit xss-lock xvkbd xwallpaper \
|
||||
yaml-language-server-bin zeal
|
||||
set PACKAGES \
|
||||
acpi acpilight adobe-source-han-sans-jp-fonts arc-gtk-theme asar ascii \
|
||||
aspell-en aspell-fr awesome awesome-terminal-fonts awesome-freedesktop-git \
|
||||
base-devel bashtop bat biber bitwarden-bin bluez-firmware bluez-utils bzip2 \
|
||||
chicken chromium clisp corrupter-git cppcheck cppreference \
|
||||
cppreference-devhelp cpupower discord-canary discount docker docker-compose \
|
||||
dockerfile-language-server-bin doxygen emacs emacs-org-mode exa exfat-utils \
|
||||
farbfeld fd ffmpegthumbnailer findutils firefox flake8 flat-remix-gtk freeglut \
|
||||
fzf gcc-libs gdb gimp gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts \
|
||||
gnuplot go go-tools golangci-lint-bin graphviz htop hugo i3lock-color \
|
||||
inetutils isync inter-font javascript-typescript-langserver js-beautify \
|
||||
jfsutils jmtpfs kitty lain-git libxft-bgra linux-headers lldb logrotate meson \
|
||||
minted man-db man-pages mpc mpd mpd-rich-presence-discord-git mpv mupdf-tools \
|
||||
nano ncdu ncmpcpp nemo-fileroller nemo-preview neofetch netctl \
|
||||
network-manager-applet networkmanager networkmanager-openvpn \
|
||||
nm-connection-editor nodejs-vmd nomacs nordic-theme-git nordvpn-bin \
|
||||
noto-fonts-emoji npm ntfs-3g numlockx obs-studio openssh otf-fandol \
|
||||
otf-ipafont p7zip pacman-contrib pandoc-bin pass pavucontrol pdfpc picom-git \
|
||||
powerline-fonts prettier pulseaudio-bluetooth python-autoflake python-epc \
|
||||
python-importmagic python-language-server python-nose python-pip python-poetry \
|
||||
python-ptvsd python-pytest qt5-imageformats qemu r raw-thumbnailer reflector \
|
||||
ripgrep rofi rsync rtv ruby-rb-fsevent ruby-sass rustup samba scrot sent \
|
||||
shadow siji-git simplescreenrecorder sshfs sxiv texlive-bibtexextra \
|
||||
texlive-fontsextra texlive-formatsextra texlive-humanities \
|
||||
texlive-langjapanese texlive-pictures texlive-pstricks texlive-publishers \
|
||||
texlive-science tldr tmux tree ttf-arphic-uming ttf-baekmuk ttf-charis-sil \
|
||||
ttf-dejavu ttf-google-fonts-opinionated-git ttf-hanazono ttf-joypixels \
|
||||
ttf-koruri ttf-liberation ttf-monapo ttf-sazanami ttf-tibetan-machine \
|
||||
typescript typescript-language-server-bin unicode-emoji unrar usbutils \
|
||||
valgrind vscode-css-languageserver-bin vscode-html-languageserver-bin w3m wget \
|
||||
x11-ssh-askpass xclip xdg-user-dirs-gtk xfce-polkit xidlehook xfsprogs \
|
||||
xorg-drivers xorg-server xorg-xinit xss-lock xvkbd xwallpaper \
|
||||
yaml-language-server-bin zeal
|
||||
#+END_SRC
|
||||
|
||||
These are the minimum I would have in my own installation. You can edit it
|
||||
however you want. Let’s install those.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing needed packages ##################################################\n\n"
|
||||
sudo pacman -Syu
|
||||
for pkg in $PACKAGES
|
||||
printf "\n# Installing needed packages ##################################################\n\n"
|
||||
sudo pacman -Syu
|
||||
for pkg in $PACKAGES
|
||||
paru -S --needed $pkg
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Tangle configuration files from Org files
|
||||
@ -308,7 +312,7 @@ need to create:
|
||||
|
||||
#+NAME: gen-dirs-tangle
|
||||
#+BEGIN_SRC emacs-lisp :var dirs=dirs-tangled-files
|
||||
(mapconcat (lambda (x) (format "mkdir -p %s" (car x)))
|
||||
(mapconcat (lambda (x) (format "mkdir -p %s" (car x)))
|
||||
dirs
|
||||
"\n")
|
||||
#+END_SRC
|
||||
@ -331,7 +335,7 @@ mkdir -p $HOME/org/capture
|
||||
|
||||
Our code to generate such directories looks like this:
|
||||
#+BEGIN_SRC fish :noweb yes
|
||||
<<gen-dirs-tangle()>>
|
||||
<<gen-dirs-tangle()>>
|
||||
#+END_SRC
|
||||
|
||||
The next step is to tangle all the Org files. Here is the list of files that are
|
||||
@ -350,7 +354,7 @@ to be tangled:
|
||||
|
||||
#+NAME: generate-tangle
|
||||
#+BEGIN_SRC emacs-lisp :var files=tangled-files[,0]
|
||||
(mapconcat (lambda (x) (concat
|
||||
(mapconcat (lambda (x) (concat
|
||||
(format "printf '\\n\\n==== Tangling %s\\n\\n' && \\\n" x)
|
||||
(concat "emacs -q --batch --eval '(require \\'ob-tangle)' \\\n"
|
||||
"--eval '(setq org-confirm-babel-evaluate nil)' \\\n"
|
||||
@ -403,8 +407,8 @@ emacs -q --batch --eval '(require \'ob-tangle)' \
|
||||
#+end_example
|
||||
|
||||
#+BEGIN_SRC fish :noweb yes
|
||||
printf "\n# Tangling org files ##########################################################\n\n"
|
||||
<<generate-tangle()>>
|
||||
printf "\n# Tangling org files ##########################################################\n\n"
|
||||
<<generate-tangle()>>
|
||||
#+END_SRC
|
||||
|
||||
** Setting up Emacs: Installing Spacemacs
|
||||
@ -418,19 +422,19 @@ cloned within our =~/.config/emacs= directory, and git won’t let us clone
|
||||
Spacemacs in an already existing and non-empty directory. To make sure it isn’t
|
||||
one, let’s delete any potentially existing =~/.config/emacs= directory:
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing Spacemacs ########################################################\n\n"
|
||||
rm -rf $HOME/.config/emacs $HOME/.emacs* .spacemacs
|
||||
printf "\n# Installing Spacemacs ########################################################\n\n"
|
||||
rm -rf $HOME/.config/emacs $HOME/.emacs* .spacemacs
|
||||
#+END_SRC
|
||||
|
||||
Now we can clone Spacemacs:
|
||||
#+BEGIN_SRC fish
|
||||
git clone --branch develop https://github.com/syl20bnr/spacemacs ~/.config/emacs
|
||||
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:
|
||||
#+BEGIN_SRC fish
|
||||
yadm checkout -- ~/.config/emacs/private/
|
||||
yadm checkout -- ~/.config/emacs/private/
|
||||
#+END_SRC
|
||||
|
||||
** Set up dotfiles’ git repository
|
||||
@ -444,26 +448,26 @@ directory:
|
||||
This line in the bootstrap script will test if the current user is using my
|
||||
username. If yes, it’s probably me.
|
||||
#+BEGIN_SRC fish
|
||||
if test "$USER" = 'phundrak'
|
||||
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.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Update yadm’s remotes #######################################################\n\n"
|
||||
yadm remote set-url origin git@labs.phundrak.com:phundrak/dotfiles.git
|
||||
yadm remote add github git@github.com:phundrak/dotfiles.git
|
||||
printf "\n# Update yadm’s remotes #######################################################\n\n"
|
||||
yadm remote set-url origin git@labs.phundrak.com:phundrak/dotfiles.git
|
||||
yadm remote add github git@github.com:phundrak/dotfiles.git
|
||||
#+END_SRC
|
||||
|
||||
I will also want to decrypt my encrypted files, such as said ssh keys.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Decrypt encrypted dotfiles ##################################################\n\n"
|
||||
yadm decrypt
|
||||
printf "\n# Decrypt encrypted dotfiles ##################################################\n\n"
|
||||
yadm decrypt
|
||||
#+END_SRC
|
||||
|
||||
Finally, let’s close this ~if~ statement.
|
||||
#+BEGIN_SRC fish
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
*** Update our submodules
|
||||
@ -473,8 +477,8 @@ Finally, let’s close this ~if~ statement.
|
||||
Now we can download the various dependencies of our dotfiles. To do so, let’s
|
||||
run the following command:
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Getting yadm susbmodules ####################################################\n\n"
|
||||
yadm submodule update --init --recursive
|
||||
printf "\n# Getting yadm susbmodules ####################################################\n\n"
|
||||
yadm submodule update --init --recursive
|
||||
#+END_SRC
|
||||
|
||||
** Enable some services
|
||||
@ -491,14 +495,14 @@ them.
|
||||
This service enables time syncing with the NTP protocol, so I can be sure my
|
||||
computer’s 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
|
||||
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 computer’s time
|
||||
synced.
|
||||
#+BEGIN_SRC fish
|
||||
sudo timedatectl set-ntp true
|
||||
sudo timedatectl set-ntp true
|
||||
#+END_SRC
|
||||
|
||||
*** Docker
|
||||
@ -507,17 +511,17 @@ synced.
|
||||
:END:
|
||||
First, let’s activate Docker on startup.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Enabling and starting Docker ################################################\n\n"
|
||||
sudo systemctl enable --now docker
|
||||
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 won’t 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 = ''
|
||||
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 = ''
|
||||
sudo usermod -aG docker $USER
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
*** Emacs
|
||||
@ -529,8 +533,8 @@ in. However, the service won’t 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
|
||||
printf "\n# Enabling Emacs as user service ##############################################\n\n"
|
||||
systemctl --user enable emacs
|
||||
#+END_SRC
|
||||
|
||||
*** Mpd
|
||||
@ -540,9 +544,9 @@ will happen, and then once that is done I will start the service.
|
||||
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
|
||||
systemctl --user enable --now mpd
|
||||
printf "\n# Enabling Mpd as a user service ##############################################\n\n"
|
||||
mkdir -p ~/.config/mpd/playlists
|
||||
systemctl --user enable --now mpd
|
||||
#+END_SRC
|
||||
|
||||
*** SSH server
|
||||
@ -552,11 +556,11 @@ my configuration.
|
||||
Maybe we want to activate an SSH server on our machine. If so, we can enable it.
|
||||
Let’s ask the question.
|
||||
#+BEGIN_SRC fish
|
||||
whiptail --yesno 'Do you want to activate the ssh server?' 8 50
|
||||
if test $status -eq 0
|
||||
whiptail --yesno 'Do you want to activate the ssh server?' 8 50
|
||||
if test $status -eq 0
|
||||
printf "\n# Enabling ssh server #########################################################\n\n"
|
||||
sudo systemctl enable --now sshd
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
*** Acpilight
|
||||
@ -568,7 +572,7 @@ 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
|
||||
sudo usermod -aG video $USER
|
||||
#+END_SRC
|
||||
|
||||
*** NordVPN
|
||||
@ -579,7 +583,7 @@ 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
|
||||
sudo systemctl enable --now nordvpnd
|
||||
#+END_SRC
|
||||
|
||||
Let’s also set its default protocol to UDP. This will allow me to use any port
|
||||
@ -587,7 +591,7 @@ 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 tcp
|
||||
nordvpn s protocol tcp
|
||||
#+END_SRC
|
||||
|
||||
** Symlink some system config files
|
||||
@ -596,16 +600,16 @@ ports. Thanks University of Paris 8 for being SO paranoid.
|
||||
:END:
|
||||
We have some files in [[file:ect/][etc/]] that are to be symlinked to =/etc=.
|
||||
#+BEGIN_SRC fish
|
||||
for f in (find ~/.etc -type f)
|
||||
for f in (find ~/.etc -type f)
|
||||
set dest (echo $f | sed -n 's|^.*etc\(.*\)$|/etc\1|p')
|
||||
sudo ln -s $f $dest
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
Let’s 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
|
||||
sudo ln -s (which plock) /usr/bin/plock
|
||||
#+END_SRC
|
||||
|
||||
** Install packages from git
|
||||
@ -614,7 +618,7 @@ can find it.
|
||||
:END:
|
||||
Now, let’s install some packages from git directly.
|
||||
#+BEGIN_SRC fish
|
||||
mkdir -p ~/fromGIT
|
||||
mkdir -p ~/fromGIT
|
||||
#+END_SRC
|
||||
|
||||
*** Reveal.JS
|
||||
@ -624,9 +628,9 @@ Now, let’s install some packages from git directly.
|
||||
I sometimes use Reveal.JS to make presentations, and I set its location in my
|
||||
[[file:.spacemacs][dotspacemacs]] file to be in =~/fromGIT=, so let’s clone it there.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Install Reveal.JS ###########################################################\n\n"
|
||||
cd ~/fromGIT
|
||||
git clone https://github.com/hakimel/reveal.js.git
|
||||
printf "\n# Install Reveal.JS ###########################################################\n\n"
|
||||
cd ~/fromGIT
|
||||
git clone https://github.com/hakimel/reveal.js.git
|
||||
#+END_SRC
|
||||
|
||||
** Install Rust
|
||||
@ -641,14 +645,14 @@ 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
|
||||
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, let’s run this:
|
||||
#+BEGIN_SRC fish
|
||||
rustup toolchain install nightly
|
||||
rustup toolchain install nightly
|
||||
#+END_SRC
|
||||
|
||||
*** Install some utilities
|
||||
@ -658,8 +662,8 @@ to install the nightly toolchain, let’s run this:
|
||||
We’ll need some utilities when developing Rust from Emacs, namely ~rustfmt~ and
|
||||
~racer~. Let’s install them with ~cargo~.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Add rust utilities ##########################################################\n\n"
|
||||
cargo install rustfmt racer
|
||||
printf "\n# Add rust utilities ##########################################################\n\n"
|
||||
cargo install rustfmt racer
|
||||
#+END_SRC
|
||||
|
||||
We will also need some components for development purposes.
|
||||
@ -672,7 +676,7 @@ We will also need some components for development purposes.
|
||||
|
||||
#+NAME: rust-components-gen
|
||||
#+BEGIN_SRC emacs-lisp :var components=rust-components-table[,0]
|
||||
(mapconcat (lambda (x) (format "rustup component add %s" x))
|
||||
(mapconcat (lambda (x) (format "rustup component add %s" x))
|
||||
components
|
||||
"\n")
|
||||
#+END_SRC
|
||||
@ -684,7 +688,7 @@ We will also need some components for development purposes.
|
||||
|
||||
Here is the code to do so:
|
||||
#+BEGIN_SRC fish :noweb yes
|
||||
<<rust-components-gen()>>
|
||||
<<rust-components-gen()>>
|
||||
#+END_SRC
|
||||
|
||||
** Install some python packages
|
||||
@ -703,7 +707,7 @@ working.
|
||||
|
||||
#+NAME: python-packages-gen
|
||||
#+BEGIN_SRC emacs-lisp :var packages=python-packages-table[,0]
|
||||
(format "pip install --user %s"
|
||||
(format "pip install --user %s"
|
||||
(string-join packages " "))
|
||||
#+END_SRC
|
||||
|
||||
@ -712,8 +716,8 @@ working.
|
||||
|
||||
Let’s install them locally for our user.
|
||||
#+BEGIN_SRC fish :noweb yes
|
||||
printf "\n# Installing Python packages ##################################################\n\n"
|
||||
<<python-packages-gen()>>
|
||||
printf "\n# Installing Python packages ##################################################\n\n"
|
||||
<<python-packages-gen()>>
|
||||
#+END_SRC
|
||||
|
||||
** Set up Chicken (Scheme interpreter/compiler)
|
||||
@ -723,14 +727,14 @@ Let’s install them locally for our user.
|
||||
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
|
||||
printf "\n# Setting up Chicken ##########################################################\n\n"
|
||||
chicken-install -s apropos chicken-doc
|
||||
#+END_SRC
|
||||
|
||||
Then, we’ll complete the documentation like so:
|
||||
#+BEGIN_SRC fish
|
||||
cd (chicken-csi -b -e "(import (chicken platform))" -p "(chicken-home)")
|
||||
curl https://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx
|
||||
cd (chicken-csi -b -e "(import (chicken platform))" -p "(chicken-home)")
|
||||
curl https://3e8.org/pub/chicken-doc/chicken-doc-repo.tgz | sudo tar zx
|
||||
#+END_SRC
|
||||
|
||||
** Set up our fish shell
|
||||
@ -746,8 +750,8 @@ order to improve the user experience.
|
||||
:END:
|
||||
We will be using ~fisher~ as our extensions manager for Fish. Let’s install it.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Installing fisher ###########################################################\n\n"
|
||||
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
|
||||
printf "\n# Installing fisher ###########################################################\n\n"
|
||||
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
|
||||
#+END_SRC
|
||||
|
||||
*** Install our extensions
|
||||
@ -770,7 +774,7 @@ I generally use the following extensions in my Fish shell.
|
||||
|
||||
#+NAME: fish-extensions-gen
|
||||
#+BEGIN_SRC emacs-lisp :var extensions=fish-extensions-table[,0]
|
||||
(mapconcat (lambda (x) (format "fisher add %s" x))
|
||||
(mapconcat (lambda (x) (format "fisher add %s" x))
|
||||
extensions
|
||||
"\n")
|
||||
#+END_SRC
|
||||
@ -786,6 +790,6 @@ I generally use the following extensions in my Fish shell.
|
||||
: fisher add oh-my-fish/theme-bobthefish
|
||||
|
||||
#+BEGIN_SRC fish :noweb yes
|
||||
printf "\n# Installing Fisher Extensions ################################################\n\n"
|
||||
<<fish-extensions-gen()>>
|
||||
printf "\n# Installing Fisher Extensions ################################################\n\n"
|
||||
<<fish-extensions-gen()>>
|
||||
#+END_SRC
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,9 +18,9 @@ abbreviations.
|
||||
Just in case, we might need sometimes to declare the fish function =fish_title=
|
||||
as =true=, so let’s do so.
|
||||
#+BEGIN_SRC fish
|
||||
function fish_title
|
||||
function fish_title
|
||||
true
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Fish from within Emacs
|
||||
@ -30,9 +30,9 @@ as =true=, so let’s do so.
|
||||
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"
|
||||
if test -n "$EMACS"
|
||||
set -x TERM eterm-color
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Tramp remote access
|
||||
@ -44,14 +44,14 @@ 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, let’s
|
||||
deactivate and redefine some of the functions defining the appearance of fish.
|
||||
#+BEGIN_SRC fish
|
||||
if test "$TERM" = "dumb"
|
||||
if test "$TERM" = "dumb"
|
||||
function fish_prompt
|
||||
echo "\$ "
|
||||
end
|
||||
function fish_right_prompt; end
|
||||
function fish_greeting; end
|
||||
function fish_title; end
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* Regular fish shell appearance
|
||||
@ -63,11 +63,11 @@ when I’m the one using it: the ~fish_greeting~ function. I use it to give me a
|
||||
overview of my computer’s 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'
|
||||
set NC '\033[0m'
|
||||
set RED '\033[0;31m'
|
||||
set GREEN '\033[0;32m'
|
||||
set NC '\033[0m'
|
||||
|
||||
function display_slider # used total
|
||||
function display_slider # used total
|
||||
set -l slider_length 38
|
||||
set -l used $argv[1]
|
||||
set -l total $argv[2]
|
||||
@ -80,9 +80,9 @@ ram usage, swap usage, and networking.
|
||||
echo -en (string repeat -n $unused_slider '=')
|
||||
echo -en $NC
|
||||
echo -en "]"
|
||||
end
|
||||
end
|
||||
|
||||
function fish_greeting
|
||||
function fish_greeting
|
||||
set -l ruler_length 79
|
||||
set -l ruler (string repeat -n $ruler_length "=")
|
||||
|
||||
@ -127,24 +127,24 @@ ram usage, swap usage, and networking.
|
||||
printf "Ram.....: %s %5dM / %5dM (%2d%%)\n" (display_slider $ram_used $ram_total) $ram_used $ram_total $ram_p
|
||||
printf "Swap....: %s %5dM / %5dM (%2d%%)\n" (display_slider $swap_used $swap_total) $swap_used $swap_total $swap_p
|
||||
echo $ruler
|
||||
end
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
The theme I use for fish is [[https://github.com/oh-my-fish/theme-bobthefish][bobthefish]], which by default puts a really long
|
||||
timestamp to the right of the prompt. I want something shorter, so here is the
|
||||
variable to set, using the format specified in ~date(1)~.
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_date_format "+%g-%m-%d %H:%M:%S"
|
||||
set -g theme_date_format "+%g-%m-%d %H:%M:%S"
|
||||
#+END_SRC
|
||||
|
||||
I also wish to have a kinda different newline prompt, so let’s set it:
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_newline_prompt 'λ '
|
||||
set -g theme_newline_prompt 'λ '
|
||||
#+END_SRC
|
||||
|
||||
Finally, let’s set our prompt’s theme to the Nord theme.
|
||||
#+BEGIN_SRC fish
|
||||
set -g theme_color_scheme nord
|
||||
set -g theme_color_scheme nord
|
||||
#+END_SRC
|
||||
|
||||
* Global variables
|
||||
@ -154,24 +154,24 @@ Finally, let’s set our prompt’s theme to the Nord theme.
|
||||
In order to keep some other code clean, I set the ~$BROWSER~ variable so I don’t
|
||||
have to call my web browser directly but rather with this variable.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx BROWSER firefox
|
||||
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, let’s declare it.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx SUDO_ASKPASS ~/.local/bin/askpass
|
||||
set -gx SUDO_ASKPASS ~/.local/bin/askpass
|
||||
#+END_SRC
|
||||
|
||||
In general, I prefer using ~bat~ to ~less~, although the former relies on the
|
||||
latter, but ~bat~ provides nice wrapping around ~less~, including syntax
|
||||
highlighting. Let’s set the manpager to bat then:
|
||||
#+BEGIN_SRC fish
|
||||
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||
#+END_SRC
|
||||
|
||||
#+begin_src fish
|
||||
set -x XMODIFIERS
|
||||
set -x XMODIFIERS
|
||||
#+end_src
|
||||
|
||||
** Development
|
||||
@ -182,8 +182,8 @@ Now, let’s declare our editor of choice, EmacsClient; not Emacs itself since i
|
||||
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
|
||||
set -gx EDITOR emacsclient -c
|
||||
set -gx VISUAL emacsclient -c
|
||||
#+END_SRC
|
||||
|
||||
We also need to set the path to the Dart SDK.
|
||||
@ -198,21 +198,21 @@ set -gx ANDROID_HOME $HOME/Android/Sdk
|
||||
|
||||
Still related to Dart and Flutter development,
|
||||
#+BEGIN_SRC fish
|
||||
set -gx CHROME_EXECUTABLE /usr/bin/chromium
|
||||
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).
|
||||
#+BEGIN_SRC fish
|
||||
set -gx DENO_DIR $HOME/.config/deno
|
||||
set -gx DENO_INSTALL_ROOT $HOME/.local/bin/deno
|
||||
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
|
||||
let’s do so.
|
||||
#+BEGIN_SRC fish
|
||||
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
|
||||
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
|
||||
#+END_SRC
|
||||
|
||||
** ~$PATH~
|
||||
@ -237,7 +237,7 @@ my own executables, and some more.
|
||||
|
||||
#+NAME: generate-extra-paths
|
||||
#+BEGIN_SRC emacs-lisp :var paths=extra-paths[,0] :exports none :cache yes
|
||||
(mapconcat #'identity
|
||||
(mapconcat #'identity
|
||||
paths " \\\n")
|
||||
#+END_SRC
|
||||
|
||||
@ -251,8 +251,8 @@ my own executables, and some more.
|
||||
|
||||
So, let’s set our user paths:
|
||||
#+BEGIN_SRC fish :noweb yes
|
||||
set -g fish_user_paths \
|
||||
<<generate-extra-paths()>>
|
||||
set -g fish_user_paths \
|
||||
<<generate-extra-paths()>>
|
||||
#+END_SRC
|
||||
|
||||
* Abbreviations
|
||||
@ -261,7 +261,7 @@ So, let’s set our user paths:
|
||||
:END:
|
||||
#+NAME: generate-abbr
|
||||
#+BEGIN_SRC emacs-lisp :var table=[] :exports none :tangle no
|
||||
(replace-regexp-in-string "\\\\vert[{}]*"
|
||||
(replace-regexp-in-string "\\\\vert[{}]*"
|
||||
"|"
|
||||
(mapconcat (lambda (x) (format "abbr %s '%s'" (car x) (cadr x)))
|
||||
table
|
||||
@ -306,7 +306,7 @@ running right now, and =pscpu10= limits that to the top 10 threads. Similarly,
|
||||
| psmem10 | ps auxf \vert sort -nr -k 4 \vert head -10 |
|
||||
|
||||
#+begin_SRC fish
|
||||
<<generate-abbr(table=mgmt-abbr)>>
|
||||
<<generate-abbr(table=mgmt-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
** System management (packages and services)
|
||||
@ -332,7 +332,7 @@ can type =search=. Otherwise, if I want to include AUR results, I’ll use =paru
|
||||
| purge | paru -Sc |
|
||||
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=pm-abbr)>>
|
||||
<<generate-abbr(table=pm-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Service management
|
||||
@ -349,7 +349,7 @@ system services, I can instead type a simple capital =S=.
|
||||
| suser | systemctl --user |
|
||||
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=service-abbr)>>
|
||||
<<generate-abbr(table=service-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
** Development
|
||||
@ -373,7 +373,7 @@ configuration for debug or release profiles.
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=abbr-cmake)>>
|
||||
<<generate-abbr(table=abbr-cmake)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Docker
|
||||
@ -398,7 +398,7 @@ full command, so I use these instead.
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=abbr-docker)>>
|
||||
<<generate-abbr(table=abbr-docker)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Text editors
|
||||
@ -419,7 +419,7 @@ In case we want to launch Emacs in GUI mode anyways, ~egui~ is available too.
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish :noweb yes
|
||||
<<generate-abbr(table=abbr-text-ed)>>
|
||||
<<generate-abbr(table=abbr-text-ed)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Compilation
|
||||
@ -438,7 +438,7 @@ with the ~-Wall~ flag activated.
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=abbr-comp)>>
|
||||
<<generate-abbr(table=abbr-comp)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Git
|
||||
@ -455,7 +455,7 @@ covered.
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=abbr-git)>>
|
||||
<<generate-abbr(table=abbr-git)>>
|
||||
#+END_SRC
|
||||
|
||||
** LaTeX
|
||||
@ -475,7 +475,7 @@ abbreviation. Same goes for ~texhash~ which must be run as sudo.
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=latex-abbr)>>
|
||||
<<generate-abbr(table=latex-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
** Some security measures
|
||||
@ -507,7 +507,7 @@ accidentally removing the root folder. I added the same option to =chgrp=,
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=sec-abbr)>>
|
||||
<<generate-abbr(table=sec-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
** Typos
|
||||
@ -530,7 +530,7 @@ So, let's just replace the former by the latter. I'm also very bad at typing
|
||||
|
||||
Here is the corresponding fish configuration:
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=typo-abbr)>>
|
||||
<<generate-abbr(table=typo-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
** Misc
|
||||
@ -548,33 +548,33 @@ 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" &'
|
||||
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.
|
||||
#+BEGIN_SRC fish
|
||||
abbr mpv 'mpv --no-border --force-window=no'
|
||||
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~.
|
||||
#+BEGIN_SRC fish
|
||||
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"'
|
||||
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)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.
|
||||
#+BEGIN_SRC fish
|
||||
abbr sxiv 'sxiv -abfs f'
|
||||
abbr sxiv 'sxiv -abfs f'
|
||||
#+END_SRC
|
||||
|
||||
Finally, let's declare the following abbreviation that will launch an mpv
|
||||
instance displaying my webcam:
|
||||
#+BEGIN_SRC fish
|
||||
abbr webcam 'devour mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0'
|
||||
abbr webcam 'devour mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0'
|
||||
#+END_SRC
|
||||
|
||||
*** Sudo
|
||||
@ -585,7 +585,7 @@ 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'
|
||||
abbr please 'sudo -A'
|
||||
#+END_SRC
|
||||
|
||||
*** History
|
||||
@ -595,7 +595,7 @@ custom graphical script for getting my password (see [[file:bin.org::#Askpass-d0
|
||||
I find it more intuitive and faster to just write ~hist~ instead of ~history~,
|
||||
so let's declare that.
|
||||
#+BEGIN_SRC fish
|
||||
abbr hist history
|
||||
abbr hist history
|
||||
#+END_SRC
|
||||
|
||||
*** Compression
|
||||
@ -614,7 +614,7 @@ management]]).
|
||||
| untar | tar -xvzf |
|
||||
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=tar-abbr)>>
|
||||
<<generate-abbr(table=tar-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
*** exa
|
||||
@ -628,7 +628,7 @@ management]]).
|
||||
| lsl | exa -halg@ --group-directories-first --git |
|
||||
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=exa-abbr)>>
|
||||
<<generate-abbr(table=exa-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Network Management
|
||||
@ -638,7 +638,7 @@ management]]).
|
||||
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'
|
||||
abbr nmcli 'nmcli -p -c auto'
|
||||
#+END_SRC
|
||||
|
||||
*** NordVPN
|
||||
@ -662,7 +662,7 @@ the US.
|
||||
| ncu | nordvpn c United_States |
|
||||
|
||||
#+BEGIN_SRC fish
|
||||
<<generate-abbr(table=nordvpn-abbr)>>
|
||||
<<generate-abbr(table=nordvpn-abbr)>>
|
||||
#+END_SRC
|
||||
|
||||
*** Wget
|
||||
@ -671,7 +671,7 @@ the US.
|
||||
:END:
|
||||
By default, continue a download that was interupted.
|
||||
#+BEGIN_SRC fish
|
||||
abbr wget 'wget -c'
|
||||
abbr wget 'wget -c'
|
||||
#+END_SRC
|
||||
|
||||
* Last thing before we’re done
|
||||
|
@ -126,23 +126,23 @@ 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, let’s select the Nordic theme for GTK2. Let’s also set the icon theme.
|
||||
#+BEGIN_SRC conf-unix
|
||||
# -*- mode: unix-config -*-
|
||||
gtk-theme-name="Nordic"
|
||||
gtk-icon-theme-name="Flat-Remix-Dark"
|
||||
# -*- mode: unix-config -*-
|
||||
gtk-theme-name="Nordic"
|
||||
gtk-icon-theme-name="Flat-Remix-Dark"
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC conf-unix
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle="hintslight"
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle="hintslight"
|
||||
#+END_SRC
|
||||
|
||||
This changes the shortcuts in menu, let’s also make the menus snappier.
|
||||
#+BEGIN_SRC conf-unix
|
||||
gtk-can-change-accels=1
|
||||
gtk-menu-bar-popup-delay=0
|
||||
gtk-menu-popdown-delay=0
|
||||
gtk-menu-popup-delay=0
|
||||
gtk-can-change-accels=1
|
||||
gtk-menu-bar-popup-delay=0
|
||||
gtk-menu-popdown-delay=0
|
||||
gtk-menu-popup-delay=0
|
||||
#+END_SRC
|
||||
|
||||
***** Filechooser
|
||||
@ -151,60 +151,60 @@ This changes the shortcuts in menu, let’s also make the menus snappier.
|
||||
:CUSTOM_ID: Features-Graphical_tweaks-GTK_Settings-GTK2-Filechooser-389f040d
|
||||
:END:
|
||||
#+BEGIN_SRC conf-unix
|
||||
[Filechooser Settings]
|
||||
[Filechooser Settings]
|
||||
#+END_SRC
|
||||
|
||||
The first option alows me to open the file chooser in the current working
|
||||
directory:
|
||||
#+BEGIN_SRC conf-unix
|
||||
StartupMode=cwd
|
||||
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.
|
||||
#+BEGIN_SRC conf-unix
|
||||
LocationMode=path-bar
|
||||
LocationMode=path-bar
|
||||
#+END_SRC
|
||||
|
||||
With this configuration, by default we won’t see hidden files.
|
||||
#+BEGIN_SRC conf-unix
|
||||
ShowHidden=true
|
||||
ShowHidden=true
|
||||
#+END_SRC
|
||||
|
||||
And we'll also see the size of the visible files.
|
||||
#+BEGIN_SRC conf-unix
|
||||
ShowSizeColumn=true
|
||||
ShowSizeColumn=true
|
||||
#+END_SRC
|
||||
|
||||
Now, let’s 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
|
||||
GeometryX=566
|
||||
GeometryY=202
|
||||
#+END_SRC
|
||||
|
||||
And these two describe the size of the window:
|
||||
#+BEGIN_SRC conf-unix
|
||||
GeometryWidth=800
|
||||
GeometryHeight=400
|
||||
GeometryWidth=800
|
||||
GeometryHeight=400
|
||||
#+END_SRC
|
||||
|
||||
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
|
||||
SortColumn=name
|
||||
SortOrder=ascending
|
||||
#+END_SRC
|
||||
|
||||
Our default view mode is a list of files:
|
||||
#+BEGIN_SRC conf-unix
|
||||
ViewMode=list-view
|
||||
ViewMode=list-view
|
||||
#+END_SRC
|
||||
|
||||
And finally, setting our icon view scale to ~-1~ sets the icon view to the max
|
||||
size.
|
||||
#+BEGIN_SRC conf-unix
|
||||
IconViewScale=-1
|
||||
IconViewScale=-1
|
||||
#+END_SRC
|
||||
|
||||
**** GTK3
|
||||
@ -215,44 +215,44 @@ size.
|
||||
The following file helps me choosing the aspect of various GTK+ 3 software,
|
||||
including their theme and icons. First, let’s declare the header:
|
||||
#+BEGIN_SRC conf-unix
|
||||
[Settings]
|
||||
[Settings]
|
||||
#+END_SRC
|
||||
|
||||
Now, let’s 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
|
||||
gtk-application-prefer-dark-theme = true
|
||||
#+END_SRC
|
||||
|
||||
Next, the icon theme is the Flat Remix Dark icon theme:
|
||||
#+BEGIN_SRC conf-unix
|
||||
gtk-icon-theme-name = Flat-Remix-Dark
|
||||
gtk-icon-theme-name = Flat-Remix-Dark
|
||||
#+END_SRC
|
||||
|
||||
Now, the general theme for GTK3 is Nordic.
|
||||
#+BEGIN_SRC conf-unix
|
||||
gtk-theme-name = Nordic
|
||||
gtk-theme-name = Nordic
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC conf-unix
|
||||
gtk-can-change-accels=1
|
||||
gtk-menu-bar-popup-delay=0
|
||||
gtk-menu-popdown-delay=0
|
||||
gtk-menu-popup-delay=0
|
||||
gtk-can-change-accels=1
|
||||
gtk-menu-bar-popup-delay=0
|
||||
gtk-menu-popdown-delay=0
|
||||
gtk-menu-popup-delay=0
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC conf-unix
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle=hintslight
|
||||
# gtk-xft-rgba=rgb
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle=hintslight
|
||||
# gtk-xft-rgba=rgb
|
||||
#+END_SRC
|
||||
|
||||
Since window decorations are handled by my WMs, I will leave this variable
|
||||
empty.
|
||||
#+BEGIN_SRC conf-unix
|
||||
gtk-decoration-layout=
|
||||
gtk-decoration-layout=
|
||||
#+END_SRC
|
||||
|
||||
*** Picom (Compton)
|
||||
@ -271,45 +271,45 @@ You can find my Picom configuration [[file:picom.org][here]].
|
||||
The main body in my Xresources declaration 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
|
||||
#define nord2 #434C5E
|
||||
#define nord3 #4C566A
|
||||
#define nord4 #D8DEE9
|
||||
#define nord5 #E5E9F0
|
||||
#define nord6 #ECEFF4
|
||||
#define nord7 #8FBCBB
|
||||
#define nord8 #88C0D0
|
||||
#define nord9 #81A1C1
|
||||
#define nord10 #5E81AC
|
||||
#define nord11 #BF616A
|
||||
#define nord12 #D08770
|
||||
#define nord13 #EBCB8B
|
||||
#define nord14 #A3BE8C
|
||||
#define nord15 #B48EAD
|
||||
#define nord0 #2E3440
|
||||
#define nord1 #3B4252
|
||||
#define nord2 #434C5E
|
||||
#define nord3 #4C566A
|
||||
#define nord4 #D8DEE9
|
||||
#define nord5 #E5E9F0
|
||||
#define nord6 #ECEFF4
|
||||
#define nord7 #8FBCBB
|
||||
#define nord8 #88C0D0
|
||||
#define nord9 #81A1C1
|
||||
#define nord10 #5E81AC
|
||||
#define nord11 #BF616A
|
||||
#define nord12 #D08770
|
||||
#define nord13 #EBCB8B
|
||||
#define nord14 #A3BE8C
|
||||
#define nord15 #B48EAD
|
||||
|
||||
,*.foreground: nord4
|
||||
,*.background: nord0
|
||||
,*.cursorColor: nord4
|
||||
,*fading: 35
|
||||
,*fadeColor: nord3
|
||||
,*.foreground: nord4
|
||||
,*.background: nord0
|
||||
,*.cursorColor: nord4
|
||||
,*fading: 35
|
||||
,*fadeColor: nord3
|
||||
|
||||
,*.color0: nord1
|
||||
,*.color1: nord11
|
||||
,*.color2: nord14
|
||||
,*.color3: nord13
|
||||
,*.color4: nord9
|
||||
,*.color5: nord15
|
||||
,*.color6: nord8
|
||||
,*.color7: nord5
|
||||
,*.color8: nord3
|
||||
,*.color9: nord11
|
||||
,*.color10: nord14
|
||||
,*.color11: nord13
|
||||
,*.color12: nord9
|
||||
,*.color13: nord15
|
||||
,*.color14: nord7
|
||||
,*.color15: nord6
|
||||
,*.color0: nord1
|
||||
,*.color1: nord11
|
||||
,*.color2: nord14
|
||||
,*.color3: nord13
|
||||
,*.color4: nord9
|
||||
,*.color5: nord15
|
||||
,*.color6: nord8
|
||||
,*.color7: nord5
|
||||
,*.color8: nord3
|
||||
,*.color9: nord11
|
||||
,*.color10: nord14
|
||||
,*.color11: nord13
|
||||
,*.color12: nord9
|
||||
,*.color13: nord15
|
||||
,*.color14: nord7
|
||||
,*.color15: nord6
|
||||
#+END_SRC
|
||||
|
||||
** Text and source code editing
|
||||
@ -389,10 +389,10 @@ You can find my tmux configuration in [[file:tmux.org][tmux.org]]. It depends on
|
||||
:END:
|
||||
This file gets inserted automatically at the end of my emails.
|
||||
#+BEGIN_SRC text
|
||||
Lucien “Phundrak” Cartier-Tilet
|
||||
https://phundrak.com (Français)
|
||||
https://phundrak.com/en (English)
|
||||
Sent from GNU/Emacs
|
||||
Lucien “Phundrak” Cartier-Tilet
|
||||
https://phundrak.com (Français)
|
||||
https://phundrak.com/en (English)
|
||||
Sent from GNU/Emacs
|
||||
#+END_SRC
|
||||
|
||||
*** Global gitignore
|
||||
@ -405,14 +405,14 @@ 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 don’t want nano’s backup
|
||||
files.
|
||||
#+BEGIN_SRC text
|
||||
~*
|
||||
~*
|
||||
#+END_SRC
|
||||
|
||||
And object files and output binaries generated by =gcc= and the likes aren’t
|
||||
welcome either.
|
||||
#+BEGIN_SRC text
|
||||
,*.out
|
||||
,*.o
|
||||
,*.out
|
||||
,*.o
|
||||
#+END_SRC
|
||||
|
||||
*** Paru
|
||||
@ -428,19 +428,19 @@ is running, but if it ever happens it will be already concerning enough they
|
||||
managed to. I also make use of [[file:bin.org::#Emacs-stuff-Dired-2eeca9da][my custom script dired]] so I can use Emacs’ Dired
|
||||
as the file manager for ~paru~.
|
||||
#+BEGIN_SRC conf :tangle ~/.config/paru/paru.conf
|
||||
[options]
|
||||
BottomUp
|
||||
Devel
|
||||
DevelSuffixes = -git -cvs -svn -bzr -darcs -always
|
||||
NewsOnUpgrade
|
||||
PgpFetch
|
||||
Provides
|
||||
RemoveMake
|
||||
SudoLoop
|
||||
UpgradeMenu
|
||||
[options]
|
||||
BottomUp
|
||||
Devel
|
||||
DevelSuffixes = -git -cvs -svn -bzr -darcs -always
|
||||
NewsOnUpgrade
|
||||
PgpFetch
|
||||
Provides
|
||||
RemoveMake
|
||||
SudoLoop
|
||||
UpgradeMenu
|
||||
|
||||
[bin]
|
||||
FileManager = dired
|
||||
[bin]
|
||||
FileManager = dired
|
||||
#+END_SRC
|
||||
|
||||
* Installation
|
||||
|
@ -26,9 +26,9 @@ The ~print_info~ function is the function called by Neofetch in order to print
|
||||
the system information it could fetch. In this function, we’ll choose what to
|
||||
display, and how. This function looks like this:
|
||||
#+BEGIN_SRC sh :tangle no
|
||||
print_info() {
|
||||
print_info() {
|
||||
# Print information here…
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
Generally, what we will display will be shown through the ~info~ function,
|
||||
@ -58,7 +58,7 @@ interesting information; ~info "Memory" memory~ will look like
|
||||
|
||||
#+NAME: info-elements-gen
|
||||
#+BEGIN_SRC emacs-lisp :var table=info-elements-table :cache yes
|
||||
(mapconcat (lambda (x)
|
||||
(mapconcat (lambda (x)
|
||||
(let ((prefix (car x))
|
||||
(information (cadr x)))
|
||||
(format "info %s%s"
|
||||
@ -90,9 +90,9 @@ info "Memory" memory
|
||||
|
||||
Hence, the function looks like so:
|
||||
#+BEGIN_SRC sh
|
||||
print_info() {
|
||||
print_info() {
|
||||
<<info-elements-gen()>>
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
Each of these modules can be tuned with the variables presented below.
|
||||
@ -130,7 +130,7 @@ This variable can shorten the output of the ~distro~ function.
|
||||
- on :: ~Arch Linux~
|
||||
- off :: ~Arch~
|
||||
#+begin_src sh
|
||||
distro_shorthand="off"
|
||||
distro_shorthand="off"
|
||||
#+end_src
|
||||
|
||||
It is possible to display when the distro has been installed on the computer.
|
||||
@ -164,7 +164,7 @@ terminal emulator I use.
|
||||
- ~viu~
|
||||
- flag :: ~--backend~
|
||||
#+BEGIN_SRC sh
|
||||
image_backend="kitty"
|
||||
image_backend="kitty"
|
||||
#+END_SRC
|
||||
|
||||
Now, since I indicated I wanted an image engine, I’ll indicate neofetch which
|
||||
@ -182,7 +182,7 @@ image mode, your wallpaper will be used.
|
||||
- ~command output (neofetch --ascii "$(fortune | cowsay -W 30)")~
|
||||
- Flag :: ~--source~
|
||||
#+BEGIN_SRC sh
|
||||
image_source="$HOME/org/config/img/leon.png"
|
||||
image_source="$HOME/org/config/img/leon.png"
|
||||
#+END_SRC
|
||||
|
||||
The default image size will probably not be correct since it is half the
|
||||
@ -195,7 +195,7 @@ terminal width and I have an ultrawide monitor, so I’ll need to set it manuall
|
||||
- ~none~
|
||||
- Flag :: ~--image-size~ or ~--size~
|
||||
#+BEGIN_SRC sh
|
||||
image_size="224px"
|
||||
image_size="224px"
|
||||
#+END_SRC
|
||||
|
||||
**** Kernel
|
||||
@ -213,7 +213,7 @@ The variable below can shorten the output ofh the ~kernel~ function.
|
||||
- on :: ~4.8.9-1-ARCH~
|
||||
- off :: ~Linux 4.8.9-1-ARCH~
|
||||
#+begin_src sh
|
||||
kernel_shorthand="off"
|
||||
kernel_shorthand="off"
|
||||
#+end_src
|
||||
|
||||
**** OS Architecture
|
||||
@ -230,7 +230,7 @@ This variable can show or hide the OS architecture in the ~distro~ output.
|
||||
- on :: ~Arch Linux x86_64~
|
||||
- off :: ~Arch Linux~
|
||||
#+begin_src sh
|
||||
os_arch="off"
|
||||
os_arch="off"
|
||||
#+end_src
|
||||
|
||||
**** Packages
|
||||
@ -246,7 +246,7 @@ It is possible to show or hide Package Manager names.
|
||||
- tiny :: ~'908 (pacman, flatpak, snap)'~
|
||||
- off :: ~'908'~
|
||||
#+BEGIN_SRC sh
|
||||
package_managers="on"
|
||||
package_managers="on"
|
||||
#+END_SRC
|
||||
|
||||
**** Shell
|
||||
@ -284,7 +284,7 @@ This allows to show the shell’s version in the output of ~shell~.
|
||||
- on :: ~bash 4.4.5~
|
||||
- off :: ~bash~
|
||||
#+begin_src sh
|
||||
shell_version="off"
|
||||
shell_version="off"
|
||||
#+end_src
|
||||
|
||||
*** Uptime
|
||||
@ -304,7 +304,7 @@ it a bit, while ~tiny~ shortens it greatly.
|
||||
- off :: ~2 days, 10 hours, 3 minutes~
|
||||
- tiny :: ~2d 10h 3m~
|
||||
#+begin_src sh
|
||||
uptime_shorthand="on"
|
||||
uptime_shorthand="on"
|
||||
#+end_src
|
||||
|
||||
*** IP address
|
||||
@ -317,20 +317,20 @@ It is possible to display the machine’s public IP address with the function
|
||||
- Value :: ~"url"~
|
||||
- Flag :: ~--ip_host~
|
||||
#+begin_src sh
|
||||
public_ip_host="http://ident.me"
|
||||
public_ip_host="http://ident.me"
|
||||
#+end_src
|
||||
|
||||
- Default value :: ~""~
|
||||
- Values ::
|
||||
- ~""~
|
||||
- ~""~
|
||||
- Flag :: ~""~
|
||||
- Supports ::
|
||||
- Examples ::
|
||||
- on :: ~~
|
||||
- off :: ~~
|
||||
#+begin_src sh
|
||||
#+end_src
|
||||
# - Default value :: ~""~
|
||||
# - Values ::
|
||||
# - ~""~
|
||||
# - ~""~
|
||||
# - Flag :: ~""~
|
||||
# - Supports ::
|
||||
# - Examples ::
|
||||
# - on :: ~~
|
||||
# - off :: ~~
|
||||
# #+begin_src sh
|
||||
# #+end_src
|
||||
|
||||
*** Theming
|
||||
:PROPERTIES:
|
||||
@ -354,7 +354,7 @@ With this value, it is possible to shorten the output of the computer’s themin
|
||||
- on :: ~Numix, Adwaita~
|
||||
- off :: ~Numix [GTK2], Adwaita [GTK3]~
|
||||
#+begin_src sh
|
||||
gtk_shorthand="on"
|
||||
gtk_shorthand="on"
|
||||
#+end_src
|
||||
|
||||
**** Enable or disable theming display for GTK2
|
||||
@ -372,7 +372,7 @@ this variable.
|
||||
- on :: ~Numix [GTK2], Adwaita [GTK3]~
|
||||
- off :: ~Adwaita [GTK3]~
|
||||
#+begin_src sh
|
||||
gtk2="off"
|
||||
gtk2="off"
|
||||
#+end_src
|
||||
|
||||
**** Enable or disable theming display for GTK3
|
||||
@ -389,7 +389,7 @@ The same variable as above is also available for GTK3.
|
||||
- on :: ~Numix [GTK2], Adwaita [GTK3]~
|
||||
- off :: ~Numix [GTK2]~
|
||||
#+begin_src sh
|
||||
gtk3="off"
|
||||
gtk3="off"
|
||||
#+end_src
|
||||
|
||||
** Hardware
|
||||
@ -415,7 +415,7 @@ With this variables, it is possible to show or hide the brand of a CPU in the
|
||||
- on :: ~Intel i7-6500U~
|
||||
- off :: ~i7-6500U~
|
||||
#+begin_src sh
|
||||
cpu_brand="off"
|
||||
cpu_brand="off"
|
||||
#+end_src
|
||||
|
||||
**** CPU speed
|
||||
@ -432,7 +432,7 @@ With this variable, it is possible to show or hide the speed of the CPU.
|
||||
- on :: ~Intel i7-6500U (4) @ 3.1GHz~
|
||||
- off :: ~Intel i7-6500U (4)~
|
||||
#+begin_src sh
|
||||
cpu_speed="off"
|
||||
cpu_speed="off"
|
||||
#+end_src
|
||||
|
||||
**** CPU speed type
|
||||
@ -451,7 +451,7 @@ a value.
|
||||
- Flag :: ~--speed_type~
|
||||
- Supports :: Linux with ~cpufreq~
|
||||
#+begin_src sh
|
||||
speed_type="bios_limit"
|
||||
speed_type="bios_limit"
|
||||
#+end_src
|
||||
|
||||
**** CPU speed shorthand
|
||||
@ -469,7 +469,7 @@ supported in systems with CPU speed below 1GHz.
|
||||
- on :: ~i7-6500U (4) @ 3.1GHz~
|
||||
- off :: ~i7-6500U (4) @ 3.100GHz~
|
||||
#+begin_src sh
|
||||
speed_shorthand="on"
|
||||
speed_shorthand="on"
|
||||
#+end_src
|
||||
|
||||
**** CPU cores
|
||||
@ -490,7 +490,7 @@ available in the CPU.
|
||||
- physical :: ~Intel i7-6500U (2) @ 3.1GHz~ (All physical cores)
|
||||
- off :: ~Intel i7-6500U @ 3.1GHz~
|
||||
#+begin_src sh
|
||||
cpu_cores="off"
|
||||
cpu_cores="off"
|
||||
#+end_src
|
||||
|
||||
**** CPU temperature
|
||||
@ -513,7 +513,7 @@ only supports newer Intel processors.
|
||||
- F :: ~Intel i7-6500U (4) @ 3.1GHz [82.0°F]~
|
||||
- off :: ~Intel i7-6500U (4) @ 3.1GHz~
|
||||
#+begin_src sh
|
||||
cpu_temp="off"
|
||||
cpu_temp="off"
|
||||
#+end_src
|
||||
|
||||
*** GPU
|
||||
@ -539,7 +539,7 @@ of ~gpu~.
|
||||
- on :: ~AMD HD 7950~
|
||||
- off :: ~HD 7950~
|
||||
#+begin_src sh
|
||||
gpu_brand="off"
|
||||
gpu_brand="off"
|
||||
#+end_src
|
||||
|
||||
**** Which GPU to display
|
||||
@ -557,14 +557,14 @@ This allows the user to choose which GPU appears in the output of the function
|
||||
- Supports :: Linux
|
||||
- Examples ::
|
||||
- all ::
|
||||
#+BEGIN_SRC text
|
||||
GPU1: AMD HD 7950
|
||||
GPU2: Intel Integrated Graphics
|
||||
#+END_SRC
|
||||
#+BEGIN_SRC text
|
||||
GPU1: AMD HD 7950
|
||||
GPU2: Intel Integrated Graphics
|
||||
#+END_SRC
|
||||
- dedicated :: ~GPU1: AMD HD 7950~
|
||||
- integrated :: ~GPU1: Intel Integrated Graphics~
|
||||
#+begin_src sh
|
||||
gpu_type="all"
|
||||
gpu_type="all"
|
||||
#+end_src
|
||||
|
||||
*** Resolution
|
||||
@ -583,5 +583,5 @@ individually. It is possible to display the refresh rate or to hide it.
|
||||
- on :: ~1920x1080 @ 60Hz~
|
||||
- off :: ~1920x1080~
|
||||
#+begin_src sh
|
||||
refresh_rate="off"
|
||||
refresh_rate="off"
|
||||
#+end_src
|
||||
|
@ -22,13 +22,13 @@ 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.
|
||||
#+BEGIN_SRC conf
|
||||
shadow = true;
|
||||
shadow = true;
|
||||
#+END_SRC
|
||||
|
||||
The blur radius radius for shadows is measured in pixels, and it defaults to
|
||||
12px.
|
||||
#+BEGIN_SRC conf
|
||||
shadow-radius = 17;
|
||||
shadow-radius = 17;
|
||||
#+END_SRC
|
||||
|
||||
Picom can also apply some level of opacity on shadows.
|
||||
@ -36,14 +36,14 @@ Picom can also apply some level of opacity on shadows.
|
||||
| Min value | ~0.0~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
shadow-opacity = 0.6
|
||||
shadow-opacity = 0.6
|
||||
#+END_SRC
|
||||
|
||||
The left and top offsets for shadows are expressed in pixels.
|
||||
| Default value | ~-15~ |
|
||||
#+BEGIN_SRC conf
|
||||
shadow-offset-x = -12;
|
||||
shadow-offset-y = -12;
|
||||
shadow-offset-x = -12;
|
||||
shadow-offset-y = -12;
|
||||
#+END_SRC
|
||||
|
||||
It is possible to set the color of the shadow with the string contained in
|
||||
@ -51,39 +51,39 @@ It is possible to set the color of the shadow with the string contained in
|
||||
config, but this value will override any value in ~shadow-red~, ~shadow-green~,
|
||||
or ~shadow-blue~.
|
||||
#+BEGIN_SRC conf
|
||||
shadow-color = "#000000"
|
||||
shadow-color = "#000000"
|
||||
#+END_SRC
|
||||
|
||||
It is possible to specify a list of conditions of windows that should have no
|
||||
shadow.
|
||||
| Default value | ~[]~ |
|
||||
#+BEGIN_SRC conf
|
||||
shadow-exclude = [
|
||||
shadow-exclude = [
|
||||
"name = 'Notification'",
|
||||
"class_g = 'Conky'",
|
||||
"class_g ?= 'Notify-osd'",
|
||||
"class_g = 'Cairo-clock'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
];
|
||||
#+END_SRC
|
||||
|
||||
It is also possible to specify an X geometry that describes the region in which
|
||||
shadows should not be painted in, such as a dock window region. For example,
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
# shadow-exclude-reg = "x10+0+0"
|
||||
# shadow-exclude-reg = "x10+0+0"
|
||||
#+END_SRC
|
||||
would make the 10 pixels at the bottom of the screen not have any shadow painted
|
||||
on.
|
||||
| Default value | ~""~ |
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
shadow-exclude-reg = ""
|
||||
shadow-exclude-reg = ""
|
||||
#+END_SRC
|
||||
|
||||
Finally, it is also possible to crop the shadow of a window fully on a
|
||||
particular Xinerama screen to the screen.
|
||||
- Default value :: ~false~
|
||||
#+BEGIN_SRC conf
|
||||
xinerama-shadow-crop = false
|
||||
xinerama-shadow-crop = false
|
||||
#+END_SRC
|
||||
|
||||
** Deprecated options
|
||||
@ -98,7 +98,7 @@ 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;
|
||||
no-dock-shadow = false;
|
||||
#+END_SRC
|
||||
|
||||
This option allows Picom not to draw on drag-and-drop windows. This option is
|
||||
@ -106,7 +106,7 @@ deprecated, and users should use the ~wintypes~ option in their config file
|
||||
instead.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
no-dnd-shadow = false;
|
||||
no-dnd-shadow = false;
|
||||
#+END_SRC
|
||||
|
||||
~shadow-ignore-shaped~ is also deprecated. It used to indicate Picom not to
|
||||
@ -114,15 +114,15 @@ paint shadows on shaped windows. Note shaped windows here means windows setting
|
||||
their shape through X Shape extension. Those using ARGB background are beyond
|
||||
Picom’s control. Since it is deprecated, you could instead use
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
shadow-exclude = 'bounding_shaped'
|
||||
shadow-exclude = 'bounding_shaped'
|
||||
#+END_SRC
|
||||
or
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
shadow-exclude = 'bounding_shaped && !rounded_corners'
|
||||
shadow-exclude = 'bounding_shaped && !rounded_corners'
|
||||
#+END_SRC
|
||||
| Default value | ~""~ |
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
shadow-ignore-shaped = ""
|
||||
shadow-ignore-shaped = ""
|
||||
#+END_SRC
|
||||
|
||||
* Rounded corners
|
||||
@ -131,15 +131,15 @@ or
|
||||
:END:
|
||||
Here we can see the declaration of the corners’ radius:
|
||||
#+BEGIN_SRC conf
|
||||
corner-radius = 9.0;
|
||||
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.
|
||||
#+BEGIN_SRC conf
|
||||
rounded-corners-exclude = [
|
||||
rounded-corners-exclude = [
|
||||
"_NET_WM_WINDOW_TYPE@[0]:a = '_NET_WM_WINDOW_TYPE_DOCK'"
|
||||
];
|
||||
];
|
||||
#+END_SRC
|
||||
|
||||
* Fading
|
||||
@ -152,7 +152,7 @@ feature on or off. However, its behavior can be changed with
|
||||
~no-fading-openclose~.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
fading = true
|
||||
fading = true
|
||||
#+END_SRC
|
||||
|
||||
These values controls the opacity change between steps while fading in and out.
|
||||
@ -160,35 +160,35 @@ These values controls the opacity change between steps while fading in and out.
|
||||
| Min value | ~0.01~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
fade-in-step = 0.09;
|
||||
fade-out-step = 0.08;
|
||||
fade-in-step = 0.09;
|
||||
fade-out-step = 0.08;
|
||||
#+END_SRC
|
||||
|
||||
This value represents the time between steps in fade steps, in milliseconds.
|
||||
| Default value | ~10~ |
|
||||
| Min value | ~1~ |
|
||||
#+BEGIN_SRC conf
|
||||
fade-delta = 20;
|
||||
fade-delta = 20;
|
||||
#+END_SRC
|
||||
|
||||
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'" ];
|
||||
fade-exclude = [ "class_g = 'mpv'" ];
|
||||
#+END_SRC
|
||||
|
||||
This option allows Picom not to create any fade on windows opening or closing.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
no-fading-openclose = true;
|
||||
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.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
no-fading-destroyed-argb = false
|
||||
no-fading-destroyed-argb = false
|
||||
#+END_SRC
|
||||
|
||||
* Transparency and opacity
|
||||
@ -202,7 +202,7 @@ describes the opacity of inactive windows.
|
||||
| Min value | ~0.1~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
inactive-opacity = 0.6;
|
||||
inactive-opacity = 0.6;
|
||||
#+END_SRC
|
||||
|
||||
On the other hand, it is possible to declare a default opacity for active
|
||||
@ -211,7 +211,7 @@ windows.
|
||||
| Min value | ~0.1~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
active-opacity = 1;
|
||||
active-opacity = 1;
|
||||
#+END_SRC
|
||||
|
||||
This however describes the opacity of window titlebars and borders.
|
||||
@ -219,7 +219,7 @@ This however describes the opacity of window titlebars and borders.
|
||||
| Min value | ~0.1~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
frame-opacity = 1.0;
|
||||
frame-opacity = 1.0;
|
||||
#+END_SRC
|
||||
|
||||
~menu-opacity~ describes the opacity for dropdown menus and popup menus.
|
||||
@ -227,14 +227,14 @@ This however describes the opacity of window titlebars and borders.
|
||||
| Min value | ~0.1~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
# menu-opacity = 0.9;
|
||||
# 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.
|
||||
| Default value | ~true~ |
|
||||
#+BEGIN_SRC conf
|
||||
inactive-opacity-override = true;
|
||||
inactive-opacity-override = true;
|
||||
#+END_SRC
|
||||
|
||||
While it is possible to alter opacity on inactive windows, it is also possible
|
||||
@ -243,7 +243,7 @@ to dim them.
|
||||
| Min value | ~0.1~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
# inactive-dim = 1.0
|
||||
# inactive-dim = 1.0
|
||||
#+END_SRC
|
||||
|
||||
It is also possible to use a fixed inactive dim value, instead of adjusting
|
||||
@ -252,18 +252,18 @@ according to window opacity.
|
||||
| Min value | ~0.1~ |
|
||||
| Max value | ~1.0~ |
|
||||
#+BEGIN_SRC conf
|
||||
# inactive-dim-fixed = 1.0
|
||||
# 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.
|
||||
| Default value | ~[]~ |
|
||||
#+BEGIN_SRC conf
|
||||
focus-exclude = [
|
||||
focus-exclude = [
|
||||
"class_g = 'mpv'",
|
||||
"class_g = 'qemu'",
|
||||
"class_g = 'Qemu-system-x86_64'"
|
||||
];
|
||||
];
|
||||
#+END_SRC
|
||||
|
||||
The user can also specify a list of opacity rules, in the format
|
||||
@ -272,7 +272,7 @@ 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 = [];
|
||||
opacity-rule = [];
|
||||
#+END_SRC
|
||||
|
||||
* Background blurring
|
||||
@ -282,13 +282,13 @@ programs that set ~_NET_WM_WINDOW_OPACITY~ on frame or client windows.
|
||||
The following are the parameters for background blurring, see the \*BLUR\*
|
||||
section for more information.
|
||||
#+BEGIN_SRC conf
|
||||
blur: {
|
||||
blur: {
|
||||
method = "dual_kawase";
|
||||
strength = 7;
|
||||
background = false;
|
||||
background-frame = false;
|
||||
background-fixed = true;
|
||||
}
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
This value enables or disables the blur for the background of semi-transparent
|
||||
@ -296,39 +296,39 @@ 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;
|
||||
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~.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
blur-background-frame = true;
|
||||
blur-background-frame = true;
|
||||
#+END_SRC
|
||||
|
||||
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;
|
||||
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"~.
|
||||
| Default value | ~""~ |
|
||||
#+BEGIN_SRC conf
|
||||
# blur-kern = "3x3box";
|
||||
# blur-kern = "3x3box";
|
||||
#+END_SRC
|
||||
|
||||
It is possible to write exclude conditions for background blur.
|
||||
| Default value | ~[]~ |
|
||||
#+BEGIN_SRC conf
|
||||
blur-background-exclude = [
|
||||
blur-background-exclude = [
|
||||
"window_type = 'desktop'",
|
||||
"class_g = 'Polybar'",
|
||||
"class_g = 'discord-overlay'",
|
||||
"_GTK_FRAME_EXTENTS@:c"
|
||||
];
|
||||
];
|
||||
#+END_SRC
|
||||
|
||||
* General settings
|
||||
@ -339,74 +339,74 @@ Daemonize process. Fork to background after initialization. Causes issues with
|
||||
certain (badly-written) drivers.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
daemon = true;
|
||||
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.
|
||||
| Default value | ~xrender~ |
|
||||
#+BEGIN_SRC conf
|
||||
backend = "glx";
|
||||
backend = "glx";
|
||||
#+END_SRC
|
||||
|
||||
This enables or disables VSync.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
vsync = true;
|
||||
vsync = true;
|
||||
#+END_SRC
|
||||
|
||||
Enable remote control via D-Bus. See the *D-BUS API* section below for more
|
||||
details.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
dbus = false;
|
||||
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.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
mark-wmwin-focused = true;
|
||||
mark-wmwin-focused = true;
|
||||
#+END_SRC
|
||||
|
||||
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;
|
||||
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.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
detect-rounded-corners = true;
|
||||
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.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
detect-client-opacity = true;
|
||||
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.
|
||||
| Default value | ~60~ |
|
||||
#+BEGIN_SRC conf
|
||||
refresh-rate = 120;
|
||||
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
|
||||
#+BEGIN_SRC text :tangle no
|
||||
vsync drm/opengl/opengl-oml
|
||||
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.
|
||||
| Default value | ~""~ |
|
||||
#+BEGIN_SRC conf
|
||||
# sw-opti =;
|
||||
# sw-opti =;
|
||||
#+END_SRC
|
||||
|
||||
Use EWMH ~_NET_ACTIVE_WINDOW~ to determine currently focused window, rather than
|
||||
@ -414,7 +414,7 @@ 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;
|
||||
# use-ewmh-active-win = false;
|
||||
#+END_SRC
|
||||
|
||||
Unredirect all windows if a full-screen opaque window is detected, to maximize
|
||||
@ -423,27 +423,27 @@ redirecting/unredirecting windows. paint-on-overlay may make the flickering less
|
||||
obvious.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
unredir-if-possible = false;
|
||||
unredir-if-possible = false;
|
||||
#+END_SRC
|
||||
|
||||
Delay before unredirecting the window, in milliseconds.
|
||||
| Default value | ~0~ |
|
||||
#+BEGIN_SRC conf
|
||||
unredir-if-possible-delay = 0;
|
||||
unredir-if-possible-delay = 0;
|
||||
#+END_SRC
|
||||
|
||||
Conditions of windows that shouldn't be considered full-screen for unredirecting
|
||||
screen.
|
||||
| Default value | ~[]~ |
|
||||
#+BEGIN_SRC conf
|
||||
unredir-if-possible-exclude = [];
|
||||
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.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
detect-transient = true;
|
||||
detect-transient = true;
|
||||
#+END_SRC
|
||||
|
||||
Use ~WM_CLIENT_LEADER~ to group windows, and consider windows in the same group
|
||||
@ -451,7 +451,7 @@ 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;
|
||||
detect-client-leader = true;
|
||||
#+END_SRC
|
||||
|
||||
Resize damaged region by a specific number of pixels. A positive value enlarges
|
||||
@ -465,14 +465,14 @@ 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;
|
||||
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.
|
||||
| Default value | ~[]~ |
|
||||
#+BEGIN_SRC conf
|
||||
invert-color-include = [];
|
||||
invert-color-include = [];
|
||||
#+END_SRC
|
||||
|
||||
Disable the use of damage information. This cause the whole screen to be redrawn
|
||||
@ -481,7 +481,7 @@ degrades the performance, but might fix some artifacts. The opposing option is
|
||||
use-damage
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
use-damage = false;
|
||||
use-damage = false;
|
||||
#+END_SRC
|
||||
|
||||
Use X Sync fence to sync clients' draw calls, to make sure all draw calls are
|
||||
@ -489,21 +489,21 @@ 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;
|
||||
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.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
force-win-blend = false;
|
||||
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.
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
no-ewmh-fullscreen = false;
|
||||
no-ewmh-fullscreen = false;
|
||||
#+END_SRC
|
||||
|
||||
Dimming bright windows so their brightness doesn't exceed this set value.
|
||||
@ -512,14 +512,14 @@ 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;
|
||||
max-brightness = 1.0;
|
||||
#+END_SRC
|
||||
|
||||
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;
|
||||
transparent-clipping = false;
|
||||
#+END_SRC
|
||||
|
||||
Set the log level. Possible values are:
|
||||
@ -533,7 +533,7 @@ 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";
|
||||
log-level = "warn";
|
||||
#+END_SRC
|
||||
|
||||
Set the log file. If ~--log-file~ is never specified, logs will be written to
|
||||
@ -542,19 +542,19 @@ 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';
|
||||
# log-file = '/path/to/your/log/file';
|
||||
#+END_SRC
|
||||
|
||||
Show all X errors (for debugging)
|
||||
| Default value | ~false~ |
|
||||
#+BEGIN_SRC conf
|
||||
# show-all-xerrors = false;
|
||||
# show-all-xerrors = false;
|
||||
#+END_SRC
|
||||
|
||||
Write process ID to a file.
|
||||
| Default value | ~''~ |
|
||||
#+BEGIN_SRC conf
|
||||
# write-pid-path = '/path/to/your/log/file';
|
||||
# write-pid-path = '/path/to/your/log/file';
|
||||
#+END_SRC
|
||||
|
||||
Window type settings. ~WINDOW_TYPE~ is one of the 15 window types defined in
|
||||
@ -588,14 +588,14 @@ Following per window-type options are available:
|
||||
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:
|
||||
{
|
||||
wintypes:
|
||||
{
|
||||
tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
|
||||
dock = { shadow = false; }
|
||||
dnd = { shadow = false; }
|
||||
popup_menu = { opacity = 0.8; }
|
||||
dropdown_menu = { opacity = 0.8; }
|
||||
};
|
||||
};
|
||||
#+END_SRC
|
||||
|
||||
** GLX backend-specific options
|
||||
@ -608,7 +608,7 @@ 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;
|
||||
glx-no-stencil = true;
|
||||
#+END_SRC
|
||||
|
||||
Avoid rebinding pixmap on window damage. Probably could improve performance on
|
||||
@ -616,7 +616,7 @@ 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;
|
||||
glx-no-rebind-pixmap = false;
|
||||
#+END_SRC
|
||||
|
||||
Use specified GLSL fragment shader for rendering window contents. See
|
||||
@ -624,5 +624,5 @@ Use specified GLSL fragment shader for rendering window contents. See
|
||||
~compton-fake-transparency-fshader-win.glsl~ in the source tree for examples.
|
||||
| Default value | ~''~ |
|
||||
#+BEGIN_SRC conf :tangle no
|
||||
glx-fshader-win = '';
|
||||
glx-fshader-win = '';
|
||||
#+END_SRC
|
||||
|
@ -20,23 +20,23 @@ you can find how my Rust code is always formatted.
|
||||
:END:
|
||||
First, we are using the 2018 edition of Rust.
|
||||
#+BEGIN_SRC toml
|
||||
edition = "2018"
|
||||
edition = "2018"
|
||||
#+END_SRC
|
||||
Put single-expression functions on a single line.
|
||||
#+BEGIN_SRC toml
|
||||
fn_single_line = true
|
||||
fn_single_line = true
|
||||
#+END_SRC
|
||||
Format string literals where necessary.
|
||||
#+BEGIN_SRC toml
|
||||
format_strings = true
|
||||
format_strings = true
|
||||
#+END_SRC
|
||||
Maximum width of each line
|
||||
#+BEGIN_SRC toml
|
||||
max_width = 80
|
||||
max_width = 80
|
||||
#+END_SRC
|
||||
Merge multiple imports into a single nested import.
|
||||
#+BEGIN_SRC toml
|
||||
merge_imports = true
|
||||
merge_imports = true
|
||||
#+END_SRC
|
||||
|
||||
* Structs and Enums
|
||||
@ -50,15 +50,15 @@ 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.
|
||||
#+BEGIN_SRC toml
|
||||
enum_discrim_align_threshold = 20
|
||||
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
|
||||
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
|
||||
reorder_impl_items = true
|
||||
#+END_SRC
|
||||
|
||||
* Comments
|
||||
@ -67,19 +67,19 @@ Reorder impl items. ~type~ and ~const~ are put first, then macros and methods.
|
||||
:END:
|
||||
Convert ~/* */~ comments to ~//~ comments where possible.
|
||||
#+BEGIN_SRC toml
|
||||
normalize_comments = true
|
||||
normalize_comments = true
|
||||
#+END_SRC
|
||||
Break comments to fit on the line.
|
||||
#+BEGIN_SRC toml
|
||||
wrap_comments = true
|
||||
wrap_comments = true
|
||||
#+END_SRC
|
||||
Report ~FIXME~ items in comments.
|
||||
#+BEGIN_SRC toml
|
||||
report_fixme = "Always"
|
||||
report_fixme = "Always"
|
||||
#+END_SRC
|
||||
Report ~TODO~ items in comments.
|
||||
#+BEGIN_SRC toml
|
||||
todo = "Always"
|
||||
todo = "Always"
|
||||
#+END_SRC
|
||||
|
||||
* Documentation
|
||||
@ -88,11 +88,11 @@ Report ~TODO~ items in comments.
|
||||
:END:
|
||||
Format code snippet included in doc comments.
|
||||
#+BEGIN_SRC toml
|
||||
format_code_in_doc_comments = true
|
||||
format_code_in_doc_comments = true
|
||||
#+END_SRC
|
||||
Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
|
||||
#+BEGIN_SRC toml
|
||||
normalize_doc_attributes = true
|
||||
normalize_doc_attributes = true
|
||||
#+END_SRC
|
||||
|
||||
* Whitespace
|
||||
@ -101,13 +101,13 @@ Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
|
||||
:END:
|
||||
Use tab characters for indentation, spaces for alignment.
|
||||
#+BEGIN_SRC toml
|
||||
hard_tabs = false
|
||||
hard_tabs = false
|
||||
#+END_SRC
|
||||
Number of spaces per tab.
|
||||
#+BEGIN_SRC toml
|
||||
tab_spaces = 4
|
||||
tab_spaces = 4
|
||||
#+END_SRC
|
||||
I want newlines to always be Unix style.
|
||||
#+BEGIN_SRC toml
|
||||
newline_style = "Unix"
|
||||
newline_style = "Unix"
|
||||
#+END_SRC
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -92,8 +92,8 @@ different locations, but I chose an Emacs-like configuration: put
|
||||
everything in ~~/.stumpwm.d/~. We begin by indicating quicklisp how to
|
||||
properly initialize:
|
||||
#+begin_src lisp
|
||||
#-quicklisp
|
||||
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
|
||||
#-quicklisp
|
||||
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
|
||||
(user-homedir-pathname))))
|
||||
(when (probe-file quicklisp-init)
|
||||
(load quicklisp-init)))
|
||||
@ -104,15 +104,15 @@ Then, our first StumpWM-related code is declaring we are using the
|
||||
us to avoid using the prefix ~stumpwm:~ each time we are using a
|
||||
function or a variable from this package.
|
||||
#+begin_src lisp
|
||||
(in-package :stumpwm)
|
||||
(setf *default-package* :stumpwm)
|
||||
(in-package :stumpwm)
|
||||
(setf *default-package* :stumpwm)
|
||||
#+end_src
|
||||
|
||||
Since I install StumpWM with my package manager (I use the AUR’s
|
||||
~stumpwm-git~ package), StumpWM’s modules are installed to
|
||||
~/usr/share/stupmwm/contrib/utils/~, let’s indicate that to StumpWM.
|
||||
#+begin_src lisp
|
||||
(set-module-dir "/usr/share/stupmwm/contrib/")
|
||||
(set-module-dir "/usr/share/stupmwm/contrib/")
|
||||
#+end_src
|
||||
|
||||
A startup message can be used when initializing StumpWM. For now,
|
||||
@ -125,8 +125,8 @@ The first thing I want to do after that is to set some decent cursor
|
||||
pointer as well as get a bunch of stuff started. To see what’s in the
|
||||
~autostart~ script, [[file:bin.org::#Autostart-a99e99e7][see here]].
|
||||
#+begin_src lisp
|
||||
(run-shell-command "xsetroot -cursor_name left_ptr")
|
||||
(run-shell-command "autostart")
|
||||
(run-shell-command "xsetroot -cursor_name left_ptr")
|
||||
(run-shell-command "autostart")
|
||||
#+end_src
|
||||
|
||||
Now, we’ll load a couple of my custom files that will be described below:
|
||||
@ -142,7 +142,7 @@ Now, we’ll load a couple of my custom files that will be described below:
|
||||
#+name: gen-load-files
|
||||
#+headers: :wrap src lisp
|
||||
#+begin_src emacs-lisp :var files=first-loaded-files
|
||||
(mapconcat (lambda (file)
|
||||
(mapconcat (lambda (file)
|
||||
(format "(load \"~/.stumpwm.d/%s\")" (car file)))
|
||||
files
|
||||
"\n")
|
||||
@ -161,7 +161,7 @@ This is equivalent to the Common Lisp code:
|
||||
Once the modeline file is loaded, let’s indicate StumpWM to activate
|
||||
it:
|
||||
#+begin_src lisp
|
||||
(when *initializing*
|
||||
(when *initializing*
|
||||
(mode-line))
|
||||
#+end_src
|
||||
|
||||
@ -170,7 +170,7 @@ on click. I /HATE/ it when focus follows my mouse like some damn dog
|
||||
after its ball. Also, the meta key will be used to move floating
|
||||
windows.
|
||||
#+begin_src lisp
|
||||
(setf *mouse-focus-policy* :click
|
||||
(setf *mouse-focus-policy* :click
|
||||
,*float-window-modifier* :META)
|
||||
#+end_src
|
||||
|
||||
@ -190,7 +190,7 @@ including a short description of what they are for:
|
||||
#+name: gen-load-modules
|
||||
#+headers: :wrap src lisp
|
||||
#+begin_src emacs-lisp :var modules=loaded-modules
|
||||
(mapconcat (lambda (module)
|
||||
(mapconcat (lambda (module)
|
||||
(format "(load-module \"%s\")" (car module)))
|
||||
modules
|
||||
"\n")
|
||||
@ -208,7 +208,7 @@ including a short description of what they are for:
|
||||
|
||||
Finally, we can notify the user everything is ready.
|
||||
#+begin_src lisp
|
||||
(setf *startup-message* "StumpWM is ready!")
|
||||
(setf *startup-message* "StumpWM is ready!")
|
||||
#+end_src
|
||||
|
||||
And it’s done! We can now move on to the creation of the other CLisp files.
|
||||
@ -223,7 +223,7 @@ me invoking too many Firefox instances. Either Firefox is not already
|
||||
running and an instance is launched, or one already is and we are
|
||||
brought to it. This is done like so:
|
||||
#+begin_src lisp
|
||||
(defcommand firefox () ()
|
||||
(defcommand firefox () ()
|
||||
"Run or raise Firefox."
|
||||
(run-or-raise "firefox" '(:class "Firefox") t nil))
|
||||
#+end_src
|
||||
@ -231,7 +231,7 @@ brought to it. This is done like so:
|
||||
Next, this command will not only close the current window, but it will
|
||||
also close the current frame.
|
||||
#+begin_src lisp
|
||||
(defcommand delete-window-and-frame () ()
|
||||
(defcommand delete-window-and-frame () ()
|
||||
"Delete the current frame with its window."
|
||||
(delete-window)
|
||||
(remove-split))
|
||||
@ -240,12 +240,12 @@ also close the current frame.
|
||||
The two following commands will create a new frame to the right and
|
||||
below the current frame respectively, then focus it.
|
||||
#+begin_src lisp
|
||||
(defcommand hsplit-and-focus () ()
|
||||
(defcommand hsplit-and-focus () ()
|
||||
"Create a new frame on the right and focus it."
|
||||
(hsplit)
|
||||
(move-focus :right))
|
||||
|
||||
(defcommand vsplit-and-focus () ()
|
||||
(defcommand vsplit-and-focus () ()
|
||||
"Create a new frame below and move focus to it."
|
||||
(vsplit)
|
||||
(move-focus :down))
|
||||
@ -254,7 +254,7 @@ below the current frame respectively, then focus it.
|
||||
Now, let’s create a command for invoking the terminal, optionally with
|
||||
a program.
|
||||
#+begin_src lisp
|
||||
(defcommand term (&optional program) ()
|
||||
(defcommand term (&optional program) ()
|
||||
"Invoke a terminal, possibly with a @arg{program}."
|
||||
(run-shell-command (if program
|
||||
(format nil "kitty ~A" program)
|
||||
@ -297,7 +297,7 @@ code looks like so:
|
||||
#+name: gen-colors
|
||||
#+headers: :wrap src lisp
|
||||
#+begin_src emacs-lisp :var colors=nord-colors
|
||||
(mapconcat (lambda (color)
|
||||
(mapconcat (lambda (color)
|
||||
(format "(defvar phundrak-%s \"%s\")" (car color) (cadr color)))
|
||||
colors
|
||||
"\n")
|
||||
@ -332,45 +332,45 @@ And with that we’re done!
|
||||
:END:
|
||||
The modeline is pretty easy. First, let’s load the ~colors.lisp~ file we just created:
|
||||
#+begin_src lisp
|
||||
(load "~/.stumpwm.d/colors.lisp")
|
||||
(load "~/.stumpwm.d/colors.lisp")
|
||||
#+end_src
|
||||
|
||||
Next, we can set some colors for the modeline. Let’s set the
|
||||
background of the modeline to Nord1 and the foreground to Nord5, I
|
||||
think this is a pretty good combination.
|
||||
#+begin_src lisp
|
||||
(setf *mode-line-background-color* phundrak-nord1
|
||||
(setf *mode-line-background-color* phundrak-nord1
|
||||
,*mode-line-foreground-color* phundrak-nord5)
|
||||
#+end_src
|
||||
|
||||
We /could/ also use some borders in the modeline. But we won’t. Let’s
|
||||
still set its color to Nord1, just in case.
|
||||
#+begin_src lisp
|
||||
(setf *mode-line-border-color* phundrak-nord1
|
||||
(setf *mode-line-border-color* phundrak-nord1
|
||||
,*mode-line-border-width* 0)
|
||||
#+end_src
|
||||
|
||||
The timeout of the modeline indicates how often it refreshes in
|
||||
seconds. I think one second is good.
|
||||
#+begin_src lisp
|
||||
(setf *mode-line-timeout* 1)
|
||||
(setf *mode-line-timeout* 1)
|
||||
#+end_src
|
||||
|
||||
Next we get to the content of the modeline. This format follows the
|
||||
format indicated in the manpage of ~date~.
|
||||
#+begin_src lisp
|
||||
(setf *time-modeline-string* "%F %H:%M")
|
||||
(setf *time-modeline-string* "%F %H:%M")
|
||||
#+end_src
|
||||
|
||||
Let’s also indicate how the groupname is displayed.
|
||||
#+begin_src lisp
|
||||
(setf *group-format* "%t")
|
||||
(setf *group-format* "%t")
|
||||
#+end_src
|
||||
|
||||
The window format should display first its window number, then its
|
||||
titled, limited to 30 characters.
|
||||
#+begin_src lisp
|
||||
(setf *window-format* "%n: %30t")
|
||||
(setf *window-format* "%n: %30t")
|
||||
#+end_src
|
||||
|
||||
Here are some modules that we will load for the modeline:
|
||||
@ -384,7 +384,7 @@ Here are some modules that we will load for the modeline:
|
||||
#+name: gen-load-modeline-modules
|
||||
#+headers: :wrap src lisp
|
||||
#+begin_src emacs-lisp :var modules=modeline-modules
|
||||
(mapconcat (lambda (module)
|
||||
(mapconcat (lambda (module)
|
||||
(format "(load-module \"%s\")" (car module)))
|
||||
modules
|
||||
"\n")
|
||||
@ -405,7 +405,7 @@ highlighted, and ~%u~ will display urgent windows if there are any. ~%d~
|
||||
on the other hand will display the date in the format set above, while
|
||||
~%B~ will display the battery level of the laptop.
|
||||
#+begin_src lisp
|
||||
(setf *screen-mode-line-format* (list "%g %v %u ^> %C | %M | %B | %d"))
|
||||
(setf *screen-mode-line-format* (list "%g %v %u ^> %C | %M | %B | %d"))
|
||||
#+end_src
|
||||
|
||||
This variable as you can see is a list of elements, although here I am
|
||||
@ -455,7 +455,7 @@ is the list of groups I will be using:
|
||||
#+name: gen-groups
|
||||
#+headers: :exports none
|
||||
#+begin_src emacs-lisp :var groups=list-groups
|
||||
(let ((make-group (lambda (group &optional first-p)
|
||||
(let ((make-group (lambda (group &optional first-p)
|
||||
(let ((group-name (car group))
|
||||
(group-type (nth 3 group)))
|
||||
(format "(%s \"%s\")"
|
||||
@ -485,7 +485,7 @@ is the list of groups I will be using:
|
||||
|
||||
Groups are specified this way:
|
||||
#+begin_src lisp
|
||||
(when *initializing*
|
||||
(when *initializing*
|
||||
<<gen-groups()>>)
|
||||
#+end_src
|
||||
|
||||
@ -496,7 +496,7 @@ also be dynamic tiling groups or floating groups.
|
||||
Next, let’s make sure no previous window placement rule is in place,
|
||||
this will avoid unexpected and hard-to-debug behavior.
|
||||
#+begin_src lisp
|
||||
(clear-window-placement-rules)
|
||||
(clear-window-placement-rules)
|
||||
#+end_src
|
||||
|
||||
As you can see in the table [[list-groups]] above, I also indicated my
|
||||
@ -505,8 +505,8 @@ class, so it will be pretty straightforward to the corresponding code.
|
||||
#+name: gen-rules
|
||||
#+headers: :wrap src lisp
|
||||
#+begin_src emacs-lisp :var rules=list-groups
|
||||
(require 'seq)
|
||||
(let ((output "")
|
||||
(require 'seq)
|
||||
(let ((output "")
|
||||
(rules (seq-filter (lambda (rule) rule)
|
||||
(mapcar (lambda (line)
|
||||
(let ((classes (caddr line)))
|
||||
@ -550,7 +550,7 @@ three terminal windows to open by default:
|
||||
- and two terminals
|
||||
This can be done like so:
|
||||
#+begin_src lisp
|
||||
(defun my-term-init (current-group _last-group)
|
||||
(defun my-term-init (current-group _last-group)
|
||||
"Create terminals in the first group when none are already there."
|
||||
(let ((term-group (select-group (current-screen) "2"))
|
||||
(windows (group-windows current-group)))
|
||||
@ -565,13 +565,13 @@ This can be done like so:
|
||||
|
||||
Let’s add a hook for that now:
|
||||
#+begin_src lisp
|
||||
(add-hook *focus-group-hook* 'my-term-init)
|
||||
(add-hook *focus-group-hook* 'my-term-init)
|
||||
#+end_src
|
||||
|
||||
By the way, dynamic groups should have a split ratio of half of the
|
||||
available space.
|
||||
#+begin_src lisp
|
||||
(setf *dynamic-group-master-split-ratio* 1/2)
|
||||
(setf *dynamic-group-master-split-ratio* 1/2)
|
||||
#+end_src
|
||||
|
||||
* Theme
|
||||
@ -581,7 +581,7 @@ available space.
|
||||
:END:
|
||||
As in the modeline file, the first thing we’ll do is to load our colors.
|
||||
#+begin_src lisp
|
||||
(load "~/.stumpwm.d/colors.lisp")
|
||||
(load "~/.stumpwm.d/colors.lisp")
|
||||
#+end_src
|
||||
|
||||
We can now go onto more serious business.
|
||||
@ -599,9 +599,9 @@ There’s a quickfix available while we wait for ~clx-truetype~ to be once
|
||||
again available: clone it in quicklisp’s local projects. You will
|
||||
obviously need to have quicklisp installed (for that, follow the
|
||||
[[https://www.quicklisp.org/beta/#installation][official instructions]]), then execute the following shell commands:
|
||||
#+begin_src sh
|
||||
cd ~/quicklisp/local-projects/
|
||||
git clone https://github.com/lihebi/clx-truetype.git
|
||||
#+begin_src sh :dir ~/quicklisp/local-projects
|
||||
cd ~/quicklisp/local-projects/
|
||||
git clone https://github.com/lihebi/clx-truetype.git
|
||||
#+end_src
|
||||
|
||||
This will make ~clx-truetype~ available to quicklisp, and you can run
|
||||
@ -611,8 +611,8 @@ issue (running it again is necessary to install its dependencies).
|
||||
Now that this is out of the way, let’s add two lines so we can use TTF
|
||||
fonts:
|
||||
#+begin_src lisp
|
||||
(ql:quickload :clx-truetype)
|
||||
(load-module "ttf-fonts")
|
||||
(ql:quickload :clx-truetype)
|
||||
(load-module "ttf-fonts")
|
||||
#+end_src
|
||||
The documentation says we should be able to also use OTF fonts, but so
|
||||
far I’ve had no luck loading one. Loading more than one font to use
|
||||
@ -636,7 +636,7 @@ work).
|
||||
#+name: gen-fonts
|
||||
#+headers: :wrap src lisp
|
||||
#+begin_src emacs-lisp :var fonts=list-fonts
|
||||
(format "(set-font `(%s))"
|
||||
(format "(set-font `(%s))"
|
||||
(mapconcat (lambda (font)
|
||||
(let ((family (nth 0 font))
|
||||
(subfamily (nth 1 font))
|
||||
@ -671,17 +671,17 @@ We can now set a couple of colors for StumpWM. Not that we will see
|
||||
them often since I don’t like borders on my windows, but in case I
|
||||
want to get them back, they’ll be nice to have.
|
||||
#+begin_src lisp
|
||||
(set-border-color phundrak-nord1)
|
||||
(set-focus-color phundrak-nord1)
|
||||
(set-unfocus-color phundrak-nord3)
|
||||
(set-float-focus-color phundrak-nord1)
|
||||
(set-float-unfocus-color phundrak-nord3)
|
||||
(set-border-color phundrak-nord1)
|
||||
(set-focus-color phundrak-nord1)
|
||||
(set-unfocus-color phundrak-nord3)
|
||||
(set-float-focus-color phundrak-nord1)
|
||||
(set-float-unfocus-color phundrak-nord3)
|
||||
#+end_src
|
||||
|
||||
Let’s also set the colors of the message and input windows:
|
||||
#+begin_src lisp
|
||||
(set-fg-color phundrak-nord4)
|
||||
(set-bg-color phundrak-nord1)
|
||||
(set-fg-color phundrak-nord4)
|
||||
(set-bg-color phundrak-nord1)
|
||||
#+end_src
|
||||
|
||||
As I said, I don’t like borders, so I’ll remove them. I’ll still keep
|
||||
@ -689,7 +689,7 @@ the window’s title bar available when it’s floating, and this is also
|
||||
where I can set the format of its title: its number as well as its
|
||||
name, limited to thirty characters.
|
||||
#+begin_src lisp
|
||||
(setf *normal-border-width* 0
|
||||
(setf *normal-border-width* 0
|
||||
,*float-window-border* 0
|
||||
,*float-window-title-height* 15
|
||||
,*window-border-style* :none
|
||||
@ -704,7 +704,7 @@ The Input windows as well as the message windows should both be at the
|
||||
top of my screen. And I believe a padding of five pixels for the
|
||||
message windows is good.
|
||||
#+begin_src lisp
|
||||
(setf *input-window-gravity* :top
|
||||
(setf *input-window-gravity* :top
|
||||
,*message-window-padding* 10
|
||||
,*message-window-y-padding* 10
|
||||
,*message-window-gravity* :top)
|
||||
@ -719,20 +719,20 @@ plain ~i3~. In Awesome, I still have gaps. And in StumpWM, I shall still
|
||||
use gaps. In order to use them, let’s load a module dedicated to gaps
|
||||
in StumpWM:
|
||||
#+begin_src lisp
|
||||
(load-module "swm-gaps")
|
||||
(load-module "swm-gaps")
|
||||
#+end_src
|
||||
|
||||
Now that this is done, I can now set some variables bound to this
|
||||
package.
|
||||
#+begin_src lisp
|
||||
(setf swm-gaps:*head-gaps-size* 0
|
||||
(setf swm-gaps:*head-gaps-size* 0
|
||||
swm-gaps:*inner-gaps-size* 5
|
||||
swm-gaps:*outer-gaps-size* 15)
|
||||
#+end_src
|
||||
|
||||
Finally, let’s enable our gaps:
|
||||
#+begin_src lisp
|
||||
(when *initializing*
|
||||
(when *initializing*
|
||||
(swm-gaps:toggle-gaps))
|
||||
#+end_src
|
||||
|
||||
@ -745,7 +745,7 @@ Buckle up, this chapter is going to be *long*, because me loves LOTS of keybinds
|
||||
|
||||
First, let’s declare again we are using the default package ~stumpwm~:
|
||||
#+begin_src lisp
|
||||
(in-package :stumpwm)
|
||||
(in-package :stumpwm)
|
||||
#+end_src
|
||||
|
||||
This will avoid us always repeating ~stumpwm:define-key~ or ~stumpwm:kbd~
|
||||
@ -785,12 +785,12 @@ it with ~set-prefix-key~. I personally like to have my space key as a
|
||||
leader key, but in order to not have it conflict with Emacs, I also
|
||||
need to press the super key too.
|
||||
#+begin_src lisp
|
||||
(set-prefix-key (kbd "s-SPC"))
|
||||
(set-prefix-key (kbd "s-SPC"))
|
||||
#+end_src
|
||||
|
||||
Also, let’s enable ~which-key~:
|
||||
#+begin_src lisp
|
||||
(which-key-mode)
|
||||
(which-key-mode)
|
||||
#+end_src
|
||||
|
||||
Lastly, before we get more into details, keep in mind that I use the
|
||||
@ -843,7 +843,7 @@ First, let’s create my ~rofi~ scripts keymap.
|
||||
|
||||
Here’s the equivalent in Common Lisp.
|
||||
#+begin_src lisp
|
||||
(defvar *my-rofi-keymap*
|
||||
(defvar *my-rofi-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=rofi-scripts)>>
|
||||
m))
|
||||
@ -861,7 +861,7 @@ Let’s also create a keymap for screenshots.
|
||||
|
||||
Here’s the equivalent in Common Lisp.
|
||||
#+begin_src lisp
|
||||
(defvar *my-screenshot-keymap*
|
||||
(defvar *my-screenshot-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=screenshot-keymap)>>
|
||||
m))
|
||||
@ -883,7 +883,7 @@ the above keymaps.
|
||||
|
||||
This translates to:
|
||||
#+begin_src lisp
|
||||
(defvar *my-applications-keymap*
|
||||
(defvar *my-applications-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=application-keymap)>>
|
||||
m))
|
||||
@ -891,14 +891,14 @@ This translates to:
|
||||
|
||||
The application keymap can now be bound to the root map like so:
|
||||
#+begin_src lisp
|
||||
(define-key *root-map* (kbd "a") '*my-applications-keymap*)
|
||||
(define-key *root-map* (kbd "a") '*my-applications-keymap*)
|
||||
#+end_src
|
||||
|
||||
I will also bind to the top map ~s-RET~ in order to open a new terminal
|
||||
window. The screenshot keymap is also bound to the ScreenPrint key.
|
||||
#+begin_src lisp
|
||||
(define-key *top-map* (kbd "s-RET") "term")
|
||||
(define-key *top-map* (kbd "Print") '*my-screenshot-keymap*)
|
||||
(define-key *top-map* (kbd "s-RET") "term")
|
||||
(define-key *top-map* (kbd "Print") '*my-screenshot-keymap*)
|
||||
#+end_src
|
||||
|
||||
** End of Session, Powering Off, and the Likes
|
||||
@ -922,7 +922,7 @@ whishes to do.
|
||||
|
||||
This translates to:
|
||||
#+begin_src lisp
|
||||
(defvar *my-end-session-keymap*
|
||||
(defvar *my-end-session-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=end-session-keymap)>>
|
||||
m))
|
||||
@ -930,7 +930,7 @@ This translates to:
|
||||
|
||||
Which is bound in the root map to ~q~:
|
||||
#+begin_src lisp
|
||||
(define-key *root-map* (kbd "q") '*my-end-session-keymap*)
|
||||
(define-key *root-map* (kbd "q") '*my-end-session-keymap*)
|
||||
#+end_src
|
||||
|
||||
** Groups
|
||||
@ -945,13 +945,10 @@ this:
|
||||
#+name: group-keybind-gen
|
||||
#+header: :noweb no :results verbatim :exports none :var convert="no"
|
||||
#+begin_src emacs-lisp :var groups=list-groups mod="s" action="gselect" map="*top-map*" convert="yes"
|
||||
(mapconcat (lambda (group)
|
||||
(mapconcat (lambda (group)
|
||||
(let ((group-nbr (nth 1 group)))
|
||||
(format "%S" `(define-key
|
||||
,(make-symbol map)
|
||||
;; (kbd ,(if (string= convert "yes")
|
||||
;; (format "%s-<<num-to-char(num=%s)>>" mod group-nbr)
|
||||
;; (number-to-string group-nbr)))
|
||||
(kbd ,(format "%s-%s"
|
||||
mod
|
||||
(if (string= "yes" convert)
|
||||
@ -974,7 +971,7 @@ this:
|
||||
|
||||
#+header: :cache yes :noweb yes :wrap src lisp
|
||||
#+begin_src emacs-lisp
|
||||
<<group-keybind-gen(mod="s", action="gselect", convert="yes")>>
|
||||
<<group-keybind-gen(mod="s", action="gselect", convert="yes")>>
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[627ef5c7e456944dd624c322529699e11f2a041b]:
|
||||
@ -995,7 +992,7 @@ of the group/. As mentioned before, due to my keyboard layout Shift +
|
||||
/number/ is actually just /number/ for me (e.g. Shift + ~"~ results in ~1~),
|
||||
so there’s no need to convert the group number to another character.
|
||||
#+begin_src emacs-lisp :wrap src lisp
|
||||
<<group-keybind-gen(mod="s", action="gmove-and-follow", convert="no")>>
|
||||
<<group-keybind-gen(mod="s", action="gmove-and-follow", convert="no")>>
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[6577510905e5cce124ff563a6d68a7f64fc8683c]:
|
||||
@ -1012,7 +1009,7 @@ so there’s no need to convert the group number to another character.
|
||||
If I want to send a window to another group without following it, I’ll
|
||||
use ~s-S-C-<group number>~, which gives us the following:
|
||||
#+begin_src emacs-lisp :wrap src lisp
|
||||
<<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="no")>>
|
||||
<<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="no")>>
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[55852a5a035c23f078ba0a97120151c059fa955f]:
|
||||
@ -1029,7 +1026,7 @@ use ~s-S-C-<group number>~, which gives us the following:
|
||||
And if I want to bring the windows of another group into the current
|
||||
group, I’ll use ~s-C-<group number>~:
|
||||
#+begin_src emacs-lisp :wrap src lisp :exports results
|
||||
<<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="yes")>>
|
||||
<<group-keybind-gen(mod="s-C", action="gmove-and-follow", convert="yes")>>
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[b536bb0359e6e9e10e98635c82bed3d348d75ac5]:
|
||||
@ -1048,19 +1045,19 @@ StumpWM also has already a nice keymap for managing groups called
|
||||
already bound, but since I plan on erasing ~*root-map*~ in the near
|
||||
future before binding stuff to it, I prefer to bind it already)
|
||||
#+begin_src lisp
|
||||
(define-key *root-map* (kbd "g") '*groups-map*)
|
||||
(define-key *root-map* (kbd "g") '*groups-map*)
|
||||
#+end_src
|
||||
|
||||
And a binding to ~vgroups~ is done on ~*groups-map*~ in order to regroup
|
||||
similar keybinds.
|
||||
#+begin_src lisp
|
||||
(define-key *groups-map* (kbd "G") "vgroups")
|
||||
(define-key *groups-map* (kbd "G") "vgroups")
|
||||
#+end_src
|
||||
|
||||
I grew accustomed to ~s-ESC~ bringing me to the previous group when
|
||||
using AwesomeWM, so let’s define that:
|
||||
#+begin_src lisp
|
||||
(define-key *top-map* (kbd "s-ESC") "gother")
|
||||
(define-key *top-map* (kbd "s-ESC") "gother")
|
||||
#+end_src
|
||||
|
||||
** Frames and Windows management
|
||||
@ -1125,12 +1122,12 @@ ourselves in ~*my-frames-management-keymap*~, pressing ~F~ will bring us
|
||||
in ~*my-frames-float-keymap*~.
|
||||
|
||||
#+begin_src lisp
|
||||
(defvar *my-frames-float-keymap*
|
||||
(defvar *my-frames-float-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=frames-float)>>
|
||||
m))
|
||||
|
||||
(defvar *my-frames-management-keymap*
|
||||
(defvar *my-frames-management-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=frames-and-window-management)>>
|
||||
m))
|
||||
@ -1138,7 +1135,7 @@ in ~*my-frames-float-keymap*~.
|
||||
|
||||
Let’s bind ~*my-frames-management-keymap*~ in ~*root-keymap*~:
|
||||
#+begin_src lisp
|
||||
(define-key *root-map* (kbd "w") '*my-frames-management-keymap*)
|
||||
(define-key *root-map* (kbd "w") '*my-frames-management-keymap*)
|
||||
#+end_src
|
||||
|
||||
That way, if we want for instance to split our current frame
|
||||
@ -1163,7 +1160,7 @@ I also bound a couple of these functions to the top keymap for easier access:
|
||||
|
||||
This translates to:
|
||||
#+begin_src lisp
|
||||
<<keybinds-gen(map="*top-map*", keybinds=top-window-map)>>
|
||||
<<keybinds-gen(map="*top-map*", keybinds=top-window-map)>>
|
||||
#+end_src
|
||||
|
||||
Being a [[https://bepo.fr/wiki/Accueil][bépo layout]] user, the ~hjkl~ keys don’t exactly fit me, as you
|
||||
@ -1171,7 +1168,7 @@ might have noticed with my use of ~ctsr~ which is its equivalent. Due to
|
||||
this, the interactive keymap for ~iresize~ is not ideal for me, let me
|
||||
redefine it:
|
||||
#+begin_src lisp
|
||||
(define-interactive-keymap (iresize tile-group) (:on-enter #'setup-iresize
|
||||
(define-interactive-keymap (iresize tile-group) (:on-enter #'setup-iresize
|
||||
:on-exit #'resize-unhide
|
||||
:abort-if #'abort-resize-p)
|
||||
((kbd "c") "resize-direction left")
|
||||
@ -1183,7 +1180,7 @@ redefine it:
|
||||
As with groups management, I grew used to ~s-TAB~ in AwesomeWM bringing
|
||||
me back to the previously focused window.
|
||||
#+begin_src lisp
|
||||
(define-key *top-map* (kbd "s-TAB") "other-window")
|
||||
(define-key *top-map* (kbd "s-TAB") "other-window")
|
||||
#+end_src
|
||||
|
||||
** Windows management
|
||||
@ -1206,12 +1203,12 @@ with Emacs’ buffers.
|
||||
| ~p~ | ~prev~ |
|
||||
|
||||
#+begin_src lisp
|
||||
(defvar *my-buffers-management-keymap*
|
||||
(defvar *my-buffers-management-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=window-management)>>
|
||||
m))
|
||||
|
||||
(define-key *root-map* (kbd "b") '*my-buffers-management-keymap*)
|
||||
(define-key *root-map* (kbd "b") '*my-buffers-management-keymap*)
|
||||
#+end_src
|
||||
|
||||
** Media and Media Control
|
||||
@ -1236,7 +1233,7 @@ of MPD.
|
||||
|
||||
Cela donne le code suivant:
|
||||
#+begin_src lisp
|
||||
<<interactive-gen(name="mpc-interactive", keys=inter-mpc)>>
|
||||
<<interactive-gen(name="mpc-interactive", keys=inter-mpc)>>
|
||||
#+end_src
|
||||
|
||||
Another one will be defined for the general audio of my computer. And
|
||||
@ -1253,7 +1250,7 @@ for my screen’s backlight.
|
||||
| ~m~ | ~exec amixer -q set Master 1+ toggle~ |
|
||||
|
||||
#+begin_src lisp
|
||||
<<interactive-gen(name="media-interactive", keys=inter-media)>>
|
||||
<<interactive-gen(name="media-interactive", keys=inter-media)>>
|
||||
#+end_src
|
||||
|
||||
Then, let’s declare a keymap for our media controls.
|
||||
@ -1272,12 +1269,12 @@ Then, let’s declare a keymap for our media controls.
|
||||
|
||||
Let’s translate this table in CommonLisp:
|
||||
#+begin_src lisp
|
||||
(defvar *my-media-keymap*
|
||||
(defvar *my-media-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=media-management)>>
|
||||
m))
|
||||
|
||||
(define-key *root-map* (kbd "m") '*my-media-keymap*)
|
||||
(define-key *root-map* (kbd "m") '*my-media-keymap*)
|
||||
#+end_src
|
||||
|
||||
I will also define on ~*top-map*~ some basic volume management keybinds
|
||||
@ -1298,7 +1295,7 @@ media-related, but I’ll add keybinds for my screen’s backlight.
|
||||
| ~XF86MonBrightnessUp~ | ~exec xbacklight -inc 2~ |
|
||||
|
||||
#+begin_src lisp
|
||||
<<keybinds-gen(map="*top-map*", keybinds=media-top-level)>>
|
||||
<<keybinds-gen(map="*top-map*", keybinds=media-top-level)>>
|
||||
#+end_src
|
||||
|
||||
** Misc
|
||||
@ -1316,7 +1313,7 @@ anywhere else:
|
||||
| ~r~ | ~reload~ |
|
||||
|
||||
#+begin_src lisp
|
||||
<<keybinds-gen(map="*root-map*", keybinds=misc-root-map)>>
|
||||
<<keybinds-gen(map="*root-map*", keybinds=misc-root-map)>>
|
||||
#+end_src
|
||||
|
||||
From time to time, I need to switch between different keyboard
|
||||
@ -1330,12 +1327,12 @@ games and the bépo layout most of the time. I’ll use the command
|
||||
| ~u~ | ~exec setxkbmap us~ |
|
||||
|
||||
#+begin_src lisp
|
||||
(defvar *my-keyboard-layout-keymap*
|
||||
(defvar *my-keyboard-layout-keymap*
|
||||
(let ((m (make-sparse-keymap)))
|
||||
<<keybinds-gen(map="m", keybinds=keyboard-layout-map)>>
|
||||
m))
|
||||
|
||||
(define-key *root-map* (kbd "k") '*my-keyboard-layout-keymap*)
|
||||
(define-key *root-map* (kbd "k") '*my-keyboard-layout-keymap*)
|
||||
#+end_src
|
||||
|
||||
* org functions :noexport:
|
||||
@ -1345,7 +1342,7 @@ games and the bépo layout most of the time. I’ll use the command
|
||||
|
||||
#+name: keybinds-gen
|
||||
#+begin_src emacs-lisp :var map="m" keybinds=frames-float
|
||||
(mapconcat (lambda (keybind)
|
||||
(mapconcat (lambda (keybind)
|
||||
(format "%s" (let ((key (let ((s (car keybind)))
|
||||
(substring-no-properties s 1 (1- (length s)))))
|
||||
(function (let ((s (cadr keybind)))
|
||||
@ -1361,7 +1358,7 @@ games and the bépo layout most of the time. I’ll use the command
|
||||
|
||||
#+name: interactive-gen
|
||||
#+begin_src emacs-lisp :var name="inter" keys=inter-mpc
|
||||
(format "%s"
|
||||
(format "%s"
|
||||
`(define-interactive-keymap ,name ()
|
||||
"\n "
|
||||
,(mapconcat (lambda (keybind)
|
||||
@ -1382,7 +1379,7 @@ games and the bépo layout most of the time. I’ll use the command
|
||||
|
||||
#+name: num-to-char
|
||||
#+begin_src emacs-lisp :var table=number-to-char-table num=0
|
||||
(let ((char (replace-regexp-in-string (regexp-quote "~")
|
||||
(let ((char (replace-regexp-in-string (regexp-quote "~")
|
||||
""
|
||||
(let* ((row (assoc num table))
|
||||
(char (cadr row))
|
||||
|
@ -24,12 +24,14 @@ Whether if a new *window* will retain the current path. Possible values are:
|
||||
#+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~
|
||||
#+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~
|
||||
@ -37,6 +39,7 @@ is still experimental. Possible values are:
|
||||
#+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~
|
||||
@ -56,18 +59,21 @@ Possible values are:
|
||||
#+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'
|
||||
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)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_highlight_focused_pane=false
|
||||
tmux_conf_theme_highlight_focused_pane=false
|
||||
#+END_SRC
|
||||
|
||||
Set the terminal title. Built-in variables are:
|
||||
- =#{circled_window_index}=
|
||||
- =#{circled_session_name}=
|
||||
@ -76,16 +82,17 @@ Set the terminal title. Built-in variables are:
|
||||
- =#{username}=
|
||||
- =#{username_ssh}=
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W'
|
||||
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 don’t 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'
|
||||
tmux_conf_theme_right_separator_main='\uE0B2'
|
||||
tmux_conf_theme_right_separator_sub='\uE0B3'
|
||||
tmux_conf_theme_left_separator_main='\uE0B0'
|
||||
tmux_conf_theme_left_separator_sub='\uE0B1'
|
||||
tmux_conf_theme_right_separator_main='\uE0B2'
|
||||
tmux_conf_theme_right_separator_sub='\uE0B3'
|
||||
#+END_SRC
|
||||
|
||||
** Colors and style
|
||||
@ -103,45 +110,52 @@ Choose the style of the pane borders. Possible values are:
|
||||
#+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.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_focused_pane_fg='default'
|
||||
tmux_conf_theme_focused_pane_bg='#0087d7'
|
||||
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'
|
||||
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'
|
||||
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'
|
||||
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'
|
||||
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'
|
||||
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'
|
||||
tmux_conf_theme_status_bg='#080808'
|
||||
tmux_conf_theme_status_attr='none'
|
||||
tmux_conf_theme_status_fg='#8a8a8a'
|
||||
tmux_conf_theme_status_bg='#080808'
|
||||
tmux_conf_theme_status_attr='none'
|
||||
#+END_SRC
|
||||
|
||||
** Window status bar
|
||||
@ -152,10 +166,11 @@ The following variables are to set the window’s status style and format.
|
||||
|
||||
Sets the colors and style of the window status.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_fg='#8a8a8a'
|
||||
tmux_conf_theme_window_status_bg='#080808'
|
||||
tmux_conf_theme_window_status_attr='none'
|
||||
tmux_conf_theme_window_status_fg='#8a8a8a'
|
||||
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}=
|
||||
@ -166,12 +181,14 @@ Sets the format of the window status. Built-in variables are:
|
||||
#+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'
|
||||
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}=
|
||||
@ -180,26 +197,30 @@ Sets the format of the currentwindow status. Built-in variables are:
|
||||
- =#{username}=
|
||||
- =#{username_ssh}=
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_window_status_current_format='#I #W'
|
||||
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'
|
||||
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'
|
||||
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'
|
||||
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:
|
||||
- =#{battery_bar}=
|
||||
@ -223,100 +244,112 @@ separated with =|=, subsections with =,=. The built-in values are:
|
||||
- =#{username}=
|
||||
- =#{username_ssh}=
|
||||
#+BEGIN_SRC conf-unix
|
||||
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} '
|
||||
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'
|
||||
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'
|
||||
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
|
||||
tmux_conf_theme_pairing_fg='none'
|
||||
tmux_conf_theme_pairing_bg='none'
|
||||
tmux_conf_theme_pairing_attr='none'
|
||||
tmux_conf_theme_pairing='👓 ' # U+1F453
|
||||
tmux_conf_theme_pairing_fg='none'
|
||||
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
|
||||
tmux_conf_theme_prefix='⌨ ' # U+2328
|
||||
tmux_conf_theme_prefix_fg='none'
|
||||
tmux_conf_theme_prefix_bg='none'
|
||||
tmux_conf_theme_prefix_attr='none'
|
||||
tmux_conf_theme_prefix='⌨ ' # U+2328
|
||||
tmux_conf_theme_prefix_fg='none'
|
||||
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='!'
|
||||
tmux_conf_theme_root_fg='none'
|
||||
tmux_conf_theme_root_bg='none'
|
||||
tmux_conf_theme_root_attr='bold,blink'
|
||||
tmux_conf_theme_root='!'
|
||||
tmux_conf_theme_root_fg='none'
|
||||
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
|
||||
tmux_conf_theme_synchronized_fg='none'
|
||||
tmux_conf_theme_synchronized_bg='none'
|
||||
tmux_conf_theme_synchronized_attr='none'
|
||||
tmux_conf_theme_synchronized='🔒' # U+1F512
|
||||
tmux_conf_theme_synchronized_fg='none'
|
||||
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='◻'
|
||||
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:
|
||||
- =auto=
|
||||
- an integer number, e.g. 5
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_bar_length='auto'
|
||||
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 =#=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_bar_palette='gradient'
|
||||
#tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000'
|
||||
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 =#=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_hbar_palette='gradient'
|
||||
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 =#=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_battery_vbar_palette='gradient'
|
||||
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
|
||||
tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
|
||||
# tmux_conf_battery_status_charging='↑' # U+2191
|
||||
# tmux_conf_battery_status_discharging='↓' # U+2193
|
||||
#tmux_conf_battery_status_charging='🔌 ' # U+1F50C
|
||||
tmux_conf_battery_status_charging='⚡ ' # U+26A1
|
||||
tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
|
||||
# tmux_conf_battery_status_charging='↑' # U+2191
|
||||
# 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=.
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_theme_clock_colour='#00afff'
|
||||
tmux_conf_theme_clock_style='24'
|
||||
tmux_conf_theme_clock_colour='#00afff'
|
||||
tmux_conf_theme_clock_style='24'
|
||||
#+END_SRC
|
||||
|
||||
* Clipboard
|
||||
@ -328,7 +361,7 @@ Possible values are:
|
||||
- ~true~
|
||||
- ~false~ (default)
|
||||
#+BEGIN_SRC conf-unix
|
||||
tmux_conf_copy_to_os_clipboard=false
|
||||
tmux_conf_copy_to_os_clipboard=false
|
||||
#+END_SRC
|
||||
|
||||
* User customizations
|
||||
@ -338,29 +371,33 @@ Possible values are:
|
||||
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
|
||||
set -g history-limit 10000
|
||||
#+END_SRC
|
||||
|
||||
We can also start with mouse mode enabled. But I don’t.
|
||||
#+BEGIN_SRC conf-unix
|
||||
#set -g mouse on
|
||||
#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
|
||||
don’t, as said in my dotfish, I prefer to use Emacs.
|
||||
#+BEGIN_SRC conf-unix
|
||||
#set -g status-keys vi
|
||||
#set -g mode-keys vi
|
||||
#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.
|
||||
#+BEGIN_SRC conf-unix
|
||||
# set -gu prefix2
|
||||
# unbind C-a
|
||||
# unbind C-b
|
||||
# set -g prefix C-a
|
||||
# bind C-a send-prefix
|
||||
# set -gu prefix2
|
||||
# unbind C-a
|
||||
# unbind C-b
|
||||
# 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
|
||||
#set -g status-position top
|
||||
#+END_SRC
|
||||
|
Loading…
Reference in New Issue
Block a user