Skip to content

Instantly share code, notes, and snippets.

@pmcfernandes
Last active December 17, 2023 23:32
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmcfernandes/871f663307b82f119f967599041ef5db to your computer and use it in GitHub Desktop.
Save pmcfernandes/871f663307b82f119f967599041ef5db to your computer and use it in GitHub Desktop.
Install i3 in Debian Minimal Distro
!! Colorscheme
! special
*.foreground: #93a1a1
*.background: #141c21
*.cursorColor: #afbfbf
! black
*.color0: #263640
*.color8: #4a697d
! red
*.color1: #d12f2c
*.color9: #fa3935
! green
*.color2: #819400
*.color10: #a4bd00
! yellow
*.color3: #b08500
*.color11: #d9a400
! blue
*.color4: #2587cc
*.color12: #2ca2f5
! magenta
*.color5: #696ebf
*.color13: #8086e8
! cyan
*.color6: #289c93
*.color14: #33c5ba
! white
*.color7: #bfbaac
*.color15: #fdf6e3
!! URxvt Appearance
URxvt.font: -*-rissole-*
URxvt.boldFont: -*-rissole-*
URxvt.italicFont: -*-rissole-*
URxvt.boldItalicfont: -*-rissole-*
URxvt.letterSpace: 0
URxvt.lineSpace: 0
URxvt.geometry: 92x24
URxvt.internalBorder: 24
URxvt.cursorBlink: true
URxvt.cursorUnderline: false
URxvt.saveline: 2048
URxvt.scrollBar: false
URxvt.scrollBar_right: false
URxvt.urgentOnBell: true
URxvt.depth: 24
URxvt.iso14755: false
!! Common Keybinds for Navigations
URxvt.keysym.Shift-Up: command:\033]720;1\007
URxvt.keysym.Shift-Down: command:\033]721;1\007
URxvt.keysym.Control-Up: \033[1;5A
URxvt.keysym.Control-Down: \033[1;5B
URxvt.keysym.Control-Right: \033[1;5C
URxvt.keysym.Control-Left: \033[1;5D
!! Copy Paste & Other Extensions
URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select
URxvt.copyCommand: xclip -i -selection clipboard
URxvt.pasteCommand: xclip -o -selection clipboard
URxvt.keysym.M-c: perl:clipboard:copy
URxvt.keysym.M-v: perl:clipboard:paste
URxvt.keysym.M-C-v: perl:clipboard:paste_escaped
URxvt.keysym.M-Escape: perl:keyboard-select:activate
URxvt.keysym.M-s: perl:keyboard-select:search
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.urlLauncher: firefox
URxvt.underlineURLs: true
URxvt.urlButton: 1
#!/bin/bash
sudo apt install -y feh
mkdir $HOME/Pictures && cd $HOME/Pictures
wget -o ghost2.jpg https://github.com/elithrade/manjaro-i3/raw/master/wallpapers/ghost2.jpg
feh --bg-scale $HOME/Pictures/ghost2.jpg
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
set $alt Mod1
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Noto Sans 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# kill focused window
bindsym $alt+F4 kill
# window colours: border background text
client.focused #0F0F0F #7FB256 #F5F5FF
client.focused_inactive #0F0F0F #7FB256 #E5E5E5
client.unfocused #0F0F0F #5697B2 #E5E5E5
client.urgent #0F0F0F #BC9B54 #E5E5E5
# start dmenu (a program launcher)
# bindsym $mod+d exec dmenu_run -fn "xft:droid sans:bold:pixelsize=11:antialias=true:hinting=slight" -nb "#0f0f0f" -nf "#a6a6a6" -sb "#0f0f0f" -sf "#8f8fed"
bindsym Menu exec --no-startup-id rofi -show run -lines 20 -eh 1.3 -opacity "85" -bw 0 -font 'Noto Sans 8'
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you neweed that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+ccedilla focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+ccedilla move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+z focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym ccedilla resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
position top
status_command i3status
font pango:SauceCodePro Nerd Font 10
strip_workspace_numbers yes
separator_symbol "-"
workspace_buttons yes
bindsym button4 nop
bindsym button5 nop
tray_padding 0
colors {
statusline #ffffff
background #000000
separator #000000ff
focused_workspace #00000000 #00000000 #c6ff00
inactive_workspace #00000000 #00000000 #dddddd
active_workspace #00000000 #00000000 #ffffff
urgent_workspace #b71c1c #b71c1c #00000000
binding_mode #b71c1c #b71c1c #00000000
}
}
# Make the currently focused window a scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the first scratchpad window
bindsym $mod+minus scratchpad show
bindsym XF86AudioRaiseVolume exec “pactl set-sink-volume @DEFAULT_SINK@ +10%"
bindsym XF86AudioLowerVolume exec “pactl set-sink-volume @DEFAULT_SINK@ ‘10%”
bindsym XF86AudioMute exec “pactl set-sink-mute @DEFAULT_SINK@ toggle”
# Increase brightness
bindsym XF86MonBrightnessUp exec “xbacklight -inc 10”
# Decrease brightness
bindsym XF86MonBrighnessDown exec “xbacklight -dec 10”
bindsym $Mod+i exec firefox www.google.com
bindsym $alt+e exec thunar
exec --no-startup-id volumeicon
exec --no-startup-id gnome-settings-daemon
exec --no-startup-id xsettingsd &
exec --no-startup-id unclutter &
exec --no-startup-id compton -b
exec_always --no-startup-id concky &
exec_always --no-startup-id numlockx on
exec_always --no-startup-id feh --bg-scale $HOME/Pictures/ghost2.jpg
# Network Applet
# exec --no-startup-id nm-applet
exec xfce4-power-manager
# Workspace music
bindsym $mod+m workspace "♪"
bindsym $mod+Shift+m move container to workspace "♪"
# Music control
# Special music mode
set $music Music (n) next, (b) prev, (p) play/pause
mode "$music" {
bindsym n exec --no-startup-id cmus-remote --next && pkill --signal SIGRTMIN+13 i3blocks, mode "default"
bindsym b exec --no-startup-id cmus-remote --prev && pkill --signal SIGRTMIN+13 i3blocks, mode "default"
bindsym p exec --no-startup-id cmus-remote --pause && pkill --signal SIGRTMIN+13 i3blocks, mode "default"
# back to normal
bindsym Return mode "default"
bindsym Escape mode "default"
}
# Emergency start cmus
bindsym $mod+Shift+Tab exec screen -S cmus -d -m cmus && pkill --signal SIGRTMIN+13 i3blocks
bindsym $mod+Tab mode "$music"
assign [class="Navigator"] $ws1
for_window [class="Navigator"] border 1pixel
assign [class=".*(F|f)irefox.*"] $ws2
for_window [class="Firefox"] border 1pixel
for_window [class="^.*"] border pixel 0
# Start cmus in the background on a separate screen session
exec screen -S cmus -d -m cmus && sleep 5 && pkill --signal SIGRTMIN+13 i3blocks
#i3-gaps
gaps inner 10
gaps outer 25
smart_gaps on
#!/bin/bash
########## Install i3 in Debian Minimal Distro ##########
# Author: Pedro Fernandes
# URL: https://github.com/pmcfernandes/
#########################################################
apt install software-properties-common
apt update
apt-add-repository contrib
apt-add-repository non-free
# Upgrade distro
apt-get update && apt-get upgrade -y
# Install xorg/i3 and usefull packages
apt-get install -y sudo intel-microcode i3 xorg suckless-tools lightdm rofi firefox-esr gnome-terminal thunar wicd cups xfce4-power-manager conky htop pulseaudio pavucontrol alsa-utils xbindkeys arandr xbacklight feh compton snapd numlockx unclutter cmus ufw
apt-get install -y pasystray paprefs pavumeter pulseaudio-module-zeroconf
# Install usefull and cool snap packages
snap install cool-retro-term --classic
snap install sublime-text --classic
# Configure sound
pactl set-sink-mute 0 false
pactl set-sink-volume @DEFAULT_SINK@ 50%
# Init numlockx
numlockx on
# Install zsh
apt install -y zsh
zsh
chsh -s /bin/zsh
# Install gaps
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake make gcc libxcb-shape0-dev git
cd /tmp
# clone the repository
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps
# compile & install
autoreconf --force --install
rm -rf build/
mkdir -p build && cd build/
# Disabling sanitizers is important for release versions!
# The prefix and sysconfdir are, obviously, dependent on the distribution.
../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers
make
sudo make install
sleep 5
reboot
general {
colors = true
interval = 5
}
order += "cpu_usage"
order += "load"
order += "disk /"
order += "battery 0"
order += "wireless wlp2s0"
order += "ethernet _first_"
order += "volume master"
order += "tztime local"
wireless wlp2s0 {
format_up = "W: (%quality) %ip"
format_down = "W: down"
}
ethernet _first_ {
# if you use %speed, i3status requires root privileges
format_up = "eth: %ip"
format_down = "E: down"
}
cpu_usage {
format = "CPU %usage"
}
tztime local {
format = "%Y-%m-%d %H:%M"
}
battery 0 {
format = "%status %percentage %remaining %emptytime"
format_down = "No battery"
status_chr = "⚡"
status_bat = "🔋"
status_unk = "?"
status_full = "☻"
path = "/sys/class/power_supply/BAT%d/uevent"
low_threshold = 10
}
load {
format = "[ P: %1min, %5min, %15min ]"
}
disk "/" {
format = "/ %avail / %total"
separator = false
}
volume master {
format = "♪: %volume"
format_muted = "♪: muted (%volume)"
device = "default"
mixer = "Master"
mixer_idx = 0
}
#!/bin/bash
cd $HOME
mkdir ~/.urxvt && mkdir ~/.urxvt/ext
sudo apt install -y git
git clone https://github.com/muennich/urxvt-perls
cd urxvt-perls
cp keyboard-select ~/.urxvt/ext
cp deprecated/clipboard ~/.urxvt/ext
cp deprecated/url-select ~/.urxvt/ext
cd ..
wget -o .Xresources https://gist.githubusercontent.com/pmcfernandes/c4e6f62933f0fc24386153149f5d309e/raw/89c38d331f8cd7695f06dc9b55202dfeb7e31224/.Xresources
xrdb ~/.Xresources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment