Configuration of my Linux environment.
- Get started
- Tools
- Useful
- Change keyboard layout
- Search icons in system fonts
- Generate monitor profile
- Reconfigure powerlevel10k
- Disable underlining of the powerlevel10k zsh-syntax-highlighting plugin
- Show exit code in powerlevel10k
- Fix polybar brightness module on amd card
- Set polybar on multiple screens
- Remove absolute path from current working directory
- Change permissions on sys brightness permanently using udev
- Enter SSH passphrase once
- Bluetooth - a2dp-sink profile connect failed
- Changing i3 workspace monitors
- Developers
- Compatibility
- Disclaimer
- License
bash install.sh
to install a particular tool (e.g. ranger
):
bash install.sh -t ranger
get available tools:
$ bash install.sh -l
24 available tools:
- vscode
- conky
- i3lock
- alacritty
- picom
- bat
- polybar
- rofi
- ranger
- tmux
- i3
- fzf
- neovim
- dunst
- btop
- lsd
- nerd_font
- zsh
- lazydocker
- speedtest
- firefox
- bsnotifier
- lazygit
- w3m
to install a wallpaper:
bash install.sh -w
i3 is a tiling window manager:
shortcut | description |
---|---|
Win + u | hide borders |
Win + y | restore borders |
Win + n | change to "normal" border mode (show window title) |
Win + Shift + q | kill focused window |
Win + Enter | open Alacritty terminal emulator |
Win + d | open Rofi - Application and executable explorer |
Win + i | open Rofi - Application GUIs explorer |
Win + Escape | open Rofi - System menu: poweroff, sleep, etc. |
Win + Print | open flameshot - screenshot capturer |
Win + l | lock screen session |
Win + Left | focus left window |
Win + Right | focus right window |
Win + Down | focus down window |
Win + Up | focus up window |
Win + Shift + Left | move the focused window to left (also delete stacked layouts) |
Win + Shift + Right | move the focused window to right |
Win + Shift + Down | move the focused window to down |
Win + Shift + Up | move the focused window to up |
Win + Ctrl + Shift + Left | move the focused workspace to left |
Win + Ctrl + Shift + Right | move the focused workspace to right |
Win + Ctrl + Shift + Down | move the focused workspace to down |
Win + Ctrl + Shift + Up | move the focused workspace to up |
Win + b | workspace back and forth |
Win + Shift + b | move window to workspace back_and_forth |
Win + h | change split mode to "horizontal" |
Win + v | change split mode to "vertical" |
Win + f | toggle fullscreen mode for the focused window |
Win + s | change layout mode to "stacking" |
Win + w | change layout mode to "tabbed" |
Win + e | change layout mode to "toggle split" |
Win + Shift + Space | toggle tiling / floating |
Win + Space | change focus between tiling / floating windows |
Win + Shift + s | Sticky floating windows, even if you switch to another workspace |
Win + a | focus the parent window |
Win + Shift + Minus | move the currently focused window to the scratchpad |
Win + Shift | show the next scratchpad window or hide the focused scratchpad window. |
Win + Ctrl + Left | focus left workspace |
Win + Ctrl + Right | focus right workspace |
Win + Shift + c | reload the configuration file |
Win + Shift + r | restart i3 inplace |
Win + Shift + e | exit i3 |
Win + 0 | Set shut down, restart and locking features |
Win + r | enable resize windows mode |
Win + Shift + g | enable gap mode |
A modern version of i3lock with color functionality and other features (github).
shortcut | description |
---|---|
Win + l | lock screen session borders |
A window switcher, Application launcher and dmenu replacement (github).
shortcut | description |
---|---|
Win + d | open Rofi executables explorer |
shortcut | description |
---|---|
Win + i | open Rofi applications explorer |
shortcut | description |
---|---|
Win + Escape | open Rofi applications explorer |
Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.
shortcut | description |
---|---|
Alt + s | [navigation] Find and jump to word |
Alt + b | [navigation] Breadcrumb keyboard navigation |
Alt + f | [navigation] Find file |
Alt + g | [navigation] Find string |
Alt + \ | [navigation] Bracket matching |
Alt + d | [navigation] Go to definition |
Alt + , | [navigation] Go to back |
Alt + . | [navigation] Go to forward |
Ctrl + g | [navigation] Go to line/column |
Ctrl + n | [terminal] Create new terminal |
Ctrl + s | [terminal] Split terminal |
Ctrl + q | [terminal] Kill terminal |
Ctrl + j | [terminal] Focus previous terminal |
Ctrl + k | [terminal] Focus next terminal |
Ctrl + r | [editor] Rename |
Ctrl + $ | [editor] Move to end and select |
Alt + $ | [editor] Move to end |
Ctrl + _ | [editor] Move to home and select |
Alt + _ | [editor] Move to home |
Shift + Del | [editor] Delete line |
Ctrl + Shift + m | [editor] Display problems panel |
Ctrl + Shift + Space | [editor] Display problem diagnostic hover |
Ctrl + Space | [editor] Display suggestions |
Ctrl + 0 | [editor] Select sidebar |
Ctrl + b | [editor] If the editor is focused: toggle sidebar explorer view |
Ctrl + b | [editor] If the terminal is focused: focus previous editor group |
Ctrl + shift + b | [editor] Toggle and focus sidebar explorer view |
Alt + Shift + [Up,Down] | [editor] Mark select multi-line [Up,Down] |
Ctrl + Shift + [Up,Down] | [editor] Move lines [Up,Down] |
Ctrl + [Up,Down] | [editor] Scroll to [Up,Down] |
Alt + [Left,Right,Up,Down] | [split] Focus [Left,Right,Up,Down] group and side bar (circularly) |
Alt + Up | [split] If the terminal is focused: focus previous group |
Ctrl + Alt + [Left,Right,Up,Down] | [split] Move to [Left,Right,Up,Down] group |
Ctrl + Alt + Shift + [Left,Right,Up,Down] | [split] Resize group view width |
Ctrl + Alt + f | [split] Full screen selected group |
Ctrl + m | [preview] Open markdown preview on the Side |
Ctrl + Enter | [explorer] Open file in split view |
My Neovim configuration: github
tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached. (github).
shortcut | description |
---|---|
tmux | start new |
tmux new -s [NAME] | start new with session name |
tmux a | attach |
tmux a -t [NAME] | attach to named |
tmux ls | list sessions |
tmux kill-session -t [NAME] | kill session |
tmux kill-server | kill server (restart configurations) |
Alt + c | enable copy/scroll mode (exit: "q") |
[Ctrl + b] + Ctrl + s | save tmux state (tmux-resurrect) |
[Ctrl + b] + Ctrl + r | restore tmux state (tmux-resurrect) |
[Ctrl + b] + I | fetch plugins - update plugins |
Alt + n | create window |
Alt + Tab | next window |
Alt + Left | select left pane |
Alt + Right | select right pane |
Alt + Up | select up pane |
Alt + Down | select down pane |
Alt + Shift + Left | split left pane |
Alt + Shift + Right | split right pane |
Alt + Shift + Up | split up pane |
Alt + Shift + Down | split down pane |
Alt + z | Zoom current pane |
Alt + 4 | resize pane to left |
Alt + 6 | resize pane to right |
Alt + 8 | resize pane to up |
Alt + 2 | resize pane to down |
[Ctrl + b] s | list sessions |
[Ctrl + b] c | create window |
[Ctrl + b] w | list windows |
[Ctrl + b] n | next window |
[Ctrl + b] p | previous window |
[Ctrl + b] f | find window |
[Ctrl + b] , | rename window |
[Ctrl + b] & | kill window |
[Ctrl + b] % | vertical split |
[Ctrl + b] " | horizontal split |
[Ctrl + b] o | swap panes |
[Ctrl + b] q | show pane numbers |
[Ctrl + b] x | kill pane |
[Ctrl + b] d | detach tmux |
fzf is a general-purpose command-line fuzzy finder (github).
shortcut | description |
---|---|
Ctrl + r | find in history from terminal |
Ctrl + t | find path from terminal |
A VIM-inspired file manager for the console (github).
shortcut | description |
---|---|
Win + e | open ranger as explorer |
f | find file (using fzf) |
e | open file/folder with an external application |
i | display file (preview) |
yp | copy path of the selected file/folder |
Shift + s | open shell on current directory |
F2 | rename selected file/directory |
yy | copy selected file/directory |
pp | paste selected file/directory |
dD | delete selected file/directory |
Alt + j | scroll preview down |
Alt + k | scroll preview up |
Ctrl + r | reset |
Shift + w | display logs |
g + n | create new tab |
g + c | close tab |
:mkdir | create directory |
:touch | create file |
Open digital clock in terminal.
tty-clock -ct -f "%H:%M, %d %b %Y"
Simple screen recorder with an easy to use interface (github):
peek
Powerful yet simple to use screenshot software (github).
VLC command-line.
shortcut | description |
---|---|
h,H | Show/Hide help box |
P | Show/Hide playlist box |
B | Show/Hide filebrowser |
q, Q, Esc | Quit |
s | Stop |
Pause/Play | |
n, p | Next/Previous playlist item |
, | Seek -/+ 1% |
a, z | Volume Up/Down |
m | Mute |
# change to Español latam
setxkbmap -layout latam
# change to English US
setxkbmap -layout us
# chante to English US and select compose key
setxkbmap -layout us -option compose:ralt
To make this configuration permanent you can add "setxkbmap -layout latam" to ~/.config/i3/config
or use another
autostart configuration file.
# Autostart applications
exec_always --no-startup-id setxkbmap -layout latam
sudo apt install gucharmap
gucharmap
arandr
Relocate the monitors and save the profile "Layout -> Save as" (bash file). You can generate multiple profiles for different situations (home, office, etc.).
p10k configure
Add the following to your .zshrc
:
(( ${+ZSH_HIGHLIGHT_STYLES} )) || typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[path]=none
ZSH_HIGHLIGHT_STYLES[path_prefix]=none
To show fail exit code change value to true
in ~/.p10k.zsh
file.
typeset -g POWERLEVEL9K_STATUS_ERROR=true
To show success exit code change value to true
in ~/.p10k.zsh
file.
typeset -g POWERLEVEL9K_STATUS_OK=true
-
get card name:
$ ls -1 /sys/class/backlight/ amdgpu_bl0
-
update polybar configuration file:
# file: ~/.config/polybar/config # card = intel_backlight card = amdgpu_bl0
-
restart polybar
pkill polybar && polybar i3wmthemer_bar &
-
[optional] if permission denied
sudo chmod a+rw /sys/class/backlight/$(ls /sys/class/backlight/ | head -n 1)/brightness
-
Create a polybar launcher script:
# launch_polybar.sh if type "xrandr"; then for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do MONITOR=$m polybar --reload i3wmthemer_bar & done else polybar --reload i3wmthemer_bar & fi
-
Edit the polybar config file (
~/.config/polybar/config
):[bar/i3wmthemer_bar] monitor = ${env:MONITOR:} ...
-
Kill current polybar:
sudo pkill polybar
-
Run script:
bash launch_polybar.sh
Edit ~/.p10k.zsh
, search for POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER
and change its value to first
:
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=first
-
Add your user to
video
group:sudo usermod -a -G video <YOUR_USERNAME>
-
Get your video system kernel (
YOUR_KERNEL
) running this command:# get <YOUR_KERNEL> ls /sys/class/backlight/ | head -n 1
-
Create/edit
/etc/udev/rules.d/backlight.rules
file:ACTION=="change", SUBSYSTEM=="backlight", KERNEL=="<YOUR_KERNEL>", RUN+="/usr/bin/chgrp video /sys/class/backlight/%k/brightness" ACTION=="change", SUBSYSTEM=="backlight", KERNEL=="<YOUR_KERNEL>", RUN+="/usr/bin/chmod g+w /sys/class/backlight/%k/brightness"
-
restart your system.
-
Install dependencies:
sudo apt install keychain
-
Configure git, create/edit
~/.ssh/config
file (YOUR_REMOTE_HOST
example: "github.com", andYOUR_SSH_KEY
example: "~/.ssh/id_rsa"):Host <YOUR_REMOTE_HOST> IgnoreUnknown UseKeychain UseKeychain yes AddKeysToAgent yes IdentityFile <YOUR_SSH_KEY>
Example with multiple hosts:
IgnoreUnknown UseKeychain host * Usekeychain yes Addkeystoagent yes Host github.com IdentityFile ~/.ssh/github Host <COMPANY_HOST> IdentityFile ~/.ssh/git_company Port <COMPANY_PORT>
-
Change git config file mode:
chmod 644 ~/.ssh/config
-
Add keychain to profile file (example:
~/.zshrc
,~/.bashrc
, etc.)... eval $(keychain -q --noask --eval id_rsa)
When I try to connect to any headphone, blueman throws:
blueman.bluez.errors.DBusFailedError: Protocol not available.
In logs there are pretty similar errors:
... bluetoothd[000]: a2dp-sink profile connect failed for 00:00:00:00:00
To solve it, follow these steps:
-
Run the following commands:
sudo apt-get install pulseaudio-module-bluetooth
-
Adding the
module-bluez5-discover
at the end of the pulseaudio/etc/pulse/default.pa config
:load-module module-bluez5-discover
-
Run the following commands:
sudo killall pulseaudio pulseaudio --start sudo systemctl restart bluetooth
To set workspace 1
on the HDMI-2
monitor add this line to ~/.config/i3/config
:
workspace 1 output HDMI-2
To set workspace 2
on the DP-1
monitor add this line to ~/.config/i3/config
:
workspace 2 output DP-1
These are the linters that will help us to follow good practices and style guides of our source code. We will be using the following static analysis tools, which will be executed when generating a new commit in the repository (git hooks).
pip install -r requirements_dev.txt
sudo apt install shellcheck
After cloning the repository run the following command in the repository root:
git config core.hooksPath .githooks
Tools used:
-
brunette: A best practice Python code formatter.
-
isort: Python utility / library to sort imports alphabetically, and automatically separated into sections and by type.
-
prospector: Prospector is a tool to analyze Python code and output information about errors, potential problems, convention violations and complexity.
Tools executed by Prospector:
- pylint: Pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.
- bandit: Bandit is a tool designed to find common security issues.
- dodgy: It is a series of simple regular expressions designed to detect things such as accidental SCM diff checkins, or passwords or secret keys hard coded into files.
- mccabe: Complexity checker.
- mypy: Mypy is an optional static type checker for Python.
- pydocstyle: pydocstyle is a static analysis tool for checking compliance with Python PEP 257.
- pycodestyle: pycodestyle is a tool to check your Python code against some of the style conventions in PEP 8.
- pyflakes: Pyflakes analyzes programs and detects various errors.
- pyroma: Pyroma is a product aimed at giving a rating of how well a Python project complies with the best practices of the Python packaging ecosystem, primarily PyPI, pip, Distribute etc, as well as a list of issues that could be improved.
- Only tested on Ubuntu 23.04
I am not responsible for any harm done to your PC by anything in the repository. Use everything with caution!