If you don’t have an US Keyboard Layout, you need to edit the .xinitrc configuration file, vim .xinitrc:
setxkbmap -layout 'es,es' -model pc105
where you are using setxkbmap (sets the keyboard layout).
Window managers are responsible for the placement and appearance of all windows. Some examples are: i3, Awesome WM, XMonad, etc.
Install some packages: sudo apt install xorg i3 i3blocks fonts-font-awesome suckless-tools picom nitrogen
Logout and select the i3 as the window manager.
Whey you log in for the first time, you are then prompted on whether to: auto-generate an i3 configuration file (~/.config/i3/config) or use the default configuration file. Press Enter to generate an i3 configuration file. Next, you need to define the i3 modifier key ($mod). You can use the Windows (Super) key or the Alt key. Press Enter to use the Windows key.
Open a terminal: $mod + ENTER. Open more than one terminal and you will notice that i3 automatically tiles them to occupy all available space. You may want to use Mod + v to split them vertically or Mod + h to split them horizontally. You can launch applications with dmenu: $mod + d. You could enter a fullscreen mode (on and off): $mod + f; close an application window with $mod + Shift + q; restart i3: $mod + Shift + r; exit i3: $mod + Shift + e; switch to workspace n: $mod + n; move focused windows to workspace n: $mod + Shift + n. Check i3 - Reference Card.
Install Pop GTK and Material theme, Pop and Papirus icon themes, and lxappearance (a program to change GTK+ themes, icon themes, and fonts): sudo apt install pop-gtk-theme materia-gtk-theme pop-icon-theme papirus-icon-theme lxappearance. Launch it and select in Widget & Icon Theme (Pop) and Default font (Ubuntu, 12).
gedit ~/.config/i3/config (you can always find any issues with your config with i3 -C -c ~/.config/i3/config)
# Windows modkey
set $mod Mod4
# Font for window titles. Will also be used by the bar
font pango:Ubuntu Regular 14
set $myTerm kitty
bindsym $mod+Return exec $myTerm # Launch terminal
bindsym $mod+Shift+x exec i3lock -c 000000 # Lock the system
bindsym $mod+b exec pavucontrol # Launch PulseAudio Volume Control
playerctl is a programme that provides access to media players from the command line: play, pause, previous, etc.
bindsym $mod+Shift+F1 exec playerctl play-pause # Media player controls.
bindsym $mod+Shift+F5 exec playerctl pause
bindsym $mod+Shift+F6 exec playerctl previous
bindsym $mod+Shift+F7 exec playerctl next
bindsym $mod+Shift+F3 exec pactl set-sink-volume @[email protected] +6% # We use pactl to adjust volume in PulseAudio. It controls the volume for the default sink -active audio stream-: increase volume, decrease volume, and mute.
bindsym $mod+Shift+F2 exec pactl set-sink-volume @[email protected] -5%
bindsym $mod+Shift+F4 exec pactl set-sink-mute @[email protected] toggle
pactl is a command-line utility to issue control commands to the PulseAudio sound server.
You may want to change the default sink: (switch between speakers and headphones)
pacmd list-sinks | grep -e 'name:' -e 'index:'
It returns:
index: 1
name: <alsa_output.pci-0000_00_1f.3.iec958-stereo> # Headphones
* index: 5
name: <alsa_output.pci-0000_01_00.1.hdmi-stereo> # Speakers are the default sink
Edit sudo vim /etc/pulse/default.pa: and add the following line:
set-defaults-sink alsa_output.pci-0000_01_00.1.hdmi-stereo
Finally, we need to restart PulseAudio: systemctl –user restart pulseaudio.socket
Let’s use Rofi, a program launcher, instead of dmenu.
bindsym $mod+d exec rofi -show run
bindsym $mod+Shift+d exec rofi -show p -modi p:$HOME/.local/bin/rofi-power-menu -theme Paper -font "JetBrains Mono NF 16" -width 20 -lines 6
bindsym --release $mod+z exec scrot -s ~/Dropbox/%b%d::%H%M%S.png # Take screenshots and save them on Dropbox. It uses scrot, a minimalist command-line screen capturing application.
# It turns your conky on/off with a keyboard shortcut
bindsym $mod+Shift+t exec /home/nmaximo7/.local/bin/[conkytoggle.sh](https://gist.github.com/discomplex/8350538) (if pgrep conky; then pkill conky; else conky; fi)
# Define names for default workspaces for which we configure key bindings later on.
set $ws1 "1: Terminal"
set $ws2 "2: Brave"
set $ws3 "3: Code"
set $ws4 "4: Knowledge"
set $ws5 "5: Nautilus"
set $ws6 "6: Utils"
bindsym $mod+F1 exec brave
bindsym $mod+F2 exec code
bindsym $mod+F3 exec nautilus
bindsym $mod+F4 exec keepassxc
bindsym $mod+F5 exec --no-startup-id gedit ~/.config/i3/config
# Forcing apps on workspaces. xprop is a property displayer for X. Type xprop in a terminal, click on the window that you want to get some information (e.g. the popular Google browser), and it will return a lot of information among which: WM_CLASS(STRING) = "google-chrome", "Google-chrome"
for_window [class="Brave-browser"] move to workspace $ws2
for_window [class="Code"] move to workspace $ws3
for_window [class="Gedit"] move to workspace $ws3
for_window [class="Org.gnome.Nautilus"] move to workspace $ws5
for_window [class="Alacritty"] move to workspace $ws4
for_window [class="kitty"] move to workspace $ws1
for_window [class="KeePassXC"] move to workspace $w6
# Color config
set $bgcolor #3F8AC2
set $ibgcolor #424242
set $textcolor #ffffff
set $ubgcolor #ff0000
# Window colors
client.focused $bgcolor $bgcolor $textcolor $bgcolor
client.unfocused $ibgcolor $ibgcolor $textcolor $ibgcolor
client.focused_inactive $ibgcolor $ibgcolor $textcolor $ibgcolor
client.urgent $ubgcolor $ubgcolor $textcolor $ubgcolor
# i3wm bar
bar {
status_command i3status -c ~/.config/i3status/i3status.conf
colors {
background $bgcolor
separator #292929
focused_workspace $bgcolor $bgcolor $textcolor
inactive_workspace $ibgcolor $ibgcolor $textcolor
urgent_workspace $bgcolor $bgcolor $textcolor
}
}
# Apps on start
exec --no-startup-id nm-applet # _Network Manager Applet_
exec --no-startup-id start-pulseaudio-x11 # It _starts PulseAudio server_
exec /usr/bin/barrierc -f --no-tray --debug INFO --name myarch [192.168.1.40]:24800 &
exec_always dropbox start -i
exec_always picom -f
exec_always nitrogen --set-zoom-fill --random ~/Pictures/wallpapers
exec_always --no-startup-id conky
exec_always --no-startup-id copyq
Status bar: mkdir .config/i3status && sudo cp /etc/i3status.conf ~/.config/i3status/i3status.conf && sudo chown myUser:myUser i3status.conf
Conky is a system monitoring program for Linux. nvim .config/conky/conky.conf
--[[
##################################
## dracula-01.conkyrc (i3) ##
################################## ]] It is based on [DT's conky configuration](https://gitlab.com/dwt1/dotfiles).
conky.config = {
--Various settings
background = true, -- forked to background
cpu_avg_samples = 2, - The number of samples to average for CPU monitoring.
diskio_avg_samples = 10, -- The number of samples to average for disk I/O monitoring.
double_buffer = true, -- Use the Xdbe extension? (eliminates flicker)
if_up_strictness = 'address', -- how strict if testing interface is up - up, link or address
net_avg_samples = 2, -- The number of samples to average for net data
no_buffers = true, -- Subtract (file system) buffers from used memory?
temperature_unit = 'fahrenheit', -- fahrenheit or celsius
text_buffer_size = 2048, -- size of buffer for display of content of large variables - default 256
update_interval = 1, -- update interval
imlib_cache_size = 0, -- disable image cache to get a new spotify cover per song
-- Placement (For SINGLE monitor users!)
alignment = 'top_right', -- top_left, top_middle, top_right, etc.
gap_x = 50, -- pixels between right or left border
gap_y = 70, -- pixels between bottom or left border
-- Size
minimum_height = 200, -- minimum height of window
minimum_width = 260, -- minimum width of window
maximum_width = 260, -- maximum width of window
--Graphical
border_inner_margin = 5, -- margin between border and text border_outer_margin = 5, -- margin between border and edge of window border_width = 0, -- border width in pixels
default_bar_width = 260, -- default is 0 - full width
default_bar_height = 10, -- default is 6
default_gauge_height = 25, -- default is 25
default_gauge_width =40, -- default is 40
default_graph_height = 40, -- default is 25
default_graph_width = 153, -- default is 0 - full width
default_shade_color = '#000000',-- default shading colour
default_outline_color = '#000000', -- default outline colour
draw_borders = false, -- draw borders around text
draw_graph_borders = true, -- draw borders around graphs
draw_shades = false, -- draw shades
draw_outline = false, -- draw outline
stippled_borders = 0, -- dashing the border
--Textual
format_human_readable = true, -- KiB, MiB rather then number of bytes
font = 'Source Code Pro:bold:size=15', -- the default font used
font2 = 'Raleway:bold:size=30', -- font for the time
font3 = 'Ubuntu:size=14', -- font for the date
font4 = 'Raleway:bold:size=9', -- font for the keybindings heading
max_text_width = 0, -- 0 will make sure line does not get broken if width too smal
max_user_text = 16384, -- max text in conky default 16384
override_utf8_locale = true, -- force UTF8 requires xft
short_units = true, -- shorten units from KiB to k
top_name_width = 21, -- width for $top name value default 15
top_name_verbose = false, -- If true, top name shows the full command line of each process - Default value is false.
uppercase = false, -- uppercase or not
use_spacer = 'none', -- adds spaces around certain objects to align - default none
use_xft = true, -- xft font - anti-aliased font
xftalpha = 1, -- alpha of the xft font - between 0-1
--Windows
own_window = true, -- create your own window to draw
own_window_argb_value = 255, -- real transparency - composite manager required 0-255 own_window_argb_visual = true, -- use ARGB - composite manager required
own_window_class = 'Conky', -- manually set the WM_CLASS name for use with xprop
own_window_colour = '#282a36', -- set colour if own_window_transparent no own_window_transparent = false, -- if own_window_argb_visual is true sets background opacity 0%
own_window_title = 'xmonad_conky',-- set the name manually
own_window_type = 'desktop', -- if own_window true options are: normal/override/dock/desktop/panel
own_window_hints = 'undecorated,below,above,sticky,skip_taskbar,skip_pager', -- if own_window true - just hints - own_window_type sets it
--Colors (Dracula)
color0 = '#bd93f9',
color1 = '#f8f8f2',
color2 = '#8be9fd',
color2 = '#8be9fd',
color3 = '#50fa7b',
};
conky.text = [[
${alignc}${color0}${font2}${time %H:%M}${font}
${voffset 6}${alignc}${color0}${font3}${time %b %d, %Y}${font}${color}
${voffset 18}${goto 12}${color3}CPU${goto 50}$cpu%
${color2}${goto 12}${cpubar 8,254}
${voffset 5}${goto 12}$font${color1}${top name 1}$alignr$color${top cpu 1}%
${goto 12}${color1}${top name 2}$alignr$color${top cpu 2}%
${goto 12}${color1}${top name 3}$alignr$color${top cpu 3}%
${voffset 14}${goto 12}${color3}RAM${goto 50}$mem/$memmax
${color2}${goto 12}${membar 8,254}${color}
${goto 12}${voffset 5}${color1}${top_mem name 1}$alignr$color${top_mem mem_res 1}
${goto 12}${color1}${top_mem name 2}$alignr$color${top_mem mem_res 2}
${goto 12}${color1}${top_mem name 3}$alignr$color${top_mem mem_res 3}
${color5}${font Roboto:size=10}${voffset 2}S Y S T E M ${hr 2}${font}${color}
${color2}${voffset 8}Hostname:${color}${alignr}${nodename}
${color2}Distro:${color}${alignr}$sysname ${alignr}${execi 6000 lsb_release -a | grep 'Description'|awk {'print $2 $3'}}
${color2}Kernel:${color}${alignr}${exec uname} ${exec uname -r}
${color2}Nvidia:${color}${alignr}${execp nvidia-smi --query-supported-clocks=gpu_name --format=csv,noheader}
${color2}IP Address:${color}${alignr}${addrs enp5s0}/${execi 1000 wget -q -O- http://ipecho.net/plain; echo}
We need to use ip link show to show the state of all network interfaces on the system. I have two network interfaces: enp5s0 (a wired ethernet adapter) and wlan0 (a wireless network adapter) on my Linux. Observe that wget -q -O- http://ipecho.net/plain returns my external public IP address.
${color2}Eth Up:${color} ${alignr}${offset -10$}${upspeed enp5s0}${alignr}${upspeedgraph enp5s0 8,100}
${color2}Eth Down:${color} ${alignr}${offset -10$}${downspeed enp5s0}${alignr}${downspeedgraph enp5s0 8,100}
${color2}File system:${color} ${alignr}${fs_used /} / ${fs_size /} $alignr${fs_used_perc /}%
${voffset 18}${color1}${alignc}${font4}i3 KEYBINDINGS${font}${color}
${color1}${hr}${color}
${color1}[S]+[RET]${alignr}${color2}open terminal${color}
${color1}[S]+[D]${alignr}${color2}launch rofi${color}
${color1}[S]+[SHIFT]+d${alignr}${color2}rofi power menu${color}
${color1}[S]+hjkl${alignr}${color2}move win focus${color}
${color1}[S]+[SHIFT]+jklñ${alignr}${color2}move focused window${color}
${color1}[S]+[1-9]${alignr}${color2}switch workspace${color}
${color1}[S]+[SHIFT]+[1-9]${alignr}${color2}send window${color}
${color1}[S]+[SHIFT]+q${alignr}${color2}kill focused windows${color}
${color1}${hr}${color}
${color1}[S]+[SHIFT]+c${alignr}${color2}reload config file${color}
${color1}[S]+[SHIFT]+r${alignr}${color2}restart i3${color}
${color1}[S]+[SHIFT]+h${alignr}${color2}my Knowledge system${color}
${color1}[S]+[SHIFT]+t${alignr}${color2}toggle Conky${color}
${color1}[S]+F1, F2, F3${alignr}${color2}Brave, code, Nautilus${color}
${color1}[S]+F4, F5${alignr}${color2}keepassxc, edit i3 config${color}
${color1}[S]+z, v${alignr}${color2}take a screenshot${color}
${color1}${hr}${color}
${color1}[S]+h${alignr}${color2}split in horizontal orientation${color}
${color1}[S]+v${alignr}${color2}split in vertical orientation${color}
${color1}[S]+f${alignr}${color2}enter fullscreen mode${color}
${color1}[S]+s,w,e${alignr}${color2}change container layout${color}
${color1}[S]+[SHIFT]+space${alignr}${color2}togle tiling/floating${color}
${color1}${hr}${color}
${color1}Vim: v/V${alignr}${color2}select characters/lines
${color1}d/y "+y${alignr}${color2}cut/copy
${color1}P/p "+p${alignr}${color2}paste before/after cursor
#------------+
# Weather |
#------------+
${color orange}${voffset 2}${hr 1}
${font Dejavu Sans Mono:size=12}${alignc War}${color green}${execpi 300 curl wttr.in/Málaga?T0 --silent --max-time 3}${font ubuntu:size=10.5}
]];
-- We need this library to startup programs.
import XMonad.Util.SpawnOnce
-- We need this libraries to run xmobar
import XMonad.Util.Run
import XMonad.Hooks.ManageDocks
-- The preferred terminal program
myTerminal = "kitty"
-- Width of the window border in pixels.
myBorderWidth = 2
-- modMask lets you specify which modkey you want to use: mod4Mask is the "windows key".
myModMask = mod4Mask
-- Key bindings
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
-- launch a terminal: Super + Shift + Enter
[ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
-- launch dmenu: Super + p
, ((modm, xK_p), spawn "dmenu_run")
-- Restart xmonad: Super + q.
, ((modm, xK_q), spawn "xmonad --recompile; xmonad --restart")
-- You can toggle the layout mode with mod-space, which will cycle through the available modes and switch to workspace N with mod-N (N=1, 2, etc.) The default tiling algorithm partitions the screen into two panes: on the left, a single window (master), on the right, tabbed windows occupying all the pane.
-- We add avoidStruts layout modifier to our layout to prevent windows from overlapping our xmobar.
myLayout = avoidStruts (tiled ||| Mirror tiled ||| Full)
-- Startup hook
myStartupHook = do
spawnOnce "nitrogen --set-zoom-fill --random ~/wallpapers"
spawnOnce "picom -b"
spawnOnce "barrier"
spawnOnce "dropbox"
-- Run xmonad with xmobar
main = do
xmproc <- spawnPipe "xmobar -x 0 /home/myUser/.config/xmobar/xmobar.config"
-- We change "xmonad defaults" for this code so XMonad.Hooks.ManageDocks could automatically manage xmobar.
xmonad $ docks defaults
-- personal variables
terminal = "kitty"
editor = os.getenv("EDITOR") or "nvim"
-- Default modkey. Mod4 is the "special" key (the Windows key)
modkey = "Mod4"
-- Windows are organized following a desired layout. The tiling layout consists of two columns: one for the master window and the other for the "non-master" windows. There is only one master window occupying half of the screen, while all other non-master windows are stacked vertically.
awful.layout.layouts = {
awful.layout.suit.tile,
}
[...]-- Remove title bars.
{ rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = false }
},[...]
-- Personal keybindings
-- Dmenu
awful.key({ modkey }, "r", function () awful.util.spawn("dmenu_run") end,
{description = "Dmenu", group = "launcher"}),
-- Google Chrome
awful.key({ modkey }, "c", function () awful.util.spawn("google-chrome") end,
{description = "Open Google Chrome", group = "launcher"}),
-- Station
awful.key({ modkey }, "b", function () awful.util.spawn( terminal.." -e /home/myUser/Applications/Station.AppImage") end,
{description = "Open Station", group = "launcher"}),
beautiful.useless_gap = 5 --The gap or padding between clients.
-- Autostart
awful.spawn.with_shell("barrierc")
awful.spawn.with_shell("dropbox")
-- Nitrogen is a fast and lightweight background browser and setter**. Pick up wallpapers from Derek Taylor: git clone https://gitlab.com/dwt1/wallpapers.git. With the --random option, Nitrogen chooses random backgrounds from the ~/wallpapers directory
awful.spawn.with_shell("nitrogen --set-zoom-fill --random ~/wallpapers")
-- We use picom as compositor. You could edit ~/.config/kitty/kitty.conf, and add the line: _background_opacity 0.9_; so you can get transparency in the terminal.
awful.spawn.with_shell("picom -b")
-- Rofi
awful.key({ modkey }, "r", function () awful.util.spawn("rofi -show run") end,
{description = "Dmenu", group = "launcher"}),
Display managers provide a nice graphical interface for logging into your Linux desktop. After you log in to a GUI desktop, the display manager turns control over to the window manager. A few examples are gdm, gdm3, lightdm, and kdm.
Ubuntu ships with GDM3 as a display manager: cat /etc/X11/default-display-manager returns /usr/sbin/gdm3. You can easily install lightdm: sudo apt install lightdm lightdm-gtk-greeter, and switch to lightdm with: sudo dpkg-reconfigure gdm3.
Enable autologin in LighDM. 1. (Arch only) Add your user to the autologin group: sudo groupadd -r autologin, sudo gpasswd -a yourUserName autologin 2. sudo vim /etc/lightdm/lightdm.conf, uncomment the lines by removing the “#” in front of each line:
[Seat:*]
autologin-guest=false
autologin-user=yourUserName
autologin-user-timeout=0
Linux shells are interactive interfaces that allow users to interact with the Operating System by executing commands and utilities.
export PATH=$HOME/bin:/usr/local/bin:$PATH
export EDITOR=/usr/bin/nvim
# Path to your oh-my-zsh installation.
export ZSH="/home/nmaximo7/.oh-my-zsh"
# Set name of the theme to load
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="agnoster"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
plugins=(git)
# colored-man-pages: adds colors to man pages
# chucknorris: Chuck Norris fortunes plugin for oh-my-zsh. It adds two commands: chuck and chuck_cow.
# colorize: it will syntax-highlight the content of a file based on the filename extension. Requirements: pip install Pygments. Use: ccat file, cless file
# emoji: Support for Unicode emoji. Use: echo $emoji[mouse_face]
# z: Tracks your most used directories and z will take you to the most frequent directories. Use: z myFolder, cd to the most frequent directory matching myFolder. z -l myFolder, list all dirs matching myFolder (by frequency)
# zsh-syntax-highlighting. It provides syntax highlighting for the shell zsh. Installation: git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
plugins=(zsh-autosuggestions colored-man-pages chucknorris colorize emoji z zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# Examples aliases
# open ~/.zshrc with the default editor specified in $EDITOR
alias ezsh="$EDITOR $HOME/.zshrc"
# source ~/.zshrc
alias szsh="source $HOME/.zshrc"
# Create a folder and move into it in one command
function mkcd() { mkdir -p "[email protected]" && cd "$_"; }
neofetch
# Aliases
alias efish 'vim ~/.config/fish/config.fish'
alias evim 'vim ~/.vimrc'
alias cat 'bat'
alias rfish 'source ~/.config/fish/config.fish'
alias tobash="sudo chsh $USER -s /bin/bash && echo 'Now log out.'"
function fish_greeting
fortune | cowsay
end
# PROMPT: https://fishshell.com/docs/current/cmds/fish_prompt.html
function fish_prompt -d "Write out the prompt"
# This shows up as [email protected] /home/user/ >, with the directory colored
# $USER and $hostname are set by fish, so you can just use them
# instead of using `whoami` and `hostname`
printf '%[email protected]%s %s%s%s > ' $USER $hostname \
(set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end