Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[i3wm advanced config file] [solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Wed Sep 18, 2013 3:18 pm    Post subject: [i3wm advanced config file] [solved] Reply with quote

Here is my i3wm config file with the following features.

German Keyboard Layout
xscreensaver process started.

Keybindings:
Windows +E starts xfe File manager
Windows +L locks the Screen with xscreensaver
Volumemutekey mutes pulseaudio
Volumeupkey unmutes and rises master pulseaudio channel +1dB
Volumedownkey unmutes and rises master pulseaudio channel +1dB

You can start any program with Windows +D. If you switch over from gnome 2 for example you may know Alt + F2.

First Workspace renamed to 1:Shell and autorun of lilyterm terminal emulator.
Second Workspace renamed to 2:Web and autorun of google-chrome Webbrowser.

Changing of Workspaces with Windows + Number-Key (1 to 9 key)


Code:

roman@localhost ~ $ cat .i3/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 somewhen, delete
# this file and re-run i3-config-wizard(1).
#

#set kayboard german layout
exec setxkbmap de
#start the screensaver damon, xscreensaver is the featurerichst one
exec xscreensaver

#set modifier and l button as locking the screensaver
bindsym $mod+l exec xscreensaver-command --lock

#set modifier and e button to run xfe, the file manager
bindsym $mod+e exec xfe

# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

#set the modifier button to the windows button
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. ISO 10646 = Unicode
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, if you need a lot of unicode glyphs or
# right-to-left text rendering, you should instead use pango for rendering and
# chose a FreeType font, such as:
# font pango:DejaVu Sans Mono 10

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

# start a terminal
bindsym $mod+Return exec lilyterm
#i3-sensible-terminal

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

# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

# change focus
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+ö move right
#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

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
#changed from button e to x, because I need e to start an explorer
bindsym $mod+x 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

# switch to workspace
bindsym $mod+1 workspace 1:Shell
bindsym $mod+2 workspace 2:Web
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
bindsym $mod+0 workspace 10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1:Shell
bindsym $mod+Shift+2 move container to workspace 2:Web
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
bindsym $mod+Shift+0 move container to workspace 10

# 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 'Do you really want to exit i3 and 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 semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 2 px or 2 ppt
        bindsym Down resize grow height 2 px or 2 ppt
        bindsym Up resize shrink height 2 px or 2 ppt
        bindsym Right resize grow width 2 px or 2 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
        status_command i3status
}


#Alternatively you can change to your target workspace with i3-msg then have your frequently used programs start automatically with the exec command:

#Names Worksspace 1 to 1:Shell and starts lilyterm terminal emulator
exec --no-startup-id i3-msg 'workspace 1:Shell; exec /usr/bin/lilyterm'
#Names Workspace 2 to 2:Web and starts google-chrome Webbrowser
exec --no-startup-id i3-msg 'workspace 2:Web; exec /usr/bin/google-chrome'


#The key shortcuts are likely called XF86AudioRaiseVolume, XF86AudioLowerVolume, XF86AudioMute. Since only the mute is broken concentrate
#your efforts on changing that out first.

#toggle master mute of the pulsaudio master: amixer set Master toggle
bindsym XF86AudioMute exec "amixer set Master toggle"

#rise master volume of pulseaudio master
bindsym XF86AudioRaiseVolume exec "amixer set Master unmute; amixer -c 0 set Master 1dB+"

#lower master volume of pulseaudio master
bindsym XF86AudioLowerVolume exec "amixer set Master unmute; amixer -c 0 set Master 1dB-"




Thanks for the help guys.

I hope this config file helps someone.




Previous Questions, as I started this topic:

Comments:

I switched over from gnome 2->gnome 3-> mate (its in an overlay, its a gnome 2 fork) -> i3wm.

Its a lean environment wiht a basic status panel in the bottom.
Programs can be started with Windows+d. Mostly anything can be done with the keyboard and everything can be redefined in the config file.

questions:
I want to have a desctop background with the symbols/icons ... Do i only need to start gnome-session? Is there any other alternative without many requirements?


Last edited by Roman_Gruber on Mon Sep 30, 2013 8:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Wed Sep 18, 2013 7:55 pm    Post subject: Reply with quote

You can probably use idesk for desktop icons, although that just seems wrong for a tiling wm, in my opinion. I prefer to bind commonly used applications to keyboard shortcuts.

I use feh for a background, although nitrogen will work as well. I start it by adding the following to my config:

Code:
 exec --no-startup-id feh --bg-scale </path/to/image>

_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Wed Sep 18, 2013 8:32 pm    Post subject: Reply with quote

Thank you, I agree on your opinon. Well my first days with that i3 stuff and I really like it.

Its small and works.

Any recommendations for a file manager, caja is like nautilus or nemo, but it starts the hole "gnome 2" processes in the background. I really like caja but those started background gnome stuff annoys me a bit.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Wed Sep 18, 2013 8:37 pm    Post subject: Reply with quote

I use thunar since it is free of either kde and gnome as well as being (potentially) *kitless.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Fri Sep 20, 2013 8:39 am    Post subject: Reply with quote

I try lilyterm instead of terminator because its very small and featureful.

For the file manager, thunar does not show me any icons for folders, or file. I just want to see a folder icon, file icons, and maybe file type icons for pdf, libreoffice and so on, any ideas?

What really bugs me now, how do i get like in gnome a menu when i hit the buttons for volume up/down/mute?
Yes I know I have to write some exec line into .i3/config. But how do I see which keycode is needed and how to write it into the file. how do i get a visual feedback to see a volume bar when changing.

2nd I forgot to plug in the ac soure and so my notebook went dead. Is there an easy solution to get a warning when a threshold of my battery is met? There must be an easy way to achieve that without using e.g. gnome-panel with gnome-power-manager ...

I will try on this weekend to poke around and look for a solution, which is small and beautiful.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Thu Oct 17, 2013 10:07 am    Post subject: Reply with quote

If you want handy screenshots which are placed in Screenshots folder in your home directory add this to your i3/config file:

Code:
bindsym $mod+F12 exec "scrot '%d.%m.%Y_%H.%M_screenshot.png' -e 'mv $f ~/Screenshots/'


Thats another approach, but it works different:
Code:
bindsym $mod+F12 exec "xwd -root -display :0.0|convert xwd:- screenshot.png"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum