<-[[.:start]] ====== I3 Window Manager ====== ** Various Things related to I3 ** Background & Conky {{:public:computers:2022-10-09-131610_1440x900_scrot.png?600|}} Some tiled windows {{:public:computers:2022-10-08-204455_1440x900_scrot.png?600|}} Floating scratchpad terminal with ''ranger'' file manager {{:public:computers:2022-10-09-132014_1440x900_scrot.png?600|}} Floating scratchpad terminal with ''Alpine'' email client {{:public:computers:2022-10-09-133519_1440x900_scrot.png?600|}} ===== I3 Config and tweaks ===== === Autotile === Make new windows be created in alternating ''horizontal'' / ''vertical'' arrangement, depending on aspect ratio of the current window. [[https://github.com/nwg-piotr/autotiling]] {{:public:computers:2022-10-09-132505_1440x900_scrot.png?600|}} === I3 Config File === ++++ config | # 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 # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. #font pango:monospace 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 10 default_border normal 3 hide_edge_borders none binding_mode_indicator yes #set $bg-color #2f446f #set $inactive-bg-color #2f343f #set $text-color #ffb25a #set $inactive-text_color #676e7d #set $urgent-bg-color #bd2c40 #client.focused $bg-color $bg-color $text-color #2255ff #client.unfocused $inactive-bg-color $bg-color $text-color #225ff #client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #2255ff #client.urgent $urgent-bg-color $urgent-bg-color $text_color #2255ff workspace_auto_back_and_forth yes # The combination of xss-lock, nm-applet and pactl is a popular choice, so # they are included here as an example. Modify as you see fit. # 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 # NetworkManager is the most popular way to manage wireless networks on Linux, # and nm-applet is a desktop environment-independent system tray GUI for it. #exec --no-startup-id nm-applet exec --no-startup-id synclient tapbutton1=-1 exec --no-startup-id /home/gm4slv/noblank.sh exec --no-startup-id conky exec --no-startup-id xsetroot -solid midnightblue exec --no-startup-id ~/background.sh #exec --no-startup-id polybar example exec_always --no-startup-id autotile #exec_always --no-startup-id ~/autosplit bindsym $mod+p exec --no-startup-id ~/promote-window # Use pactl to adjust volume in PulseAudio. set $refresh_i3status killall -SIGUSR1 i3status bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $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 #bindsym XF86AudioMute exec amixer sset 'Master' toggle #bindsym XF86AudioLowerVolume exec amixer sset 'Master' 5%- #bindsym XF86AudioRaiseVolume exec amixer sset 'Master' 5%+ # Use Mouse+$mod to drag floating windows to their wanted position floating_modifier $mod # start a terminal #bindsym $mod+Return exec i3-sensible-terminal bindsym $mod+Return exec lxterminal # kill focused window bindsym $mod+Shift+q kill # start dmenu (a program launcher) bindsym $mod+d exec --no-startup-id dmenu_run # A more modern dmenu replacement is rofi: # bindcode $mod+40 exec "rofi -modi drun,run -show drun" # There also is i3-dmenu-desktop which only displays applications shipping a # .desktop file. It is a wrapper around dmenu, so you need that installed. # bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop # change focus bindsym $mod+h focus left bindsym $mod+j focus down bindsym $mod+k focus up bindsym $mod+l 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+h move left bindsym $mod+Shift+j move down bindsym $mod+Shift+k move up bindsym $mod+Shift+l 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+d 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 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 # 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 bindsym $mod+Shift+x exec i3lock # 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'" ############################## # # Program Shortcuts # ############################## # "b" for "browser" bindsym $mod+b exec --no-startup-id firefox ############################## # # SCRATCHPAD # # ############################### set $scratchpad-size 1000 700 bindsym $mod+Shift+minus move scratchpad bindsym $mod+minus scratchpad show bindsym $mod+m [title="AlpineMail"] scratchpad show ; move position center bindsym $mod+n [title="NewsboatReader"] scratchpad show ; move position center bindsym $mod+comma [title="RangerFM"] scratchpad show ; move position center bindsym $mod+period [title="Connman"] scratchpad show ; move position center exec --no-startup-id lxterminal -T AlpineMail -e ~/rpine exec --no-startup-id lxterminal -T NewsboatReader -e /usr/bin/newsboat exec --no-startup-id lxterminal -T RangerFM -e ranger exec --no-startup-id cmst -M for_window [title="Connman System Tray"] floating enable, resize set $scratchpad-size, move scratchpad for_window [title="AlpineMail"] floating enable, resize set $scratchpad-size, move scratchpad for_window [title="NewsboatReader"] floating enable, resize set $scratchpad-size, move scratchpad for_window [title="RangerFM"] floating enable, resize set $scratchpad-size, move scratchpad ################################################ # # # # 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 semicolon 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 Caps_Lock 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 { font pango:DejaVu Sans mono 10 status_command i3status -c ~/i3status.conf } ++++ === i3status bar === ++++ i3status.conf | # 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 } #order += "ipv6" order += "wireless _first_" order += "ethernet _first_" order += "battery 0" #order += "disk /" order += "load" order += "cpu_usage" order += "cpu_temperature 0" #order += "memory" order += "tztime local" wireless _first_ { format_up = "W: (%quality at %essid) %ip" format_down = "W: down" } ethernet _first_ { format_up = "E: %ip (%speed)" format_down = "E: down" } battery 0 { status_chr = "⚡" status_bat = "🔋" status_unk = "? " status_full = "☻ " low_threshold = 10 format = "B: %status %percentage %remaining" } disk "/" { format = "%avail" } load { format = "L: %1min" } cpu_temperature 0 { format = "T: %degrees°C" } cpu_usage { format = "CPU0 %cpu0 / CPU1 %cpu1" } memory { memory_used_method = "classical" format = "%free / %used" threshold_degraded = "2G" format_degraded = "MEMORY < %available" } tztime local { format = "%Y-%m-%d %H:%M" } ++++ === Conky === ++++ .conkyrc | # Standard antiX .conkyrc file # For conky editing help and commands visit = Casey's Conky Reference with Examples {http://www.ifxgroup.net/conky.htm} # set to yes if you want Conky to be forked in the background background yes short_units yes cpu_avg_samples 1 net_avg_samples 1 out_to_console no # X font when Xft is disabled, you can pick one with program xfontsel #font 7x12 #font 6x10 #font 7x13 font 8x12 #font 7x12 # Use Xft? use_xft yes # Xft font when Xft is enabled #xftfont gentium:size=12 #ftfont DejaVu Sans:size=10 xftfont DejaVu Sans:bold:size=9 #xftfont DejaVu Sans:size=9 # Create own window instead of using desktop (required in nautilus, pcmanfm and rox desktops) own_window yes own_window_class Conky own_window_transparent yes own_window_hints undecorated,below,sticky,skip_taskbar own_window_type override # Text alpha when using Xft xftalpha 1.0 #on_bottom no # Update interval in seconds update_interval 1 # Use double buffering (reduces flicker, may not work for everyone) double_buffer yes # Minimum size of text area minimum_size 55 maximum_width 190 # Draw shades? draw_shades no # Draw outlines? draw_outline no # Draw borders around text draw_borders no # Stippled borders? stippled_borders 0 # border margins #border_margin 10 # border width border_width 2 # Default colors and also border colors default_color white default_shade_color white default_outline_color white #color ffffff color4 yellow color8 77ccff color9 5599cc # Text alignment, other possible values are commented # alignment top_left alignment top_right #alignment bottom_left #alignment bottom_right # Gap between borders of screen and text gap_x 20 gap_y 40 # Add spaces to keep things from moving about? This only affects certain objects. use_spacer right # Subtract file system buffers from used memory? no_buffers yes # if_up_strictness link: up | link | address if_up_strictness address # set to yes if you want all text to be in uppercase uppercase no TEXT ${alignc}$nodename ${alignc}${color8}${font DejaVu Sans:size=12}${time %H:%M} ${font} ${color} ${alignc}${time %a %d %b} ${alignc}Uptime: $uptime #${alignc}${exec disp=${DISPLAY#:}; disp=${disp%.[0-9]}; cat $HOME/.desktop-session/desktop-code.$disp 2>/dev/null} #res:${alignr}${execi 60 xdpyinfo | sed -n -r "s/^\s*dimensions:.*\s([0-9]+x[0-9]+).*/\1/p"} #dpi:${alignr}${execi 60 sed -nr "s/^\s*Xft.dpi:\s*([0-9]+(x[0-9]+)?).*/\1/p" $HOME/.Xresources | grep "[0-9]" || echo 96} #Automount: ${alignr}${execi 60 grep -q "^automount=TRUE" $HOME/.desktop-session/automount.conf 2>/dev/null && echo "enabled" || echo "disabled"} Freq:${alignr}${freq} CPU:${alignr}${cpu}% #${color}Init:${alignr}${color3}${execi 60 detect-init.sh} ${alignr}${cpugraph cpu0 30,170 5599cc 5599cc} Disk:${alignr}${diskio} ${alignr}${diskiograph 30,170 5599cc 5599cc}${if_up eth0} eth0 up: $alignr ${upspeed eth0} ${alignr}${upspeedgraph eth0 30,170 5599cc 5599cc} eth0 down: $alignr ${downspeed eth0} ${alignr}${downspeedgraph eth0 30,170 5599cc 5599cc}${endif}${if_up eth1} eth1 up: $alignr ${upspeed eth1} ${alignr}${upspeedgraph eth1 30,170 5599cc 5599cc} eth1 down: $alignr ${downspeed eth1} ${alignr}${downspeedgraph eth1 30,170 5599cc 5599cc}${endif}${if_up wlan0} Wireless IP $alignr ${addr wlan0} Gate $alignr $gw_ip NS $alignr $nameserver wlan0 up: $alignr ${upspeed wlan0} ${alignr}${upspeedgraph wlan0 30,170 5599cc 5599cc} wlan0 down: $alignr ${downspeed wlan0} ${alignr}${downspeedgraph wlan0 30,170 5599cc 5599cc}${endif}${if_up wlan1} wlan1 up: $alignr ${upspeed wlan1} ${alignr} ${upspeedgraph wlan1 30,170 5599cc 5599cc} wlan1 down: $alignr ${downspeed wlan1} ${alignr}${downspeedgraph wlan1 30,170 5599cc 5599cc}${endif} ${alignr}${color8}Used / Total ${color} RAM:${alignr}$mem / $memmax Swap:${alignr}$swap / $swapmax / Disk:${alignr}${fs_used /} / ${fs_size /} #${alignc}${execi 1000 persist-enabled} ${font DejaVu Sans Mono:size=10}${execi 30 ~/ruptime} ++++ Gather ''ruptime'' information about local LAN Linux boxes from the ''rwhod'' service and format it with a small script ''~/ruptime'' called from conkyrc ${font DejaVu Sans Mono:size=10}${execi 30 ~/ruptime} ++++ ruptime local script | #!/bin/bash /usr/bin/ruptime -a | cut -c1-8,13-16,18-27 ++++ Real ''ruptime'' returns: gm4slv@antix1:~ $ ruptime antix1 up 1+04:34, 0 users, load 0.63, 0.48, 0.47 aprs up 116+04:03, 0 users, load 0.00, 0.01, 0.00 laptop up 9+16:04, 0 users, load 1.27, 1.09, 1.04 nas1 up 185+23:19, 0 users, load 0.33, 0.48, 0.47 shack up 16:19, 0 users, load 0.16, 0.22, 0.21 My small script formats it for conky gm4slv@antix1:~ $ ./ruptime antix1 up 1+04:34 aprs up 116+04:03 laptop up 9+16:04 nas1 up 185+23:19 shack up 16:19 === add neofetch output as image to root window === ++++ background.sh | #!/bin/bash while : do neofetch --disable term > fetch ansilove -q -m transparent fetch feh --bg-center -B midnightblue fetch.png sleep 300 done ++++ === Keys cheatsheet === $mod+p = promote window $mod+Return = terminal $mod+Shift+q = kill window $mod+d = dmenu $mod+h = focus left $mod+j = focus down $mod+k = focus up $mod+l = focus right $mod+Shift+h = move left $mod+Shift+j = move down $mod+Shift+k = move up $mod+Shift+l = move right $mod+f = fullsreen toggle === When using Autotile these are for the next window to be created ==== $mod+s = stacking $mod+w = tabbed $mod+e = toggle h or v === Toggle a window between tiled and floating === $mod+Shift+space = floating toggle === Switch focus between a floating window and the tiled window(s) $mod+space focus mode_toggle $mod+a = focus parent ===== Additional Software ===== ==== urxvt ==== Configured vi ~/.Xdefaults For Ranger icons use ''DejavuSansMono NFM:size=11:style=Book'' A bug makes font rendering //odd//, with too much space between characters (//kerning// is wrong) A fix is to put ''Xft.rgba: none'' into ~/.Xdefaults Another fix is to put ''URxvt.letterSpace=-1'' into ''~/.Xdefaults'' Here's the ''~/.Xdefaults'' I use: Some un-used lines are commented out, but might be useful in testing.... Xft.rgba: none #Xft.hintstyle: hintfull #URxvt.letterSpace:-1 Xcursor.size:10 #URxvt.skipBuiltinGlyphs: true URxvt.scrollBar: false URxvt.boldFont: #URxvt.font: xft:DejaVuSansMono:style=Book:size=11 #URxvt.font: xft:Monospace:size=11, xft:DejaVuSansMono NFM:style=Book URxvt.font: xft:DejaVuSansMono NFM:size=11:style=Book ==== Ranger ==== * Image Previews: ''/etc/ranger/config/rc.conf'' :set preview_images trueset preview_images_method w3m * Draw borders round segments of display ''/etc/ranger/config/rc.conf'' : set draw_borders both * Icons following instructions here: [[https://github.com/alexanderjeurissen/ranger_devicons]] * ''/etc/ranger/config/rc.conf'' :default_linemode devicons * Font for icons : [[https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/DejaVuSansMono.zip]] * unzipped into : ~/.fonts * font cache re-built with fc-cache -fv * Use Lxterminal - handles icons and image previews (''st'' is poor for image previews) * commands for exracting and creating compressed archives (''zip'', ''tar'', ''tar.gz'' etc) from here [[https://wiki.archlinux.org/title/ranger#Archives]] * added both ''python'' snippets to ''/etc/ranger/config/commands.py'' * added keybindings to ''/etc/ranger/config/rc.conf'' map ,n console compress map ,m compress temp.zip map ,e console extract_here * extract a zip/tar/tar.gz by the keystroke ,'e' * create an automatically named ''temp.zip'' archive by selecting the files (space) and then ,'m' * create a named archive of your choice ,'n' ''your_archive_name.[tar|zip|tar.gz]'' : touch (new file) gg : move to top G : move to bottom : help : rename : view (less) : edit (vim) : copy : cut : mkdir : delete : quit : select uv : un-select yy : yank (copy) dd : cut ud : un-cut uy : un-cut(yank) pp : paste gh : GoHome zh : show hidden dotfiles Archive operation commands ,n : new named archive ,m : new "temp.zip" ,e : extract_here --- //John Pumford-Green 09/10/22 12:38// ===== Further Information ===== {{tag>}}