Moved org files to single directory, Polybar config now in org file

This commit is contained in:
2020-01-16 19:48:14 +01:00
parent 70c11cc00a
commit edc7d3b970
28 changed files with 5353 additions and 4671 deletions

View File

@@ -1,596 +0,0 @@
#+TITLE: Phundraks fish config
#+INCLUDE: ~/org/config-website/headers.org
#+OPTIONS: auto-id:t
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's fish config" />
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's fish config" />
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the fish config file of Phundrak" />
* Table of Contents :TOC_4_gh:noexport:
:PROPERTIES:
:CUSTOM_ID: h-c7ab05d0-4c5f-4a4c-8603-4c79e264141c
:END:
- [[#presentation][Presentation]]
- [[#fish-from-within-emacs][Fish from within Emacs]]
- [[#tramp-remote-access][Tramp remote access]]
- [[#regular-fish-shell-appearance][Regular fish shell appearance]]
- [[#global-variables][Global variables]]
- [[#theme-customization][Theme customization]]
- [[#abbreviations][Abbreviations]]
- [[#system-monitoring][System monitoring]]
- [[#system-management-packages-and-services][System management (packages and services)]]
- [[#package-mangaement][Package mangaement]]
- [[#service-management][Service management]]
- [[#development][Development]]
- [[#cmake][CMake]]
- [[#compilation][Compilation]]
- [[#docker][Docker]]
- [[#git][Git]]
- [[#prolog][Prolog]]
- [[#text-editors][Text editors]]
- [[#latex][LaTeX]]
- [[#some-security-measures][Some security measures]]
- [[#typos][Typos]]
- [[#misc][Misc]]
- [[#sudo][Sudo]]
- [[#exit][Exit]]
- [[#history][History]]
- [[#youtube-dl-related-commands][~youtube-dl~ related commands]]
- [[#song-download-from-youtube][Song download from YouTube]]
- [[#videos-download-from-youtube][Videos download from YouTube]]
- [[#mpv][MPV]]
- [[#compression][Compression]]
- [[#feh][Feh]]
- [[#network-management][Network Management]]
- [[#wget][Wget]]
* Presentation
:PROPERTIES:
:CUSTOM_ID: h-c2560b46-7f97-472f-b898-5ab483832228
:HEADER-ARGS: :tangle config.fish :exports code
:END:
The file present in =~/.config/fish/config.fish= is the configuration file for
the [[https://fishshell.com/][fish shell]]. It contains custom functions, environment variables and
abbreviations.
Just in case, we might need sometimes to declare the fish function
=fish_title= as =true=, so lets do so.
#+BEGIN_SRC fish
function fish_title
true
end
#+END_SRC
* Fish from within Emacs
:PROPERTIES:
:CUSTOM_ID: h-97d738f4-1ea0-4f64-a31d-19643486a951
:HEADER-ARGS: :tangle config.fish :exports code
:END:
I sometimes call fish from within emacs, with =M-x ansi-term=. In this case,
the variable =TERM= needs to have the value =eterm-color=.
#+BEGIN_SRC fish
if test -n "$EMACS"
set -x TERM eterm-color
end
#+END_SRC
* Tramp remote access
:PROPERTIES:
:CUSTOM_ID: h-6cad2cc9-aef6-4df4-90f9-97053e82072a
:HEADER-ARGS: :tangle config.fish :exports code
:END:
When accessing from a remote machine our computer from Emacs, tramp needs a
precise shell appearance: a simple =$= followed by a space after which to put
the commands it needs to execute, and nothing else. Due to this, lets
deactivate and redefine some of the functions defining the appearance of
fish.
#+BEGIN_SRC fish
if test "$TERM" = "dumb"
function fish_prompt
echo "\$ "
end
function fish_right_prompt; end
function fish_greeting; end
function fish_title; end
end
#+END_SRC
* Regular fish shell appearance
:PROPERTIES:
:CUSTOM_ID: h-a8434b29-c146-4141-b8f8-1b446c791907
:HEADER-ARGS: :tangle config.fish :exports code
:END:
Now, there is only one function I modify when it comes to the appearance of
fish when Im the one using it: I simply “delete” the =fish_greeting=
function.
#+BEGIN_SRC fish
function fish_greeting; end
#+END_SRC
* Global variables
:PROPERTIES:
:CUSTOM_ID: h-0eff37da-af9f-4546-8ad3-201961a2200f
:HEADER-ARGS: :tangle config.fish :exports code
:END:
Some global variables might sometimes be needed and need to be modified. This
is for example the case with my =PATH= variable in which I add Rusts Cargos
binaries, Gos binaries and my own executables. And of course, dont forget
to add the already existing =PATH=.
#+BEGIN_SRC fish
set -gx PATH \
$HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin \
$HOME/.gem/ruby/2.6.0/bin $PATH
#+END_SRC
Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it
can get the sudo password. So, lets declare it.
#+BEGIN_SRC fish
set -gx SUDO_ASKPASS ~/.local/bin/askpass
#+END_SRC
Now, lets declare our editor of choice, EmacsClient; not Emacs itself since
it will most often be just quick edits, nothing too heavy, if it is called
from the =EDITOR= variable (from Git, for example).
#+BEGIN_SRC fish
set -gx EDITOR emacsclient -c
#+END_SRC
We also need to set the path to the Dart SDK.
#+BEGIN_SRC fish
set -gx DART_SDK /opt/dart-sdk/bin
#+END_SRC
And we also need to specify where the Android SDK it located.
#+BEGIN_SRC fish
set -gx ANDROID_HOME $HOME/Android/Sdk
#+END_SRC
Finally, some development packages require the =PKG_CONFIG_PATH= to be set,
so lets do so.
#+BEGIN_SRC fish
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
#+END_SRC
* Theme customization
:PROPERTIES:
:CUSTOM_ID: h-e9dccb31-8350-459d-b688-b5b7cbeab272
:END:
The theme I use is =bobthefish=. Although its default configuration is quite
alright, it allows some customization. The first thing I want to enable is the
support for =nerd-fonts=:
#+BEGIN_SRC fish
set -g theme_nerd_fonts_support yes
#+END_SRC
Next, I want the name of the current process to be shown in the terminal
title.
#+BEGIN_SRC fish
set -g theme_title_display_process yes
#+END_SRC
I also wish to display the current host in the prompt, but only when I am
connected through an SSH session.
#+BEGIN_SRC fish
set -g theme_display_hostname ssh
#+END_SRC
I also want the sudo username to be displayed, as a warning that I am indeed
running a session as root.
#+BEGIN_SRC fish
set -g theme_display_sudo_user yes
#+END_SRC
The exit status can be sometimes really useful, hence why I want it activated.
#+BEGIN_SRC fish
set -g theme_show_exit_status yes
#+END_SRC
I also want to have proper git worktree support.
#+BEGIN_SRC fish
set -g theme_git_worktree_support yes
#+END_SRC
* Abbreviations
:PROPERTIES:
:CUSTOM_ID: h-740bd904-3e32-4c09-b0a4-bde16ae2e116
:HEADER-ARGS: :tangle config.fish :exports code
:END:
** System monitoring
:PROPERTIES:
:CUSTOM_ID: h-ec910a8c-9154-48a4-b4cd-df28cb4e54d9
:END:
Here I have some abbreviations which are quite useful when performing some
system monitoring. With =df=, we can get an overview of our filesystem
usage, while with =diskspace= we get some more precise information.
#+BEGIN_SRC fish
abbr df 'df -H'
abbr diskspace 'sudo df -h | grep -E "sd|lv|Size"'
#+END_SRC
=meminfo= is a call to =free= with sane defaults.
#+BEGIN_SRC fish
abbr meminfo 'free -m -l -t'
#+END_SRC
Similar to =meminfo=, we also have =gpumeminfo= so we can get a quick look
at the memory-related logs of our X session.
#+BEGIN_SRC fish
abbr gpumeminfo 'grep -i --color memory /var/log/Xorg.0.log'
#+END_SRC
I also declared =cpuinfo= an alias of =lscpu= in order to keep consistent
with =meminfo=.
#+BEGIN_SRC fish
abbr cpuinfo lscpu
#+END_SRC
=pscpu= gives us information on what the CPU is running right now, and
=pscpu10= limits that to the top 10 threads.
#+BEGIN_SRC fish
abbr pscpu 'ps auxf | sort -nr -k 3'
abbr pscpu10 'ps auxf | sort -nr -k 3 | head -10'
#+END_SRC
Similarly, =psmem= gives us information on the memory usage of the current
threads, and =psmem10= only the ten most important threads in terms of
memory usage.
#+BEGIN_SRC fish
abbr psmem 'ps auxf | sort -nr -k 4'
abbr psmem10 'ps auxf | sort -nr -k 4 | head -10'
#+END_SRC
** System management (packages and services)
:PROPERTIES:
:CUSTOM_ID: h-78ac23f0-960d-4f56-9cba-64413fd61885
:END:
I added some of these abbreviations due to how often I have to write the
whole thing.
*** Package mangaement
:PROPERTIES:
:CUSTOM_ID: h-281a59aa-4ea0-47ab-a4cc-33fff8d38165
:END:
The first command is =remove= which removes a package from my system, as
well as its dependencies no longer needed.
#+BEGIN_SRC fish
abbr remove 'sudo pacman -Rscnd'
#+END_SRC
But if I just want to run =pacman= as sudo, then I could always just type
=p=.
#+BEGIN_SRC fish
abbr p 'sudo -A pacman'
#+END_SRC
Sometimes, I just want to purge my package managers cache, be it
=pacman='s or =yay='s. This is why I simply type =purge=.
#+BEGIN_SRC fish
abbr purge 'yay -Sc'
#+END_SRC
And if I want to simply seach among the =pacman= repos, I can type
=search=. Otherwise, if I want to include AUR results, Ill use =yay=.
#+BEGIN_SRC fish
abbr search 'pacman -Ss'
#+END_SRC
To update everything from the official repos, Ill sometimes type =update=
instead of the full command.
#+BEGIN_SRC fish
abbr update 'sudo pacman -Syu'
#+END_SRC
*** Service management
:PROPERTIES:
:CUSTOM_ID: h-3a734119-ccee-4cdf-b04c-d55a37dea571
:END:
I dont have the muscle memory of =systemctl=. So instead, I simply type
=c= when I want to do something user service related.
#+BEGIN_SRC fish
abbr s 'systemctl --user'
#+END_SRC
And if I want to manipulate system services, I can instead type a simple
capital =S=.
#+BEGIN_SRC fish
abbr S 'sudo systemctl'
#+END_SRC
** Development
:PROPERTIES:
:CUSTOM_ID: h-32ae38a2-41ad-438e-b619-220a63166115
:END:
A good amount of these commands are development related, especially when it
comes to compilation or Docker.
*** CMake
:PROPERTIES:
:CUSTOM_ID: h-887c87aa-b100-4b27-9006-778fd7e3329c
:END:
I have the following abbreviations so I can quickly run CMake and create a
configuration for debug or release profiles.
#+BEGIN_SRC fish
abbr cdebug 'cmake -DCMAKE_BUILD_TYPE=Debug'
abbr crelease 'cmake -DCMAKE_BUILD_TYPE=Release'
#+END_SRC
*** Compilation
:PROPERTIES:
:CUSTOM_ID: h-0beb47e5-d76a-4037-8f58-e8de141e3761
:END:
By default, I set =clang=, =clang++=, =gcc= and =g++= to the latest
standard and with the =-Wall= flag activated.
#+BEGIN_SRC fish :tangle
abbr clang 'clang -Wall'
abbr clang++ 'clang++ -Wall'
abbr g++ 'g++ -Wall -std=c++17'
abbr gcc 'gcc -Wall -std=c18'
#+END_SRC
*** Docker
:PROPERTIES:
:CUSTOM_ID: h-91c7ff90-7b43-4802-be69-5d102281c6d3
:END:
And of course, when it comes to Docker Compose, I dont have time to write
the full command, so I use these instead.
#+BEGIN_SRC fish
abbr dc docker-compose
abbr dcd 'docker-compose down'
abbr dcr 'docker-compose run --rm'
abbr dcu 'docker-compose up'
abbr dcub 'docker-compose up --build'
#+END_SRC
*** Git
:PROPERTIES:
:CUSTOM_ID: h-e72347d4-590e-448c-bc33-0a70fa8ab35b
:END:
And lets face it: we all at one point just wanted to commit our code
without thinking about the message, to just get over with it. Dont worry,
I got you covered.
#+BEGIN_SRC fish :tangle
abbr randcommit 'git commit -m (curl -s whatthecommit.com/index.txt)'
#+END_SRC
*** Prolog
:PROPERTIES:
:CUSTOM_ID: h-cbb6c31e-faaa-48c3-a83a-d1f143fdcb8d
:END:
When I launch =swipl=, I prefer to have my terminal cleaned before and
after it runs, I find it more clean.
#+BEGIN_SRC fish
abbr swipl 'clear && swipl -q && clear'
#+END_SRC
*** Text editors
:PROPERTIES:
:CUSTOM_ID: h-51155e06-872d-4a12-9bf7-ae5eabc256ad
:END:
I greatly prefer to use Emacsclient as my main text editor; Emacs has
basically all I need. So, its only normal I have an abbreviation to launch
a new instance of it.
#+BEGIN_SRC fish
abbr e 'emacsclient -c'
#+END_SRC
However, in a graphical environment, this will launch a new graphical
window of Emacs. To launch a terminal instance, Ill use =enw= (=nw= stands
for the option “nowindow” =-nw= of Emacs).
#+BEGIN_SRC fish
abbr enw 'emacsclient -c -nw'
#+END_SRC
I also have the abbreviation =vi= which refers to =vim=. I really should
learn =vi=, but I also really dont feel like it.
#+BEGIN_SRC fish
abbr vi vim
#+END_SRC
** LaTeX
:PROPERTIES:
:CUSTOM_ID: h-a8f8a707-90d7-4784-982d-d959b183148e
:END:
Yes, although I use org-mode, I still have some use for LaTeX, especially
when it comes to PDF exports of my org files. Hence why I use the LaTeX
package manager. It is recommended to use =tllocalmgr= instead of =tlmgr=,
but I can never remember the command, and the latter is faster to type, so
time for an abbreviation.
#+BEGIN_SRC fish
abbr tlmgr tllocalmgr
#+END_SRC
#+BEGIN_SRC fish
abbr texhash 'sudo texhash'
#+END_SRC
** Some security measures
:PROPERTIES:
:CUSTOM_ID: h-dd97ea71-c43f-4b79-8bb7-1f857284b1b4
:END:
Some commands can be quite dangerous when not used properly, which is why I
added default flags and options so I can get warnings before things get
ugly.
#+BEGIN_SRC fish
abbr cp 'cp -i'
abbr ln 'ln -i'
abbr lns 'ln -si'
abbr mv 'mv -i'
abbr rm 'rm -I'
abbr rmd 'rm --preserve-root -Ir'
abbr rmdf 'rm --preserve-root -Irf'
abbr rmf 'rm --preserve-root -If'
#+END_SRC
The =-i= and =-I= add prompts in case we might not want to do what we asked
the shell to do. Notice =lns= which creates symlinks, =rmd= which removes
directories, =rmf= which forces deletion, and =rmdf= which forces the
delition of a directory. Notice also the =--preserve-root= which will
prevent me from accidentally removing the root folder. I added the same
option to =chgrp=, =chmod=, and =chown=.
#+BEGIN_SRC fish
abbr chgrp 'chgrp --preserve-root'
abbr chmod 'chmod --preserve-root'
abbr chown 'chown --preserve-root'
#+END_SRC
** Typos
:PROPERTIES:
:CUSTOM_ID: h-4c5a03cd-20a8-437e-87b7-af990780084e
:END:
Lets admit it, we all make typos from time to time in the shell, and some
are recurrent enough we make abbreviations or aliases of the correct
command. Well, I have some of my abbreviations which were make exactly
because of this.
Sometimes for some reasons, my brain makes me write =clean= instead of
=clear=. So, lets just replace the former by the latter.
#+BEGIN_SRC fish
abbr clean clear
#+END_SRC
Im also very bad at typing =exit=.
#+BEGIN_SRC fish
abbr exi exit
abbr exti exit
#+END_SRC
And sometimes I suck at typing =htop=.
#+BEGIN_SRC fish
abbr hotp htop
#+END_SRC
** Misc
:PROPERTIES:
:CUSTOM_ID: h-3a237ec0-c535-42c7-9c60-3d083745b643
:END:
Finally, some miscellaneous abbreviations that dont really fit into any of
the above categories.
*** Sudo
:PROPERTIES:
:CUSTOM_ID: h-0955e2fc-ec25-41b6-814a-929fa3718dda
:END:
First, I make it so that =sudo= comes with the =-A= switch in order to call
my custom graphical script for getting my password (see
[[file:~/.local/bin/askpass][.local/bin/askpass]]). I also made it so =please= is an equivalent to =sudo
-A= as a joke.
#+BEGIN_SRC fish
abbr please 'sudo -A'
#+END_SRC
*** Exit
:PROPERTIES:
:CUSTOM_ID: h-8cf0e895-b919-41a8-ad3d-c5294dc507fd
:END:
Sometimes I find it easier to just type =q= instead of =exit=.
#+BEGIN_SRC fish
abbr q exit
#+END_SRC
*** History
:PROPERTIES:
:CUSTOM_ID: h-162052c5-63c4-435a-b973-422346522c69
:END:
I also find it more intuitive and faster to just write =hist= instead of
=history=, so lets declare that.
#+BEGIN_SRC fish
abbr hist history
#+END_SRC
*** ~youtube-dl~ related commands
:PROPERTIES:
:CUSTOM_ID: h-177d56dc-39a6-4f4c-a7ba-179dd5c6cac8
:END:
**** Song download from YouTube
:PROPERTIES:
:CUSTOM_ID: h-4bc663a9-b609-4c86-9a4d-a220013c67f9
:END:
When I want to download a song from YouTube, Ill just use the command
=flac videoIdentifier= to get it through =youtube-dl=.
#+BEGIN_SRC fish
abbr flac 'youtube-dl -x --audio-format flac --audio-quality 0 -o "~/Music/%(uploader)s/%(title)s.%(ext)s"'
#+END_SRC
**** Videos download from YouTube
:PROPERTIES:
:CUSTOM_ID: h-e6e45b59-7620-4d17-ba32-67a33f39cc4b
:END:
I download a LOT of videos from YouTube, generally educative videos that I
do not want to lose to YouTube one day who will decide that such channel is
unworthy of their platform, or if the original author decides to delete
their videos or whatever. So, I use the abbreviation ~ytdl~ to download
either one video, or a whole YouTube channel.
#+BEGIN_SRC fish
abbr ytdl 'youtube-dl -f best -ciw -o "~/Videos/YouTube/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s"'
#+END_SRC
*** MPV
:PROPERTIES:
:CUSTOM_ID: h-3fd5a7eb-4ed4-4b0b-87ca-28f36fb22793
:END:
When it comes to mpv, I do not want to force it to open a graphical window
if for example I want to listen to an audio file. I also do not want any
border on that window. So, I declared this abbreviation.
#+BEGIN_SRC fish
abbr mpv 'mpv --no-border --force-window=no'
#+END_SRC
*** Compression
:PROPERTIES:
:CUSTOM_ID: h-05919be3-360a-45c6-8c89-76836375d55b
:END:
It seems its just like many other people, but I cannot for the life of me
remember the syntax of =tar=. So, I made the following abbreviations, and
one day hopefully, after seeing the abbreviations expansion over and over
Ill remember the command like I did for the abbreviation of =remove= (see
[[#h-281a59aa-4ea0-47ab-a4cc-33fff8d38165][Package management]]).
#+BEGIN_SRC fish
abbr compress 'tar -czf'
abbr untar 'tar -xvzf'
#+END_SRC
*** Feh
:PROPERTIES:
:CUSTOM_ID: h-41cfc583-14ba-4f15-9578-bc37b432a3ce
:END:
Some sane default options for =feh=, including auto-zoom to fit the picture
to the window, a borderless window, and again scale the image to fit the
window geometry.
#+BEGIN_SRC fish
abbr feh 'feh -Zx.'
#+END_SRC
*** Network Management
:PROPERTIES:
:CUSTOM_ID: h-5f9d4866-3086-4ed9-9ff3-d80a0af36593
:END:
First, we have just =nmcli= with sane default options, that is a pretty output
with colors.
#+BEGIN_SRC fish
abbr nmcli 'nmcli -p -c auto'
#+END_SRC
Next, we have some NordVPN-related shortcuts. The first one is a simple
abbreviation to =nordvpn=. The second one is a shortcut to connect to a
server, and to disconnect from the current server.
#+BEGIN_SRC fish
abbr n 'nordvpn'
abbr nc 'nordvpn c'
abbr nd 'nordvpn d'
#+END_SRC
I also have a couple of shortcuts to quickly connect to some preselected
countries, mainly France, Germany, Japan and the US.
#+BEGIN_SRC fish
abbr ncf 'nordvpn c France'
abbr ncg 'nordvpn c Germany'
abbr ncj 'nordvpn c Japan'
abbr ncu 'nordvpn c United_States'
#+END_SRC
*** Wget
:PROPERTIES:
:CUSTOM_ID: h-74f84f1c-433d-488a-88a7-89915c1a3bd5
:END:
By default, continue a download that was interupted.
#+BEGIN_SRC fish
abbr wget 'wget -c'
#+END_SRC

View File

@@ -31,6 +31,18 @@ set -gx ANDROID_HOME $HOME/Android/Sdk
set -gx PKG_CONFIG_PATH /usr/local/lib/pkgconfig/ $PKG_CONFIG_PATH
set -g theme_nerd_fonts_support yes
set -g theme_title_display_process yes
set -g theme_display_hostname ssh
set -g theme_display_sudo_user yes
set -g theme_show_exit_status yes
set -g theme_git_worktree_support yes
abbr df 'df -H'
abbr diskspace 'sudo df -h | grep -E "sd|lv|Size"'

View File

@@ -1,933 +0,0 @@
# -*- org-confirm-babel-evaluate: nil -*-
#+TITLE: Phundraks i3 config
#+INCLUDE: ~/org/config-website/headers.org
#+OPTIONS: auto-id:t
#+HTML_HEAD_EXTRA: <meta name="description" content="Phundrak's i3 config" />
#+HTML_HEAD_EXTRA: <meta property="og:title" content="Phundrak's i3 config" />
#+HTML_HEAD_EXTRA: <meta property="og:description" content="Description of the i3 config file of Phundrak" />
* Table of Contents :TOC_4_gh:noexport:
:PROPERTIES:
:CUSTOM_ID: h-c7ab05d0-4c5f-4a4c-8603-4c79e264141c
:END:
- [[#presentation][Presentation]]
- [[#variables-declaration][Variables declaration]]
- [[#global][Global]]
- [[#floating-windows][Floating windows]]
- [[#i3-global-settings][i3 global settings]]
- [[#mouse-settings][Mouse settings]]
- [[#popup-handling][Popup handling]]
- [[#behavior-of-workspace-changes][Behavior of workspace changes]]
- [[#gaps-and-window-appearance][Gaps and window appearance]]
- [[#assigning-windows-to-workspaces][Assigning windows to workspaces]]
- [[#shortcuts][Shortcuts]]
- [[#terminal-shortcuts][Terminal shortcuts]]
- [[#i3-shortcuts][i3 shortcuts]]
- [[#window-and-workspace-management][Window and workspace management]]
- [[#managing-how-windows-will-split][Managing how windows will split]]
- [[#focus-windows][Focus windows]]
- [[#focus-workspaces][Focus workspaces]]
- [[#moving-windows][Moving windows]]
- [[#moving-containers][Moving containers]]
- [[#moving-workspaces][Moving workspaces]]
- [[#close-windows][Close windows]]
- [[#manage-the-size-of-the-current-window][Manage the size of the current window]]
- [[#manage-floating-windows][Manage floating windows]]
- [[#scratchpad-and-window-display][Scratchpad and window display]]
- [[#gaps-management][Gaps management]]
- [[#launching-software][Launching software]]
- [[#software-and-command-launcher][Software and command launcher]]
- [[#internet-software][Internet software]]
- [[#screenshots][Screenshots]]
- [[#screen-brightness][Screen brightness]]
- [[#media-control][Media control]]
- [[#rofi-utilities][Rofi utilities]]
- [[#miscellaneous][Miscellaneous]]
- [[#screen-management][Screen management]]
- [[#software-autolaunch][Software autolaunch]]
* Presentation
:PROPERTIES:
:CUSTOM_ID: h-2b02cfba-4ada-4f75-b522-bfcb8512119c
:HEADER-ARGS: :tangle config##yadm.j2
:END:
=i3= is a window manager for GNU/Linux which automatically tiles windows in
workspaces. This configuration was ade to automatically handle some tasks such
as which software allowed where, autostart, and launching software with
shortcuts.
It is to be noted I am using [[https://github.com/resloved/i3][resloveds fork of i3]], =i3-gaps-rounded=. Some
configuration will not work with =i3-gaps=, and some will not work with
vanilla =i3= either.
#+BEGIN_SRC conf :exports none
# -*- mode: conf -*-
#+END_SRC
* Variables declaration
:PROPERTIES:
:CUSTOM_ID: h-27f4474a-e037-4e40-b33a-7fe34ca012e3
:HEADER-ARGS: :exports code :tangle config##yadm.j2
:HEADER-ARGS:python: :exports none :tangle no
:END:
** Global
:PROPERTIES:
:CUSTOM_ID: h-dda00dd9-90e4-460b-b49c-8939c1ae11ce
:END:
The first I do is declaring the modifier key and the alt key —I dont find
the names =Mod1= and =Mod4= to be explicit enough. This will map =$mod= to
the Super key (or as some people unfortunately call it, the /Windows/ key)
and =$alt= to the Alt key.
Lets also bind the =$up=, =$down=, =$left= and =$right= variables to
respectively the up, down, left, and right arrows on the keyboard. Why bind
them to variables? If I ever want to modify the arrow keys to some other
keys, like =é=, =a=, =u=, and =i= (the equivalent of =wqsd= on the bépo
layout) or =c=, =t=, =s=, and =r= (the equivalent of =hjkl= on the bépo
layout), I will just have to modify these four lines.
Ill also set the =$term= variable. A lot of shortcuts in my i3 config rely
on the terminal emulator itself to launch commands in the terminal, and thus
call the terminal itself. If I ever need to move from my current terminal, I
will just have to change the name of the executable here.
#+NAME: variable-table
| variable | value |
|-------------+--------------------------------------------------------------------------|
| $mod | Mod4 |
| $alt | Mod1 |
| $up | Up |
| $down | Down |
| $left | Left |
| $right | Right |
| $term | st |
#+NAME: variable-sh
| variable | value |
|-------------+--------------------------------------------------------------------------|
| $exiti3 | i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit' |
| $lockscreen | Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89 |
| $rofiexec | rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons |
| $gnus | emacsclient --create-frame --eval '(gnus)' -n |
| $ec | emacsclient --create-frame -n |
| $walset | wal -i ~/Pictures/Wallpapers -o wal-set |
Variables will be set like so.
#+BEGIN_SRC conf :tangle no
set $term st
#+END_SRC
#+NAME: generate-variables
#+BEGIN_SRC python :var variables=variable-table :cache yes
result = ''
for line in variables:
result += "set {0} {1}\n".format(line[0], line[1])
return result
#+END_SRC
#+RESULTS[58c517fe29b63f631ff0ba754d5d9ec4ea673388]: generate-variables
: set $mod Mod4
: set $alt Mod1
: set $up Up
: set $down Down
: set $left Left
: set $right Right
: set $term st
Finally, some variables hold some long strings for commands I dont want to
have to type multiple times.
#+NAME: generate-variables2
#+BEGIN_SRC python :var variables=variable-sh :cache yes
result = ''
for line in variables:
result += "set {0} \"{1}\"\n".format(line[0], line[1])
return result
#+END_SRC
#+RESULTS[13a3244099ec9233a8b7003c1874b3c92cb19e34]: generate-variables2
: set $exiti3 "i3-nagbar -t warning -m 'Leave i3?' -b 'Yes' 'i3-msg exit'"
: set $lockscreen "Lucien Cartier-Tilet\n(Phuntsok Drak-pa)\n+33 (0)6 83 90 56 89"
: set $rofiexec "rofi -combi-modi 'window,drun' -show combi -mohh combi -m -1 -show-icons"
: set $gnus "emacsclient --create-frame --eval '(gnus)' -n"
: set $ec "emacsclient --create-frame -n"
: set $walset "wal -i ~/Pictures/Wallpapers -o wal-set"
Here is the configuration:
#+BEGIN_SRC conf :noweb yes
<<generate-variables()>>
<<generate-variables2()>>
#+END_SRC
Now comes the font for the window tiles. Honestly, this setting is useless
since we do not see it, but lets set it anyway.
#+BEGIN_SRC conf
font Fira Sans Book:style=Book:pixelsize=10
#+END_SRC
** Floating windows
:PROPERTIES:
:CUSTOM_ID: h-944b65df-c5c6-4f9a-9824-08e063ba20dd
:END:
Floating windows are windows that are not tiled with other windows, but
rather are free to go anywhere on your screen, with any size. A bit like what
you would get with any other non-tiling window manager or desktop environment
(though most of them support minimal tiling features).
Lets declare our floading modyfier. With floating windows, you can move them
around by clicking on the windows borders; but since we dont have any with
this config, we will have instead to press the floating modifier while
clicking on the window (anywhere on the window is fine) to move them around.
Here is the configuration:
#+BEGIN_SRC conf
floating_modifier $mod
#+END_SRC
* i3 global settings
:PROPERTIES:
:CUSTOM_ID: h-d9bc7729-d325-4071-8ad9-043ea5b80430
:HEADER-ARGS: :exports code :tangle config##yadm.j2
:END:
Some settings affect i3 globally, such as its aspect or how it handles the
mouse. Hence, here are some settings I set in my configuration.
** Mouse settings
:PROPERTIES:
:CUSTOM_ID: h-3ab33a7a-6a31-4a76-a59f-baf7913279b4
:END:
First of all, I do not want i3 to warp my mouse each time I change windows;
my mouse stays where it is.
#+BEGIN_SRC conf
mouse_warping none
#+END_SRC
I also to not want the window focus to follow my mouse, because sometimes I
will just knock my physical mouse out of the way of my hand, and when I do
that the software mouse will most likely end up in another window I do not
want to focus.
#+BEGIN_SRC conf
focus_follows_mouse no
#+END_SRC
** Popup handling
:PROPERTIES:
:CUSTOM_ID: h-64ef3c3b-bc70-4839-9bee-e113df4ee848
:END:
While in fullscreen, some software might generate a popup. In that case, I
want to be aware of that, and any popup will make me leave fullscreen in
order to be presented with said popup.
#+BEGIN_SRC conf
popup_during_fullscreen leave_fullscreen
#+END_SRC
** Behavior of workspace changes
:PROPERTIES:
:CUSTOM_ID: h-192d7269-eba7-4684-80c7-cb01c32c5f38
:END:
When changing workspace as described below, we often want to go back to the
previous workspace we were working on, but we might not remember immediately
which one it was, or we might still have our fingers ready to fire the
shortcut which made us make the first workspace change. Hence, if we type the
same workspace change shortcut, instead of doing nothing it will bring us
back to the previous workspace we were on.
#+BEGIN_SRC conf
workspace_auto_back_and_forth yes
#+END_SRC
** Gaps and window appearance
:PROPERTIES:
:CUSTOM_ID: h-52a82bb4-42b0-4740-aae6-79636072dc62
:END:
As mentioned in at the beginning of this document, I am using
i3-gaps-rounded, which brings rounded corners to i3-gaps, a fork of i3 which
brings spacing (gaps) between tiled windows.
First, I want space around my windows only when there are several containers
on the same screen, otherwise they will be maximized.
#+BEGIN_SRC conf
smart_gaps on
#+END_SRC
I also do not want to see any window border, so I will be turning this
setting off.
#+BEGIN_SRC conf
smart_borders on
#+END_SRC
By the way, the default border is invisible, since it is zero pixels wide.
#+BEGIN_SRC conf
default_border pixel 0
#+END_SRC
Then comes the size of these gaps. I made the outer gap negative so the space
between my windows and the border of my screens is smaller than the gap
between my containers.
#+BEGIN_SRC conf
gaps inner 20
gaps outer -10
#+END_SRC
And I am not using i3-gaps-rounded for nothing: my containers that are not
tiled will get their corners rounded with a radius of five pixels.
#+BEGIN_SRC conf
border_radius 5
#+END_SRC
Some parameters are also available when it comes to the colors i3 uses.
Honestly, we wont see these colors much, so lets simply keep the default
values.
#+BEGIN_SRC conf
set_from_resource $fg i3wm.color7 #f0f0f0
set_from_resource $bg i3wm.color2 #f0f0f0
# class border backgr. text indicator child_border
client.focused $bg $bg $fg $bg $bg
client.focused_inactive $bg $bg $fg $bg $bg
client.unfocused $bg $bg $fg $bg $bg
client.urgent $bg $bg $fg $bg $bg
client.placeholder $bg $bg $fg $bg $bg
#+END_SRC
* Assigning windows to workspaces
:PROPERTIES:
:CUSTOM_ID: h-21870449-7730-4164-8add-167cb4e75218
:HEADER-ARGS: :exports code :tangle config##yadm.j2
:HEADER-ARGS:python: :exports none :tangle no
:END:
I decided to bind some windows to some workspaces in order to have a better
organization of my desktop.
#+NAME: assignment-table
| Application | Class | Workspace |
|-------------+-------------+-----------|
| Emacs | Emacs | 2 |
| Chromium | Chromium | 3 |
| Firefox | firefox | 3 |
| Nemo | Nemo | 4 |
| Wonderdraft | Godot | 5 |
| Gimp | Gimp* | 6 |
| Gnome Boxes | gnome-boxes | 8 |
| Steam | Steam | 9 |
| Discord | discord | 10 |
The class table is used in the assignment in the i3 config file. For instance,
Gimps assignment will look like this:
#+BEGIN_SRC conf :tangle no
assign [class="Gimp*"] 6
#+END_SRC
#+NAME: generate-workspaces
#+BEGIN_SRC python :var workspaces=assignment-table
results = ''
for line in workspaces:
results += 'assign [class="{0}"] {1}\n'.format(line[1],line[2])
return results
#+END_SRC
Here is the configuration:
#+BEGIN_SRC conf :noweb yes
<<generate-workspaces()>>
#+END_SRC
And although this is not specifically assigning a window to a workspace, I
also want to have the tenth workspace assigned to a specific output in case I
have two screens — and since this is the case when I am using only one
computer, Marpa, I can make it a conditional thanks to yadms jinja2 syntax.
#+BEGIN_SRC conf
{% if YADM_HOSTNAME == 'Marpa' -%}
workspace 10 output eDP-1
{% endif -%}
#+END_SRC
* Shortcuts
:PROPERTIES:
:CUSTOM_ID: h-b364743d-2ff0-4548-805e-9a9e6efdaddd
:HEADER-ARGS: :exports code :noweb yes :tangle config##yadm.j2
:END:
I use *A LOT* of shortcuts when it comes to my workflow. Like, all the time.
So, expect this chapter to be a bit long, and Ill try to make it readable
still.
Shortcuts are set like so:
#+BEGIN_SRC conf :tangle no
bindsym shortcut command
#+END_SRC
#+NAME: generate-shortcuts
#+BEGIN_SRC python :exports none :var table=[] :eval yes :tangle no
results = ''
for line in table:
results += "bindsym {0} {1}\n".format(line[0], line[1])
return results
#+END_SRC
** Terminal shortcuts
:PROPERTIES:
:CUSTOM_ID: h-7dbb2902-29ca-48a7-bfa3-a831b72549f3
:END:
I have a couple of shortcuts which are related to my terminal. For instance,
~$mod+Return~ opens a regular terminal instance while ~$mod+$alt+M~ opens an
SSH instance on my Mila host.
#+NAME: terminal-shortcuts
| shortcut | command | What it does |
|-------------------+----------------------+--------------------------------------------------|
| $mod+Return | exec $term | Opens a regular terminal console |
| $mod+$alt+Return | split h;; exec $term | Opens a terminal console below the current one |
| $mod+Shift+Return | split v;; exec $term | Opens a terminal on the right of the current one |
| $mod+$alt+m | exec $term ssh Mila | Opens an SSH instance in my Mila host |
| $mod+$alt+n | exec $term ssh Naro | Opens an SSH instance in my Naro host |
| $mod+Shift+h | exec $term htop | Opens a terminal with ~htop~ |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=terminal-shortcuts)>>
#+END_SRC
** i3 shortcuts
:PROPERTIES:
:CUSTOM_ID: h-22855720-e388-463a-a941-fa8bad2c89c0
:END:
A couple of shortcuts are dedicated to i3 itself.
#+NAME: i3-sh
| shortcut | command | what it does |
|--------------+---------------------------------+----------------------------------|
| $mod+Shift+c | exec yadm alt && i3-msg reload | Reload the i3 configuration file |
| $mod+Shift+r | exec yadm alt && i3-msg restart | Restart i3 inplace |
| $mod+Shift+e | exec $exiti3 | Quit i3 |
And although this is not really an i3 shortcut per se, I add here the
shortcut for launching pywal, which will set one of my wallpapers as the
wallpaper and will generate my systems color configuration from it.
#+NAME: wal-sh
| shortcut | command | what it does |
|-------------+--------------+--------------------------------------------------------------|
| $mod+Ctrl+w | exec $walset | Set a random wallpaper and generates a color profile from it |
We also have some shortcuts to lock our screen, sleep, hibernate and shut
down our computer.
#+NAME: computer-sh
| shortcut | command | what it does |
|---------------+----------------------------+------------------------|
| $mod+l | exec i3lock -fol | Lock the screen |
| $mod+$alt+h | exec "systemctl suspend" | Suspend the computer |
| $mod+Ctrl+h | exec "systemctl hibernate" | Hibernate the computer |
| $mod+Shift+F4 | exec poweroff | Power off the computer |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=i3-sh)>>
<<generate-shortcuts(table=wal-sh)>>
<<generate-shortcuts(table=computer-sh)>>
#+END_SRC
** Window and workspace management
:PROPERTIES:
:CUSTOM_ID: h-cf3b4010-e937-473b-a0c9-9b25b2d3a0ec
:END:
*** Managing how windows will split
:PROPERTIES:
:CUSTOM_ID: h-e4e57280-91d2-4140-9295-7117cf85ed04
:END:
It is possible to indicate to i3 how windows interact with one another, and
especially how they are organized by spawning new windows either to the
right or below the current window.
#+NAME: split-win-sh
| shortcuts | command | what it does |
|-----------+---------+--------------------------------------------------------|
| $mod+h | split h | Next window to spawn will spawn below the current one |
| $mod+v | split v | Next window to spawn will spawn beside the current one |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=split-win-sh)>>
#+END_SRC
*** Focus windows
:PROPERTIES:
:CUSTOM_ID: h-570eda16-ed4b-4684-a54f-9202e8409ed9
:END:
To change window focus, you can use one of the following shortcuts:
#+NAME: window-focus-sh
| shortcut | command | what it does |
|-------------+-------------+-------------------------------------------|
| $mod+$left | focus left | Focus the window left of the current one |
| $mod+$down | focus down | Focus the window down of the current one |
| $mod+$up | focus up | Focus the window up of the current one |
| $mod+$right | focus right | Focus the windof right of the current one |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=window-focus-sh)>>
#+END_SRC
*** Focus workspaces
:PROPERTIES:
:CUSTOM_ID: h-333da167-e91c-48a7-99ef-d45b2af4c220
:END:
Just like windows, it is also possible to change focus between workspaces,
because lets be honest, most people wont have ten screens to display all
ten workspaces at the same time, and frankly that would be impractical.
#+NAME: ws-focus-sh
| shortcut | window | what it does |
|----------+--------------+-------------------------|
| $mod+1 | workspace 1 | Focus first workspace |
| $mod+2 | workspace 2 | Focus second workspace |
| $mod+3 | workspace 3 | Focus third workspace |
| $mod+4 | workspace 4 | Focus fourth workspace |
| $mod+5 | workspace 5 | Focus fifth workspace |
| $mod+6 | workspace 6 | Focus sixth workspace |
| $mod+7 | workspace 7 | Focus seventh workspace |
| $mod+8 | workspace 8 | Focus eighth workspace |
| $mod+9 | workspace 9 | Focus ninth workspace |
| $mod+0 | workspace 10 | Focus tenth workspace |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=ws-focus-sh)>>
#+END_SRC
*** Moving windows
:PROPERTIES:
:CUSTOM_ID: h-0322384a-6a23-48c9-989b-7ecae53a4e06
:END:
To move windows, a couple of shortcuts are available:
#+NAME: window-move-sh
| shortcut | command | what it does |
|-------------------+------------+-------------------------------|
| $mod+Shift+$left | move left | Move the focused window left |
| $mod+Shift+$down | move down | Move the focused window down |
| $mod+Shift+$up | move up | Move the focused window up |
| $mod+Shift+$right | move right | Move the focused window right |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=window-move-sh)>>
#+END_SRC
*** Moving containers
:PROPERTIES:
:CUSTOM_ID: h-834b2b46-1684-478b-a4d3-1cff8ec2ad2d
:END:
To move containers between the available screens, you have the following
shortcuts:
#+NAME: containers-move-sh
| shortcut | command | what it does |
|------------------+--------------------------------+------------------------------------------------------------|
| $mod+Ctrl+$left | move container to output left | Moves the container to the screen left of the current one |
| $mod+Ctrl+$down | move container to output down | Moves the container to the screen down of the current one |
| $mod+Ctrl+$up | move container to output up | Moves the container to the screen above the current one |
| $mod+Ctrl+$right | move container to output right | Moves the container to the screen right of the current one |
You can also send containers to other workspaces by their number.
#+NAME: containers-ws-sh
| shortcut | command | what it does |
|--------------+--------------------------------+--------------------------------------------|
| $mod+Shift+1 | move container to workspace 1 | Move current container to the workspace 1 |
| $mod+Shift+2 | move container to workspace 2 | Move current container to the workspace 2 |
| $mod+Shift+3 | move container to workspace 3 | Move current container to the workspace 3 |
| $mod+Shift+4 | move container to workspace 4 | Move current container to the workspace 4 |
| $mod+Shift+5 | move container to workspace 5 | Move current container to the workspace 5 |
| $mod+Shift+6 | move container to workspace 6 | Move current container to the workspace 6 |
| $mod+Shift+7 | move container to workspace 7 | Move current container to the workspace 7 |
| $mod+Shift+8 | move container to workspace 8 | Move current container to the workspace 8 |
| $mod+Shift+9 | move container to workspace 9 | Move current container to the workspace 9 |
| $mod+Shift+0 | move container to workspace 10 | Move current container to the workspace 10 |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=containers-move-sh)>>
<<generate-shortcuts(table=containers-ws-sh)>>
#+END_SRC
*** Moving workspaces
:PROPERTIES:
:CUSTOM_ID: h-4f79905e-e8e2-4675-918b-1bbe9846b088
:END:
It is also possible to move workspaces. The related shortcuts available are
the following:
#+NAME: workspace-move-sh
| shortcut | command | what it does |
|------------------------+--------------------------------+------------------------------------------------------------|
| $mod+Ctrl+Shift+$left | move workspace to output left | Moves the workspace to the screen left of the current one |
| $mod+Ctrl+Shift+$down | move workspace to output down | Moves the workspace to the screen down of the current one |
| $mod+Ctrl+Shift+$up | move workspace to output up | Moves the workspace to the screen above the current one |
| $mod+Ctrl+Shift+$right | move workspace to output right | Moves the workspace to the screen right of the current one |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=workspace-move-sh)>>
#+END_SRC
*** Close windows
:PROPERTIES:
:CUSTOM_ID: h-05e30514-86c2-42af-8712-dc0bdc30cd3d
:END:
To close windows, we have two main shortcuts: Alt+F4 and mod+q. The first
one is here due to habits, but I dont really use it anymore due to my main
keyboard which doesnt have any easy access to the functions keys, hence
mod+q.
#+NAME: close-win-sh
| shortcut | command | what it does |
|----------+---------+-------------------------|
| $mod+q | kill | kill the current window |
| $alt+F4 | kill | kill the current window |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=close-win-sh)>>
#+END_SRC
*** Manage the size of the current window
:PROPERTIES:
:CUSTOM_ID: h-f730b4c8-8602-426b-a2bc-7dfbbe42e711
:END:
It is possible to change the size of the current window, even if it is a
floating one. The first shortcut that might interest you is $mod+f which
switches your current window to fullscreen. But to resize a window, you will
need to enter the ~resize~ mode.
#+NAME: size-win-sh
| shortcut | command | what it does |
|----------+-------------------+---------------------------------------------------|
| $mod+f | fullscreen toggle | Puts the current window in fullscreen or exits it |
| $mod+r | mode "resize" | Enter resize mode |
When it comes to modes, they are defined as follows:
#+BEGIN_SRC conf :tangle no
mode "nameofyourmode" {
here go your shortcuts
}
#+END_SRC
So, all the following shortcuts will be inserted in a mode called ~resize~.
Note that not only are the resizing shortcuts bound to the arrow keys, they
are also bound to ~ctsr~, which is the bépo equivalent of ~hjkl~.
#+NAME: resize-win-sh
| shortcut | command | what it does |
|----------+-------------------------------------+-------------------------------------------|
| $right | resize grow width 20 px or 10 ppt | Increase the width of the current window |
| r | resize grow width 20 px or 10 ppt | Increase the width of the current window |
| $left | resize shrink width 10 px or 5 ppt | Decrease the width of the current window |
| c | resize shrink width 10 px or 5 ppt | Decrease the width of the current window |
| $down | resize grow height 10 px or 5 ppt | Increase the height of the current window |
| t | resize grow height 10 px or 5 ppt | Increase the height of the current window |
| $up | resize shrink height 10 px or 5 ppt | Decrease the height of the current window |
| s | resize shrink height 10 px or 5 ppt | Decrease the height of the current window |
| Return | mode "default" | Return to the default mode |
| Escape | mode "default" | Return to the default mode |
If you prefer, you can think of these shortcuts not as increasing or
decreasing the width or height of the current window, but rather as how the
bottom or right limit of the windows will be moved relative to the top left
corner.
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=size-win-sh)>>
mode "resize" {
<<generate-shortcuts(table=resize-win-sh)>>
}
#+END_SRC
*** Manage floating windows
:PROPERTIES:
:CUSTOM_ID: h-08f738b7-3369-4dbd-98e6-df6d6aa381b8
:END:
As said above, your windows can be floating windows instead of being tiled
like they are by default. For this too we have a couple of shortcuts:
#+NAME: float-win-sh
| shortcut | command | what it does |
|------------------+----------------------+------------------------------------------------------|
| $mod+Shift+space | floating toggle | Toggles the window between tiled and floating mode |
| $mod+space | focus mode_toggle | Toggles the focus between tiled and floating windows |
| $mod+Ctrl+c | move position center | Centers the focused floating window |
If you want to move around your floating window, you can do it with your
mouse while holding down the floating modifier declared [[#h-944b65df-c5c6-4f9a-9824-08e063ba20dd][here]].
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=float-win-sh)>>
#+END_SRC
*** Scratchpad and window display
:PROPERTIES:
:CUSTOM_ID: h-92e67454-eccb-4465-8d47-947a1a5d55d9
:END:
You can think of i3s scratchpad as some sort of extra workspace in which
you can hide your windows you are not using, or as if you want to reduce a
window to the taskbar of other window managers or desktop environments. You
have basically two shortcuts for the scratchpad: one that sends the current
window to the scratchpad, and one that cicles through the windows sent to
the scratchpad and shows them to you sequencially. If you go through all of
them, they will be hidden again. You can get a window out of the scratchpad
by tiling it to the current workspace with the shortcut described above.
You also have the possibility of making a floating window a sticky window.
This means not only will it show on all workspaces, it will also be on top
of every other window. It can be useful if you have some notes you want to
keep an eye on for instance.
#+NAME: scratchpad-sh
| shortcut | command | what it does |
|--------------+-----------------+------------------------------------------------------|
| $mod+Shift+s | move scratchpad | Sends the current window to the scratchpad |
| $mod+s | scratchpad show | Shows and cycles through windows from the scratchpad |
| $mod+Ctrl+s | sticky toggle | Toggles sticky mode on current window |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=scratchpad-sh)>>
#+END_SRC
*** Gaps management
:PROPERTIES:
:CUSTOM_ID: h-20c6fc10-984e-411c-acc9-8bc057d2aaa6
:END:
It is possible to dynamically change the gaps between containers if we want
to change a bit the appearance of i3. For that, we obviously have some
shortcuts.
#+NAME: gaps-resize-sh
| shortcut | command | what it does |
|-------------------+-----------------------------------------------+------------------------------|
| $mod+g | gaps inner current plus 5 | Increase the inner gap size |
| $mod+Shift+g | gaps inner current minus 5 | Decrease the inner gap size |
| $mod+Ctrl+g | gaps outer current plus 5 | Increase the outer gap size |
| $mod+Ctrl+Shift+g | gaps outer current minus 5 | Decrease the outer gap size |
| $mod+$alt+g | gaps inner all set 20; gaps outer all set -10 | Reset gaps |
Here is the corresponding configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=gaps-resize-sh)>>
#+END_SRC
** Launching software
:PROPERTIES:
:CUSTOM_ID: h-4839dab5-1cd3-450b-8fb9-2992dd0c4d22
:END:
A big part of my i3 shortcuts though are related to launching various
software. Ill try to sort them by category here, but do take a look even at
categories which you might not be interested in, they might actually have
something useful for you.
*** Software and command launcher
:PROPERTIES:
:CUSTOM_ID: h-c5e8b03a-a46d-4eef-b514-96794c42621d
:END:
These commands will allow the user to launch applications which provide
~.desktop~ files or user-defined ~.desktop~ files, as well as commands with
the help of rofi.
#+NAME: launcher-sh
| shortcut | command | what it does |
|--------------+---------------------------------------+-------------------------------------------------------|
| $mod+Shift+d | exec --no-startup-id j4-dmenu-desktop | Launch a registered application |
| $mod+d | exec --no-startup-id $rofiexec | Launch a terminal command or a registered application |
Here is the configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=launcher-sh)>>
#+END_SRC
*** Internet software
:PROPERTIES:
:CUSTOM_ID: h-e27be13a-4085-4f09-ae90-c48ceb1c4c6f
:END:
I have a couple of Internet-related software I can launch easily.
#+NAME: internet-sh
| shortcut | command | what it does |
|--------------+---------------------+-----------------------------|
| $mod+b | exec firefox | Launch browser |
| $mod+m | exec $gnus | Launch Gnus, my mail client |
| Ctrl+Shift+d | exec discord-canary | Launch Discord |
Hence this configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=internet-sh)>>
#+END_SRC
*** Screenshots
:PROPERTIES:
:CUSTOM_ID: h-3e87379d-8476-4d05-b756-b7ee68130390
:END:
A couple of shortcuts are available for taking screenshots.
#+NAME: screenshot-sh
| shortcut | command | what it does |
|-------------+-----------------------------------+----------------------------------------------------------|
| Print | exec --no-startup-id scrot | Takes a screenshot of the entire desktop |
| Ctrl+Print | exec --no-startup-id "scrot -s" | Takes a screenshot of a region or the selected window |
| Shift+Print | exec --no-startup-id "scrot -d 3" | takes a screenshot of the desktop three in three seconds |
This gives us this configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=screenshot-sh)>>
#+END_SRC
*** Screen brightness
:PROPERTIES:
:CUSTOM_ID: h-f583f796-c287-4e4f-a88a-205cc1837ff6
:END:
Here we have four commands for managing our screens brightness (this is
useful for laptops, not so much with desktops), and two of them are actually
duplicates of the other two in case a laptop doesnt have dedicated keys or
we are using a keyboard which doesnt provide them.
#+NAME: brightness-sh
| shortcut | command | what it does |
|-----------------------+------------------------+---------------------------------------|
| XF86MonBrightnessUp | exec xbacklight -inc 5 | Increase the brightness of the screen |
| $mod+$alt+Next | exec xbacklight -inc 5 | Increase the brightness of the screen |
| XF86MonBrightnessDown | exec xbacklight -dec 5 | Decrease the brightness of the screen |
| $mod+$alt+Prev | exec xbacklight -dec 5 | Decrease the brightness of the screen |
This gives us this configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=brightness-sh)>>
#+END_SRC
*** Media control
:PROPERTIES:
:CUSTOM_ID: h-4002e136-ffab-4819-ae93-1a72b9f995ae
:END:
Some shortcuts are dedicated to media control, especially when it comes to
controlling music. All of these media control shortcuts will be calls to
~mpc~ which will in turn send commands to ~mpd~, which is the music server I
use on my computers.
#+NAME: media-sh
| shortcut | command | what it does |
|---------------------------+--------------------+--------------------------------|
| XF86AudioNext | exec mpc next | Forward to the next track |
| $alt+XF86AudioRaiseVolume | exec mpc next | Forward to the next track |
| $mod+Next | exec mpc next | Forward to the next track |
| XF86AudioPrev | exec mpc prev | Backward to the previous track |
| $alt+XF86AudioLowerVolume | exec mpc prev | Backward to the previous track |
| $mod+Prior | exec mpc prev | Backward to the previous track |
| XF86AudioPlay | exec mpc toggle | Play or pause the music |
| $mod+p | exec mpc toggle | Play or pause the music |
| $mod+$alt+p | exec mpc stop | Completely stop the music |
| XF86AudioStop | exec mpc stop | Completely stop the music |
| $alt+XF86AudioPlay | exec mpc stop | Completely stop the music |
| $mod+$alt+7 | exec mpc volume +5 | Increase the volume from mpd |
| $mod+$alt+8 | exec mpc volume -5 | Decrease the volume from mpd |
We also have two shortcuts for launching ncmpcpp, my mpd frontend, either
with the playlist open by default, or the visualizes open.
#+NAME: ncmpcpp-sh
| shortcut | command | what it does |
|--------------+-----------------------------------+----------------------------------|
| $mod+Shift+n | exec $term ncmpcpp -q | Launch ncmpcpps playlist editor |
| $mod+Shift+v | exec $term ncmpcpp -qs visualizer | Launch ncmpcpps visualizer |
We also have more general shortcuts, like how to manipulate the general
volume level.
#+NAME: volume-sh
| shortcut | command | what it does |
|----------------------+----------------------------------------+----------------------|
| XF86AudioMute | exec "amixer set Master 1+ toggle" | Mute or unmute audio |
| Ctrl+$mod+Prior | exec "amixer -q set Master 2%+ unmute" | Raise volume |
| XF86AudioRaiseVolume | exec "amixer -q set Master 2%+ unmute" | Raise volume |
| Ctrl+$mod+Next | exec "amixer -q set Master 2%- unmute" | Reduce volume |
| XF86AudioLowerVolume | exec "amixer -q set Master 2%- unmute" | Reduce volume |
This gives us this configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=media-sh)>>
<<generate-shortcuts(table=ncmpcpp-sh)>>
<<generate-shortcuts(table=volume-sh)>>
#+END_SRC
*** Rofi utilities
:PROPERTIES:
:CUSTOM_ID: h-15f2639e-52d2-467e-83e2-6ab085fa7710
:END:
We also have some utilities Ive written and which are interfaced with rofi.
Here are said shortcuts.
#+NAME: rofi-sh
| shortcut | command | what it does |
|-------------------+-----------------------+-----------------------------------------------------------------------|
| $mod+Shift+p | exec rofi-pass --type | Types the selected password available from ~pass~ where the cursor is |
| $mod+Ctrl+Shift+p | exec rofi-pass | Copies in the clipboard the selected password from ~pass~ for 45 sec |
| $mod+Ctrl+m | exec rofi-mount | Volume mounting helper |
| $mod+Ctrl+u | exec rofi-umount | Volume unmounting helper |
| $mod+$alt+e | exec rofi-emoji | Emoji picker, copies it in the clipboard |
| $mod+w | exec wacom-setup | Sets my Wacom Bamboo tablet as being active on the selected screen |
| $mod+Shift+w | exec connect-wifi | Connect to an available WiFi network |
This gives us the following configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=rofi-sh)>>
#+END_SRC
*** Miscellaneous
:PROPERTIES:
:CUSTOM_ID: h-7f9ef1f7-da6b-4428-9d8c-f5a5f004c495
:END:
And last but not least, I have some other shortcuts for various software,
some of them which I use quite a lot like the shortcut for launching Emacs.
#+NAME: misc-sh
| shortcut | command | what it does |
|-------------+------------------+---------------------------------|
| $mod+e | exec $ec | Launch Emacs client |
| $mod+n | exec nemo | Launch Nemo (file manager) |
| $mod+$alt+c | exec speedcrunch | Launch Speedcrunch (calculator) |
| $mod+F3 | exec arandr | Launch arandr |
This gives us the following configuration:
#+BEGIN_SRC conf
<<generate-shortcuts(table=misc-sh)>>
#+END_SRC
*** Screen management
:PROPERTIES:
:CUSTOM_ID: h-ea5bab8e-cb7c-4ccb-8594-c2c319d1f7eb
:END:
Additionally, we have a shortcut for entering presentation mode on the
additional screen of the computer; on my main computer, Mila, the additional
screen is HDMI-1, while it is VGA1 on my travel laptop. Well use yadms
jinja2 syntax to manage that.
#+BEGIN_SRC conf
{% if YADM_HOSTNAME == 'Marpa' -%}
bindsym $mod+Ctrl+p xrandr --output HDMI-1 --mode 1024x768 --right-of eDP-1
{% else -%}
bindsym $mod+Ctrl+p xrandr --output VGA1 --mode 1024x768 --right-of LVDS1
{% endif -%}
#+END_SRC
* Software autolaunch
:PROPERTIES:
:CUSTOM_ID: h-18769c14-2ec0-41a2-9450-dae71714d0f4
:HEADER-ARGS: :exports code :noweb yes :tangle config##yadm.j2
:END:
When i3 is launched, I want it to also launch some software automatically.
Here is what we will launch:
#+NAME: autolaunch
| always execute it? | command | what it is |
|--------------------+----------------------------------------------------------+----------------------------------------|
| yes | wal -i "$(< "${HOME}/.cache/wal/wal")" | Sets the wallpaper from last session |
| no | xss-lock -- i3lock -fol | Launch power management |
| no | dunst -config ~/.config/dunst/dunstrc | Launch notification manager |
| no | xrdb $HOME/.Xresources | Load Xresources files |
| no | compton -F --opengl --config ~/.config/compton.conf -e 1 | Launch compton |
| yes | polybar-launch | Launch polybar |
| yes | enable_touch | Set correct touchpad values |
| no | syndaemon -i 1.0 -t -k | Set touchpad values |
| no | mpd | Launch music server |
| no | mpc stop | Stop music from mpd |
| no | mpd_discord_richpresence --no-idle --fork | Launch mpd status sharing with Discord |
| no | nm-applet | NetworkManager system tray |
#+NAME: generate-autolaunch
#+BEGIN_SRC python :exports none :tangle no :var table=autolaunch
results = ''
for line in table:
results += 'exec_always ' if line[0] == 'yes' else 'exec '
results += '--no-startup-id ' + line[1] + '\n'
return results
#+END_SRC
My travel laptop has a fingerprint reader which can be used as an
authentification method when the root password is asked. Lets launch our
policy kit manager if that is the case:
#+BEGIN_SRC conf
{% if YADM_HOSTNAME == 'Gampo' -%}
exec --no-startup-id /usr/lib/mate-polkit/polkit-mate-authentication-agent-1
{% endif -%}
<<generate-autolaunch()>>
#+END_SRC

View File

@@ -1,541 +0,0 @@
; -*- mode: conf-windows -*-
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
background = ${xrdb:color1:#50000000}
background-alt = ${xrdb:color2:#444}
foreground = ${xrdb:color7:#dfdfdf}
foreground-alt = ${xrdb:color6:#555}
primary = #ffb52a
secondary = #e60053
alert = #bd2c40
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[bar/bottom]
monitor= ${env:MONITOR}
bottom = true
width = 100%
height = 22
radius = 0.0
fixed-center = true
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 0
border-color = #00000000
padding-left = 2
padding-right = 4
locale=ja_JP.UTF-8
module-margin-left = 1
module-margin-right = 2
font-0 = fixed:pixelsize=8
font-1 = unifont:fontformat=truetype:size=6:antialias=false
font-2 = "Siji:pixelsize=8"
font-3 = "IPAMincho:style=regular:pixelsize=8"
modules-left = powermenu mpd
modules-center =
modules-right = filesystem wlan eth volume backlight-acpi cpu memory temperature custom-battery
tray-position = right
tray-padding = 0
tray-detached = false
tray-maxsize = 15
tray-background = ${colors.background}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[bar/top]
monitor= ${env:MONITOR}
bottom = false
width = 100%
height = 22
radius = 10.0
fixed-center = true
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 5
border-color = #00000000
padding-left = 2
padding-right = 4
locale=ja_JP.UTF-8
module-margin-left = 1
module-margin-right = 2
font-0 = fixed:pixelsize=8
font-1 = unifont:fontformat=truetype:size=6:antialias=false
font-2 = "Siji:pixelsize=8"
font-3 = "IPAMincho:style=regular:pixelsize=8"
modules-left = i3
modules-center = xwindow
modules-right = date
tray-position = none
tray-padding = 0
tray-detached = false
tray-maxsize = 15
tray-background = ${colors.background}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/custom-battery]
type = custom/script
exec = polybar-ab -polybar -thr 10
tail = true
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/xwindow]
type = internal/xwindow
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
format-underline = ${colors.secondary}
format-padding = 1
label = %title%
label-maxlen = 70
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format = <label-layout> <label-indicator>
format-prefix = " "
format-prefix-foreground = ${colors.foreground}
format-prefix-underline = ${colors.secondary}
format-underline = ${colors.secondary}
format-padding = 1
label-layout = %layout% %number%
label-layout-padding = 1
label-layout-underline = ${colors.secondary}
label-indicator = %name%
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/filesystem]
type = internal/fs
interval = 20
mount-0 = /
mount-1 = /home
format-mounted = <label-mounted>
label-mounted-underline = ${colors.secondary}
format-unmounted = <label-unmounted>
label-mounted =  %mountpoint%: %used%/%total% (%percentage_used%%)
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
label-mounted-foreground = ${colors.foreground}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/i3]
type = internal/i3
index-sort = true
enable-scroll = false
wrapping-scroll = false
strip-wsnumbers = false
pin-workspaces = true
fuzzy-match = true
label-focused = %icon%
label-focused-background = ${colors.background-alt}
label-focused-underline = ${xrdb:color8:#ffff00}
label-focused-padding = 2
label-unfocused = %icon%
label-unfocused-padding = 2
label-visible = %icon%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
label-urgent = %icon%
label-urgent-background = ${xrdb:color0:#bd2c40}
label-urgent-padding = 2
ws-icon-0 = 1;一
ws-icon-1 = 2;二
ws-icon-2 = 3;三
ws-icon-3 = 4;四
ws-icon-4 = 5;五
ws-icon-5 = 6;六
ws-icon-6 = 7;七
ws-icon-7 = 8;八
ws-icon-8 = 9;九
ws-icon-9 = 0;十
ws-icon-default = %index%
format = <label-state> <label-mode>
label-mode = %mode%
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.background-alt}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/mpd]
type = internal/mpd
label-song =  %title% - %artist%
label-song-maxlen = 50
label-song-ellipsis = true
label-offline =  mpd is offline
format-online = <icon-prev> <toggle> <icon-next> <label-song>
format-offline = <label-offline>
icon-prev = 
icon-stop = 
icon-play = 
icon-pause = 
icon-next = 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/cpu]
type = internal/cpu
interval = 2
format = <label> <ramp-coreload>
format-prefix = " "
format-underline = #f90000
label = %percentage%%
ramp-coreload-0 = ▁
ramp-coreload-1 = ▂
ramp-coreload-2 = ▃
ramp-coreload-3 = ▄
ramp-coreload-4 = ▅
ramp-coreload-5 = ▆
ramp-coreload-6 = ▇
ramp-coreload-7 = █
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/memory]
type = internal/memory
interval = 2
format = <label>
format-prefix = " "
format-underline = #4bffdc
label = %gb_used%
ramp-used-0 = ▁
ramp-used-1 = ▂
ramp-used-2 = ▃
ramp-used-3 = ▄
ramp-used-4 = ▅
ramp-used-5 = ▆
ramp-used-6 = ▇
ramp-used-7 = █
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/wlan]
type = internal/network
{% if YADM_HOSTNAME == 'Gampo' -%}
interface = wlp3s0
{% else -%}
interface = wlp8s0
{% endif -%}
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid%
format-disconnected =
format-disconnected-underline = ${self.format-connected-underline}
label-disconnected = wifi-none
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/eth]
type = internal/network
{% if YADM_HOSTNAME == 'Gampo' -%}
interface = enp0s25
{% else -%}
interface = enp9s0
{% endif -%}
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
label-connected = %local_ip%
format-disconnected =
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/date]
type = internal/date
interval = 1
date = %Y-%m-%d
date-alt = %A %d, %B
time = %H:%M:%S
time-alt = %H:%M:%S
format-prefix = 
format-underline = #0a6cf5
label = %date% %time%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/volume]
type = internal/alsa
format-volume = <label-volume>
format-volume-prefix = " "
format-volume-underline = #55aa55
label-volume = %percentage%%
format-muted-prefix = " "
label-muted = muted
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/xbacklight]
type = internal/xbacklight
format = <label>
label = %percentage%%
format-prefix = " "
format-underline = #9f78e1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/battery]
type = internal/battery
battery = BAT0
adapter = ACAD
full-at = 95
format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-underline = ${self.format-charging-underline}
; 0-10
ramp-capacity-0 = 
ramp-capacity-0-foreground = #f44336
; 11-20
ramp-capacity-1 = 
ramp-capacity-1-foreground = #ff9800
; 21-30
ramp-capacity-2 = 
ramp-capacity-2-foreground = #ffc107
; 31-40
ramp-capacity-3 = 
; 41-50
ramp-capacity-4 = 
; 51-60
ramp-capacity-5 = 
; 61-70
ramp-capacity-6 = 
; 71-80
ramp-capacity-7 = 
; 81-90
ramp-capacity-8 = 
; 91-100
ramp-capacity-9 = 
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-5 = 
animation-charging-6 = 
animation-charging-7 = 
animation-charging-8 = 
animation-charging-9 = 
animation-charging-framerate = 100
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = #f50a4d
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 = 
ramp-1 = 
ramp-2 = 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/powermenu]
type = custom/menu
format-spacing = 1
label-open = 
label-open-foreground = ${colors.secondary}
label-close =  cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = poweroff
menu-0-1-exec = menu-open-2
menu-0-2 = suspend
menu-0-2-exec = menu-open-3
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = reboot
menu-2-0 = poweroff
menu-2-0-exec = poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
menu-3-0 = suspend
menu-3-0-exec = "systemctl suspend"
menu-3-1 = cancel
menu-3-1-exec = menu-open-0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/pkg]
type = custom/script
interval = 1200
format = <label>
format-underline = #dc322f
label = "%output:0:30%"
exec = .config/polybar/pkg.sh
exec-if = "ping -q -w 3 -c 1 176.34.135.167 > /dev/null"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/mpv]
type = custom/script
exec = sh ~/.config/polybar/mpv.sh
exec-if = pgrep -x mpv
interval = 1
format = <label>
label = %output%
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[module/bluetooth]
type = custom/script
interval = 5
exec = ~/.config/polybar/bluetooth.sh
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[settings]
screenchange-reload = true
; compositing-background = xor
; compositing-background = over
; compositing-foreground = xor
; compositing-foreground = source
; compositing-border = over
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[global/wm]
margin-top = 5
margin-bottom = 5
; vim:ft=dosini

View File

@@ -70,8 +70,8 @@ bluez-utils bookworm boost bzip2 ccls chicken chromium clisp compton cppcheck \
cppreference cppreference-devhelp cpupower cronie cryptsetup device-mapper \
diffutils discord-canary discount ditaa dmenu dmenu-lpass docker \
docker-compose dockerfile-language-server-bin doxygen dunst dwarffortress \
emacs exfat-utils farbfeld feh ffmpegthumbnailer findutils firefox flake8 \
font-mathematica fontforge freeglut fzf gcc-libs gdb gimp glibc \
emacs exfat-utils farbfeld feh ffmpegthumbnailer findutils firefox \
flake8 font-mathematica fontforge freeglut fzf gcc-libs gdb gimp glibc \
gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts gnuplot go-tools \
golangci-lint-bin graphviz htop i3-gaps i3lock-blur i3status igdm-bin \
inetutils j4-dmenu-desktop javascript-typescript-langserver js-beautify \