#%%# ## set primary gruvbox colorscheme colors set $bg #282828 set $red #cc241d set $green #98971a set $yellow #d79921 set $blue #458588 set $purple #b16286 set $aqua #689d68 set $gray #a89984 set $darkgray #1d2021 set $white #ffffff
#++++++=Shortcuts=++++++# # program launchers: drun(i3wm default), rofi # the theme of rofi can be changed by the value of parameter `-theme` bindsym $mod+d exec --no-startup-id dmenu_run bindsym $m_alt+space exec --no-startup-id rofi -show drun -theme ctheme
# terminals # well, the sakura is light, but it cannot adjust the font size by keyboard(like C-x + -/+). bindsym $mod+Return exec --no-startup-id sakura bindsym $mod+z exec --no-startup-id sakura
# browsers # I don't know what's the problem of google to remove the option of `save page as mthml` from dialog menu, anyway, if you don't need to save page as mhtml, just delete the parameter. bindsym $mod+c exec --no-startup-id firefox bindsym $mod+Shift+c exec --no-startup-id chromium --save-page-as-mhtml
# file explorers # Also have `ranger` as a file explorers. bindsym $mod+e exec --no-startup-id thunar
# emacs # well, if you don't need emacs, just comment this. bindsym $mod+Shift+e exec --no-startup-id emacsclient -c
# VSC # ### NOTICE ### the vscode start in this way will not read the environmental varaiables defined in users' home directory, some plugins will not be able to run. It can be solved by starting vscode manually in program launcher. bindsym $mod+q exec --no-startup-id code
## switch to near workspace bindsym $mod+Tab workspace next bindsym $m_alt+Tab workspace prev # bindsym $mod+Shift+Tab workspace prev
## 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 number $ws1 bindsym $mod+2 workspace number $ws2 bindsym $mod+3 workspace number $ws3 bindsym $mod+4 workspace number $ws4 bindsym $mod+5 workspace number $ws5 bindsym $mod+6 workspace number $ws6 bindsym $mod+7 workspace number $ws7 bindsym $mod+8 workspace number $ws8 bindsym $mod+9 workspace number $ws9 bindsym $mod+0 workspace number $ws10
## move focused container to workspace bindsym $mod+Shift+1 move container to workspace number $ws1 bindsym $mod+Shift+2 move container to workspace number $ws2 bindsym $mod+Shift+3 move container to workspace number $ws3 bindsym $mod+Shift+4 move container to workspace number $ws4 bindsym $mod+Shift+5 move container to workspace number $ws5 bindsym $mod+Shift+6 move container to workspace number $ws6 bindsym $mod+Shift+7 move container to workspace number $ws7 bindsym $mod+Shift+8 move container to workspace number $ws8 bindsym $mod+Shift+9 move container to workspace number $ws9 bindsym $mod+Shift+0 move container to workspace number $ws10
#------=Windows Control=------# ## Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod
## move window # bindsym $mod+Shift+J move left # bindsym $mod+Shift+K move down # bindsym $mod+Shift+L move up # bindsym $mod+Shift+colon 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
## split in horizontal orientation bindsym $mod+h split h ## split in vertical orientation bindsym $mod+v split v
## toggle bar (not for polybar) # bindsym $mod+m bar mode toggle
## resize shortcuts (also you can use the mouse for resizing) mode "resize" { bindsym h resize shrink width 10 px or 10 ppt bindsym j resize grow width 10 px or 10 ppt bindsym l resize shrink height 10 px or 10 ppt bindsym k resize grow height 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt bindsym Right resize grow width 10 px or 10 ppt bindsym Up resize shrink height 10 px or 10 ppt bindsym Down resize grow height 10 px or 10 ppt
bindsym Shift+Left resize shrink width 5 px or 5 ppt bindsym Shift+Right resize grow width 5 px or 5 ppt bindsym Shift+Up resize shrink height 5 px or 5 ppt bindsym Shift+Down resize grow height 5 px or 5 ppt
bindsym Ctrl+Left resize shrink width 1 px or 1 ppt bindsym Ctrl+Right resize grow width 1 px or 1 ppt bindsym Ctrl+Up resize shrink height 1 px or 1 ppt bindsym Ctrl+Down resize grow height 1 px or 1 ppt
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the # screen before suspend. Use loginctl lock-session to lock your screen. exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
Wallpaper, lockscreen and session control
Wallpaper
I choose feh to control the wallpaper, and feh just support bitmap, not vector images. I use debian built-in wallpapers(originally in .svg, use inkscape to convert it into .png).
# reload the configuration file bindsym $mod+$m_alt+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+$m_alt+r restart
# exit i3 (logs you out of your X session) bindsym $mod+$m_alt+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'"
bindsym $mod+$m_alt+l mode "i3lock: Return to lock/Escape to Cancel"
Lockscreen
i3 support many lockscreen app, this post only introduce betterlockscreen. The lockscreen picture is the wallpaper.
1 2 3 4 5 6 7 8 9 10
### use conf first betterlockscreen -u '/usr/share/wallpapers/FuturePrototypeWithLogo/contents/images/3840x2160.png'
i3wm can use many kind of status bar like i3status, i3blocks or polybar. These application have many componets, and you can create your own script then call it in the config file.
# Terminate any currently running instances killall -q polybar
# Pause while killall completes while pgrep -u $UID -x polybar > /dev/null; do sleep 1; done
iftype"xrandr" > /dev/null; then for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do MONITOR=$m polybar --reload mybar -c ~/.config/i3/polybar/config & done else polybar --reload mybar -c ~/.config/i3/polybar/config & fi
echo"polybars launched..."
Polybar has its own syntax to modify the setting, this post only have one example. Some componets’ config should correspondent to other application, like mpd. You should change the name of some devices like ethernet card or sound card.
If you want to show the icons on the polybar, please run this script after configuration.
; Separator in between workspaces ; label-separator = | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [module/i3] type = internal/i3 format = <label-state> <label-mode> index-sort = true wrapping-scroll = false
;;; NOTICE ;;; ; to show these icons on the bar, please run the script named `gic.sh` in the shell 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 = 10;
;; ws-icon-default =
; Only show workspaces on the same output as the bar pin-workspaces = true
# ~/.config/i3/i3blocks.conf # align # color # command # full_text # instance # interval # label # min_width # name # separator # separator_block_width # short_text # signal # urgent # Global properties # # The top properties below are applied to every block, but can be overridden. # Each block command defaults to the script name to avoid boilerplate.
# Global properties # # The top properties below are applied to every block, but can be overridden. # Each block command defaults to the script name to avoid boilerplate. command=~/.config/i3/i3blocks/$BLOCK_NAME separator_block_width=20 markup=none separator=false
# CPU usage # # The script may be called with -w and -c switches to specify thresholds, # see the script for details. [cpu_usage] label= interval=10 min_width=100.00% color=#fb4934
# Temperature # # Support multiple chips, though lm-sensors. # The script may be called with -w and -c switches to specify thresholds, # see the script for details. [temperature] label= interval=10 color=#fabd2f
# Disk usage # # The directory defaults to $HOME if the instance is not specified. # The script may be called with a optional argument to set the alert # (defaults to 10 for 10%).