Skip to content

Instantly share code, notes, and snippets.

@Jspascal
Last active May 1, 2023 00:27
Show Gist options
  • Save Jspascal/85a13a76275ba4e62c7b499567a49de9 to your computer and use it in GitHub Desktop.
Save Jspascal/85a13a76275ba4e62c7b499567a49de9 to your computer and use it in GitHub Desktop.
My I3 windows manager configuration with picom and i3 status bar included(volume, battery, connectivity, ...)
# IMPORTANT!!!!!! place in a folder i3status inside the .config folder of your user home folder and rename to config
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
interval = 5
color_good = "#81a1c1" # Light green
color_degraded = "#fafe7c" # Light yellow
color_bad = "#ff7770" # Light red
}
# order += "ipv6"
order += "volume master"
order += "wireless _first_"
# order += "ethernet _first_"
# order += "battery all"
order += "battery 0"
# order += "disk /"
# order += "load"
# order += "memory"
order += "tztime local"
# wireless _first_ {
# format_up = "(%quality at %essid)"
# format_down = "down"
# }
wireless _first_ {
format_up = " %essid "
format_down = " Down "
}
volume master {
format = " %volume "
format_muted = " %volume "
device = "default"
mixer = "Master"
mixer_idx = 0
}
ethernet _first_ {
format_up = "E: %ip (%speed)"
format_down = "E: down"
}
# battery all {
# format = "%status %percentage"
# }
battery 0 {
format = "%status %percentage"
hide_seconds = true
integer_battery_capacity = true
last_full_capacity = true
status_chr = " +"
status_bat = ""
status_full = ""
}
disk "/" {
format = "%avail"
}
load {
format = "CPU: %1min"
}
memory {
format = " Mem %used"
threshold_degraded = "1G"
format_degraded = "MEMORY < %available"
}
tztime local {
format = "  %a %d-%m-%Y  %H:%M "
}
#!/bin/sh
case "$1" in
lock)
i3lock -i ~/Pictures/tower-nord.png
;;
logout)
i3-msg exit
;;
suspend)
systemctl suspend
;;
hibernate)
systemctl hibernate
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
#
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then
cat >~/.imwheelrc<<EOF
".*"
None, Up, Button4, 1
None, Down, Button5, 1
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
EOF
fi
##########################################################
CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)
NEW_VALUE=3
if [ "$NEW_VALUE" == "" ];
then exit 0
fi
sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.
cat ~/.imwheelrc
imwheel -kill
# END OF SCRIPT FILE
#IMPORTANT!!! place the sh files in a child directory named scripts and place this file(renamed to "config") and picom.conf i3 dir inside ~/.config
#####################################################################################################################
################# Define the $mod variable/key #################
#####################################################################################################################
# Key to rule them all : Super(Windows) or Alt key?
# Mod4 = Windows or Super key on keyboard
# Mod1 = Alt key on keyboard
#Set Alt key
#set $mod Mod1
#set Super key
set $mod Mod4
#activate touchpad
exec xinput set-prop "SYNA3296:00 06CB:CD50 Touchpad" "libinput Tapping Enabled" 1
#####################################################################################################################
################# Define the movements keys - variables #################
#####################################################################################################################
#This is setup for qwerty
set $up l
set $down k
set $left j
set $right semicolon
font pango:OperatorMono Nerd Font 0
#####################################################################################################################
################# Single and Dual screen #################
#####################################################################################################################
# exec --no-startup-id xrandr --output eDP-1 --mode 1920x1080 --rate 60.00
# exec xrandr --setprovideroutputsource modesetting NVIDIA-0
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
#####################################################################################################################
################# menu #################
#####################################################################################################################
# start dmenu
bindsym $mod+d exec --no-startup-id dmenu_run -i -nb '#1f222d' -nf '#81a1c1' -sb '#81a1c1' -sf '#1f222d' -fn 'OperatorMonoBook:bold:pixelsize=18'
#####################################################################################################################
################# how to exit, logoff, suspend, ... #################
#####################################################################################################################
bindsym $mod+0 mode "$mode_system"
set $mode_system System (k) lock, (l) logout, (u) suspend, (h) hibernate, (r) reboot, (s) shutdown
mode "$mode_system" {
bindsym k exec --no-startup-id ~/.config/i3/scripts/i3exit.sh lock, mode "default"
bindsym l exec --no-startup-id ~/.config/i3/scripts/i3exit.sh logout, mode "default"
bindsym u exec --no-startup-id ~/.config/i3/scripts/i3exit.sh suspend, mode "default"
bindsym h exec --no-startup-id ~/.config/i3/scripts/i3exit.sh hibernate, mode "default"
bindsym r exec --no-startup-id ~/.config/i3/scripts/i3exit.sh reboot, mode "default"
bindsym s exec --no-startup-id ~/.config/i3/scripts/i3exit.sh shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
# ArcoLinux Logout
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'"
#####################################################################################################################
################# reload changed configuration #################
#####################################################################################################################
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# reload the configuration file
bindsym $mod+Shift+c reload
#####################################################################################################################
################# Stopping an application #################
#####################################################################################################################
# kill focused window
bindsym $mod+q kill
#####################################################################################################################
################# Moving around in i3 #################
#####################################################################################################################
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#####################################################################################################################
################# moving around workspaces #################
#####################################################################################################################
# next/previous workspace
bindsym Mod1+Tab workspace next
bindsym Mod1+Shift+Tab workspace prev
bindsym $mod+Tab workspace back_and_forth
#navigate workspaces next / previous
bindsym Mod1+Ctrl+Right workspace next
bindsym Mod1+Ctrl+Left workspace prev
#####################################################################################################################
################# Scratchpad #################
#####################################################################################################################
# Make the currently focused window a scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the first scratchpad window
bindsym $mod+minus scratchpad show
#####################################################################################################################
################# Tiling parameters #################
#####################################################################################################################
# orientation for new workspaces
default_orientation horizontal
# split in horizontal orientation
bindsym $mod+h split horizontal
# split in vertical orientation
bindsym $mod+v split vertical
# toggle split mode
bindsym $mod+t split toggle
# Enter fullscreen mode for the focused container
# Super + F in arcolinux is execute thunar
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
# qwerty/azerty issue for letter z
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
####################################################################################################################
# resize window (you can also use the mouse for that)
bindsym $mod+r mode "resize"
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 $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
# same bindings, but for the arrow keys
bindsym Left resize shrink width 1 px or 1 ppt
bindsym Down resize grow height 1 px or 1 ppt
bindsym Up resize shrink height 1 px or 1 ppt
bindsym Right resize grow width 1 px or 1 ppt
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
#####################################################################################################################
################# autostart - execute applications at boot time #################
#####################################################################################################################
#Authentication dialog (polkit-gnome)
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
#####################################################################################################################
################# applications keyboard shortcuts #################
#####################################################################################################################
bindsym $mod+Return exec --no-startup-id alacritty;focus
bindsym control+mod1+u exec --no-startup-id pavucontrol
bindsym $mod+Shift+Return exec --no-startup-id nemo;focus
#####################################################################################################################
################# screenshots #################
#####################################################################################################################
bindsym Print exec maim -s --format png /dev/stdout | xclip -selection clipboard -t image/png -i
bindsym $mod+Print exec maim --select | tee ~/Pictures/$(date +%s).png | xclip -sel c -t image/png
#####################################################################################################################
################# audio settings #################
#####################################################################################################################
bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +5 --max-volume 100 && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -5 --max-volume 100 && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
default_border pixel 1
default_floating_border pixel 1
#####################################################################################################################
################# light #################
#####################################################################################################################
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec light -A 1 # increase screen brightness
bindsym XF86MonBrightnessDown exec light -U 1 # decrease screen brigmaim -s --format png /dev/stdout | xclip -selection clipboard -t image/png -ihtness
#####################################################################################################################
################# bar toggle #################
#####################################################################################################################
# bar toggle, hide or show
bindsym $mod+b bar mode toggle
bindsym $mod+i bar mode invisible
#####################################################################################################################
################# i3 gaps next #################
#####################################################################################################################
for_window [class="^.*"] border pixel 1
gaps inner 10
gaps outer 1
#smart_gaps on
#smart_borders on
#####################################################################################################################
################# i3 gaps change #################
#####################################################################################################################
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
mode "$mode_gaps" {
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_inner" {
bindsym plus gaps inner current plus 5
bindsym minus gaps inner current minus 5
bindsym 0 gaps inner current set 0
bindsym Shift+plus gaps inner all plus 5
bindsym Shift+minus gaps inner all minus 5
bindsym Shift+0 gaps inner all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
bindsym plus gaps outer current plus 5
bindsym minus gaps outer current minus 5
bindsym 0 gaps outer current set 0
bindsym Shift+plus gaps outer all plus 5
bindsym Shift+minus gaps outer all minus 5
bindsym Shift+0 gaps outer all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
#####################################################################################################################
################# picom and wallpaper #################
#####################################################################################################################
#if you want transparency on non-focused windows, ...
exec_always --no-startup-id picom --config ~/.config/i3/picom.conf
exec_always --no-startup-id nitrogen --restore
exec_always --no-startup-id ~/.config/i3/scripts/mouse.sh
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
################# bar appearance #################
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
bar {
height 25
position top
font pango:OperatorMono Nerd Font 12
status_command i3status
tray_padding 1
strip_workspace_numbers yes
colors {
separator #1f222d
background #1f222d
statusline #81a1c1
# border background text
focused_workspace #1f222d #1f222d #81a1c1
active_workspace #1f222d #252936 #5e81ac
inactive_workspace #1f222d #1f222d #4c566a
urgent_workspace #1f222d #1f222d #ee829f
binding_mode #1f222d #81a1c1 #2e3440
}
}
##START THEMING WM
# Window color settings
# class border backgr. text indicator
client.focused #81a1c1 #81a1c1 #ffffff #81a1c1
client.unfocused #2e3440 #1f222d #888888 #1f222d
client.focused #81a1c1 #81a1c1 #ffffff #81a1c1
client.placeholder #2e3440 #1f222d #888888 #1f222d
client.urgent #900000 #900000 #ffffff #900000
client.background #242424
##STOP THEMING WM
exec xset r rate 300 50 &
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
######################################## THE END ###########################################
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
#####################################################################################################################
# Thank you code_nomad: http://9m.no/ꪯ鵞
# and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
#backend = "xrender"
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified,
# but a 20% increase when only 1/4 is.
# My tests on nouveau show terrible slowdown.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update.
# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated.
# May break VSync and is not available on some drivers.
# Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage.
# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
#glx-swap-method = "undefined";
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 10;
# The left offset for shadows. (default -15)
shadow-offset-x = -9.5;
# The top offset for shadows. (default -15)
shadow-offset-y = -9;
# The translucency for shadows. (default .75)
shadow-opacity = 1;
log-level = "warn";
#change your username here
#log-file = "/home/erik/.config/compton.log";
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
shadow-blue = 0.6;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"! name~=''",
"name = 'Notification'",
"name = 'Plank'",
"name = 'Docky'",
"name = 'Kupfer'",
"name = 'xfce4-notifyd'",
"name *= 'VLC'",
"name *= 'compton'",
"class_g = 'Firefox' && argb",
"class_g = 'Conky'",
"class_g = 'Kupfer'",
"class_g = 'Synapse'",
"class_g ?= 'Notify-osd'",
"class_g ?= 'Cairo-dock'",
"class_g = 'Cairo-clock'",
"class_g ?= 'Xfce4-notifyd'",
"class_g ?= 'Xfce4-power-manager'",
"_GTK_FRAME_EXTENTS@:c",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'",
"_GTK_FRAME_EXTENTS@:c"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 5;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
# no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [ ];
#################################
#
# Other
#
#################################
corner-radius = 10;
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = false;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows.
# This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
#refresh-rate = 48;
# Vertical synchronization: match the refresh rate of the monitor
# this breaks transparency in virtualbox - put a "#" before next line to fix that
vsync = true;
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
dbe = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
#sw-opti = true;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games.
# Known to cause flickering when redirecting/unredirecting windows.
unredir-if-possible = false;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [ ];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 0.9; focus = true;};
dock = { shadow = true; }
dnd = { shadow = false; }
popup_menu = { opacity = 1; }
dropdown_menu = { opacity = 1; }
};
######################
#
# XSync
# See: https://github.com/yshui/compton/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d
#
######################
# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users.
xrender-sync-fence = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment