I3 trouble

Hi again!

I am trying to set up i3 (gaps) and got it going for a while. After a reboot most of the keybinds went. The config file looks ok (No changes has been made).
I wonder if it is possible to reset i3 in some way? I have tried uninstall i3 (and skel) and then reinstall and even though config file looks the same there are only a few key binds that work. Power-keys are gone, Rofi is gone. V-split gone H-split gone.
I am trying to learn i3 and I thought it went well…

Anyone with a hint on how to reset to just post install of i3?

womp

The default key binding to restart i3 is:

$mod+Shift+r

Is that working? If you unistalled i3 and the skel, then did a reinstall, you will have the default i3 config and key bindings. You should have also seen a dialog to choose which key - winkey or alt - to use for $mod.

Are these working?

# start a terminal
$mod+shift+return

# start dmenu
$mod+d 
1 Like

Very well written:

i3 user guide

1 Like

Oh thanks for answer! $mod+return starts a terminal and $mod+d works but that is about it!
After I reinstalled I did not get to choose $mod-key.

i3 user guide is very good! I will continue reading.

womp

Looks like you have the default i3 config then.

Which package did you install when you re-installed i3-wm or i3-gaps?

I’ve never installed i3-gaps, so I don’t know if you’ll need to manually add the gaps to the config. You can look through the i3-gaps readme file for configuration options.

Well, I used i3-gaps. The only reason I installed i3-gaps was key bind consistency with Openbox. The thing is that after this mornings reboot there are no consistency anymore!
And i3 does not seem to read from ~/.config/i3/config file. Does it read from /etc instead?
I will delete config and see If I get to choose $mod key and then I must manually set all keys right?

womp

i3 reads the ~/.config/i3/config file.

If there is no setup for i3 in /etc/skel then you should get the default config file copied from /etc/i3/config to your ~/.config/i3/config.

First time you log into i3, you see a dialog that asks if you want the winkey or alt to be defined as $mod.

And yes, once you have the default config in ~/.config/i3/ you will need to edit the config file and add your own key bindings.

I think i3-gaps also reads ~/.config/i3/config but you can add the configuration for gaps and whatever else it provides.

1 Like

I went back to i3-wm with new config file. Was able to set W-key as mod.
Got Rofi going (finally!)
I am stuck at binding $mod+x as power key (rofi_run -l) Pointer in limbo it seems.
I will read more.

womp

@womp You might read the tutorial I posted this week, if you haven’t. If you follow it, you should get really close to a fully operational i3wm…

bindsym $mod+x exec rofi_run -l

Should work.

You mean the mouse isn’t working, or it locks up trying to run “rofi_run -l” ?

1 Like

Well,

bindsym $mod+x exec rofi_run -l

is just what I have but pointer is just “rolling” until I press another key-bind.

I have made a couple of other rofi-bindings that work and I can not see why “power-buttons” isn’t!?
I will read further!

womp

I think i have to pay more attention to that article and maybe sxhkd!?

womp

@womp Because I use many window managers, I like to keep one set of ‘application’ keybindings. sxhkd is both simple and has worked with every window manager I have used, thus far. That includes:

  • openbox
  • i3wm
  • dwm
  • bspwm
  • hlwm
  • fvwm
  • xfce4
    … you get the picture (so I use it to define once, use many times).

What that leaves me with is unique keybindings required for use by window managers. Those tend to stay within the wm’s themselves. What I try to do is re-use as many of the keybindings where I can. All this is done, to minimize brain strain. Like Winnie-the-pooh, I am a bear of little brain(s). To help you a bit, here are the contents of my i3wm conf file (you will note all application keybindings are commented out:

###############################################################
# This file was originally 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!
#	
# edits, tweaks, and disasaters created by Mark Rabideau
# (aka. ManyRoads)
###############################################################

# Set Mod keys
set $mod mod4
set $alt mod1

# Autostart
exec --no-startup-id conky -c ~/.config/i3/.i3wm-1rc
exec --no-startup-id conky -c ~/.config/i3/.i3wm-2rc
exec --no-startup-id sxhkd -c ~/.config/sxhkd/base.conf 
exec --no-startup-id feh --randomize --bg-fill $HOME/.wallpapers/active-wallpapers/* 
#exec_always --no-startup-id exec_always --no-startup-id autotiling -w 1 8 9
#exec --no-startup-id sleep 5 && xcompmgr -CcfF -I-.015 -O-.03 -D6 -t-1 -l-3 -r4.2 -o.5 
## do not use polybar ### exec_--no-startup-id polybar -c ~/.config/i3/polybar top


# 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 11
font pango:JoyPixels 12
font pango:FontAwesome 12
font pango:Hack Nerd Font 12

# 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

# 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 with system tray GUI.
exec --no-startup-id nm-applet

## 		Nordic color palette
set $background 		#2E3440
set $background-alt 	#88C0D0
set $background-active 	#81A1C1
#434C5E
set $foreground 		#B0C4BB
set $foreground-alt 	#81A1C1
set $foreground-active 	#FFFFFF
set $accent 			#81a1c1
set $alert 				#BF616A
set $active 			#88C0D0
set $focused			#81A1C1
set $occupied 			#88c0d0
set $inactive			#8fbcbb 
#set $unfocused			#88C0D0
set $unfocused			#5F6676
set $urgent				#BF616A
set $transparent 		#802f343f

## 		colors          border      	background				text        	indicator
client.focused          $focused		$focused				$foreground	 	$focused
client.focused_inactive $inactive   	$inactive		 		$foreground 	$inactive
client.unfocused        $unfocused   	$unfocused  			$foreground 	$unfocused
client.urgent           $urgent		    $background   			$foreground 	$urgent  

# 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

## window title
title_align left

## border -- a 3 px border
default_border pixel 3

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# kill focused window
bindsym $mod+Shift+q kill

####### sxhkd base.conf short-cuts & bindings perform the following   #######

#bindsym $alt+w exec firefox;workspace 2;focus
#bindsym $alt+f exec Nemo;workspace 3;focus
#bindsym $mod+l exec i3lock-fancy 

# start a terminal
#bindsym $mod+Return exec st
#bindsym $mod+Return exec termite

# 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

####### sxhkd base.conf short-cuts & bindings perform the above   #######

# change focus
#bindsym $mod+j focus left
#bindsym $mod+k focus down
#bindsym $mod+l focus up
#bindsym $mod+semicolon 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+semicolon 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.

## [---Workspaces---]
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: "

## 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

## arrow workspace travel (left & right)
bindsym $alt+Right 	workspace next
bindsym $alt+Left 	workspace prev

# 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 -f 'pango:monospace 11' -t warning -m ' Exit request detected  Do you really want to exit i3  This will end your X session.' -B 'Yes,  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 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 Escape mode "default"
        bindsym $mod+r mode "default"
}

bindsym $mod+r mode "resize"

## window border
for_window [class=".*"] border pixel 2

## focus on launch, size window & position
#### 		floating & in focus
for_window [class=St|Termite|URxvt|KeePassXC|Xed] focus, floating enable, resize set 840 640
for_window [class=Nitrogen|Font-manager|Lightdm-gtk-greeter-settings|Lxappearance|Yad] focus, floating enable, resize set 720 480
for_window [class=Yad|Arandr] focus, floating enable, resize set 320 20
for_window [class=mpv|Gucharmap|Deadbeef|Skype|zoom|Pavucontrol|Celluloid] focus, floating enable, resize set 840 640
for_window [class=Pamac-manager]  focus, floating enable, resize set 720 480
for_window [class=System-config-printer.py|Minstick.py|Grsync|luckybackup|Filezilla] focus, floating enable, resize set 840 640
#### 		tiled & in Focus
for_window [class=firefox|Vivaldi-stable|Brave-browser] focus
for_window [class=Nemo|File-roller] focus
for_window [class=Geany|libreoffice*|Thunderbird|calibre|Zettlr] focus
for_window [class=Gimp-2.10|Inkscape] focus

#### 		assign apps to workspaces
assign      [class="Pamac-manager"]   		$ws1
assign      [class="Filezilla"]   			$ws1
assign      [class="luckybackup"]   		$ws1
assign      [class="Grsync"]   				$ws1
assign      [class="Mintstick.py"]   		$ws1
assign      [class="firefox"]   			$ws2
assign      [class="Vivaldi-stable"]   		$ws2
assign      [class="Brave-browser"]   		$ws2
assign      [class="Nemo"] 					$ws3
assign      [class="calibre"] 				$ws4
assign      [class="Xed"] 					$ws4
assign		[class="libreoffice*"]			$ws4
assign      [class="Zettlr"] 				$ws4
assign      [class="Gimp*"] 				$ws5
assign      [class="VirtualBox Manager"] 	$ws5
assign      [class="Skype"] 				$ws6
assign      [class="zoom"] 					$ws6
assign      [class="Pavucontrol"] 			$ws7
assign      [class="Deadbeef"] 				$ws7
assign      [class="Geany"] 				$ws8
assign      [class="Thunderbird"] 			$ws9
#for_window  [class="spotify"]         move to workspaces

## Start i3bar to display a workspace bar plus the system status information.
#
####	 	i3bar settings
bar {
	position top
	id bar-top
#	tray_output primary	
	tray_padding 2
	workspace_buttons yes
#	workspace_min_width 40
    strip_workspace_numbers no
	strip_workspace_name no
	font pango:Hack 12
#	i3bar_command i3bar --transparency

#### 		Status bar used is: conkybar
# Note: I choose not to use i3blocks, i3status, etc. because I like
# the look, feel & function of conkybar better.  This choice will
# likely need to be altered in Sway (i3 on Wayland)

status_command ~/.config/i3/conkybar.sh


#### 		i3bar colors, etc.
colors {
#       background 	$transparent
		background	$background
        statusline 	#ebcb8b
        separator 	#4b5262

        # colour:	 				border, 	background, text
        focused_workspace       	$focused	#81A1C1		#000000
        active_workspace        	$active 	#81A1C1 	#4d4d4d
        inactive_workspace  	    $inactive 	#8fbcbb 	#4d4d4d
        urgent_workspace	    	$urgent 	$urgent		#FFFFFF
        }
    }

Next here are my current shared application bindings used via sxhkd (I call the file base.conf)

#               
#	 		sxhkdrc ~ common functions              
#       i3wm/dwm/bspwm - and most other wms                   
#
#########################
# SUPER + FUNCTION KEYS #
#########################
# if you want to assign applications to specific tags or workspaces
# add a command behind the application to focus on that workspace if required
# index 0 corresponds to tag or HLWM workspace 1
# index 1 corresponds to tag or HLWM workspace 2
# example 
#  firefox & herbstclient use_index 1

# Open Terminal
super + Return
	termite
#	st -g=93x31+100+300

# dmenu
super + d
	dmenu_run -b -nb '#3B4252' -sb '#000000' -sf '#8FBCBB' -fn '-xos4-terminus-medium-r-*-*-14-*'

# rofi menu   (2 options)
alt + @button1
	 rofi -modi drun,window,run -show drun -show-icons -sidebar-mode -location 0  -width 360

super + F1	 
	 rofi -modi drun,window,run -show drun -show-icons -sidebar-mode -location 0  -width 360
	
# Show Keybinding Index
super + F2
	zenity --text-info --width=640 --height=640  --html --filename=/home/mark/.local/share/help-files/app-keybindings.html --ok-label="Quit"

# system utilities
super + F3 
	~/.local/share/scripts/system-monitors.sh

# system maintenance links
super + F4
	~/.local/share/scripts/system-links.sh
	
# old game links
super + F5
	~/.local/share/scripts/old-games.sh
	
# Screenshot
F10
	gscreenshot
	
# Linux Links
super + F11 
	zenity --text-info --width=640 --height=640  --html --filename=/home/mark/.local/share/help-files/linux-links.html --ok-label="Quit"

# rofi Active Tasks 
super + F12
	rofi -modi window -show window -show-icons -sidebar-mode

# gsimplecal
alt +shift + c
	gsimplecal
	
# calibre (books)
alt + c 
	export CALIBRE_USE_DARK_PALETTE=1 && calibre 

# Music (DeadBeef)
alt + d
	deadbeef
	
# editor
alt + e
	xed
#	st -g=93x31+100+300 -e vim & herbstclient use_index 3
	
# file managers
alt + f 
	nemo

# file manager (ROOT)
alt + shift + f
	gksu nemo

# geany
alt + g 
	geany
	
# j4-desktop-menu
alt + j
	j4-dmenu-desktop --dmenu="dmenu -b -fn "-xos4-terminus-medium-r-*-*-14-*" -nb '#2E3440' -nf '#81A1C1' -sb '#85ABAA' -sf '#000000' -i"
    
# eMail
alt + m
	thunderbird

# nitrogen wallpaper
alt + n
	nitrogen
	
# libreoffice
alt + o
	libreoffice
	
# pamac manager
alt + p
	pamac-manager

# System Quit Options
super + q
	/home/mark/.local/share/scripts/logout.sh
	
# Lock Screen
super + l
	i3lock-fancy 

# ranger- file manager
alt + r
	termite -e ranger
#	st -g=93x31+100+300 -e ranger & herbstclient use_index 2

# skype
alt + s
	skypeforlinux
	
# Virtualbox
alt + v
	virtualbox
# & herbstclient use_index 4
	
# web browser        
alt + w
	firefox
#	vivaldi-stable  & herbstclient use_index 1

#Lock screen
super + x
	dm-tool lock

# zim wiki
alt + z 
	zim

# Reboot
ctrl + alt + Delete
	 reboot

I hope thi helps. Don’t kill too many trees printing it out. :wink:

2 Likes

I have a tree out in the front yard that I need to cut down in case it knocks over in a stiff wind and kills me. One branch alone can print out the entire Arch Wiki, I won’t have an issue printing your configs out lulz.

Thanks!

1 Like

This is what I have to do!!

Really good stuff!!
It’s time to get structured!!

womp

1 Like

On my macbookpro (2012 I looked it up!)
I had i3-gaps installed and I tried the same key-bindings as with i3 and they all worked!
Something must be wrong here on this HPprobook(2014)!?

womp

Can you give an example which works on your MBP but not on HP?

bindsym $mod+x exec rofi_run -l

womp

how’s your mod key defined?

also try,

$which rofi_run

on both machines.

On this HP laptop mod key was defined when I started i3-wm for the first time.

which rofi_run

gave ~/.local/bin/rofi_run on both computers.

womp