Permalink
Branch: master
Find file Copy path
0fceeb5 Feb 2, 2019
1 contributor

Users who have contributed to this file

executable file 388 lines (300 sloc) 12.6 KB
##########
# colors #
##########
# get color from xressource configuration - variable_name xressource_color fallback
# special
set_from_resource $foreground foreground #000000
set_from_resource $background background #000000
set_from_resource $cursorColor cursorColor #000000
# black
set_from_resource $black1 color0 #000000
set_from_resource $black2 color8 #000000
set $trueblack #000000
# red
set_from_resource $red1 color1 #000000
set_from_resource $red2 color9 #000000
# green
set_from_resource $green1 color2 #000000
set_from_resource $green2 color10 #000000
# yellow
set_from_resource $yellow1 color3 #000000
set_from_resource $yellow2 color11 #000000
# blue
set_from_resource $blue1 color4 #000000
set_from_resource $blue2 color12 #000000
# cyan
set_from_resource $cyan1 color6 #000000
set_from_resource $cyan2 color14 #000000
# white
set_from_resource $white1 color7 #000000
set_from_resource $white2 color15 #000000
#---Starting External Scripts---# #
# exec urxvtd daemon
# urxvtc run via Xinitrc because otherwise the scratchpad don't work (race condition?)
# exec --no-startup-id ~/.i3/scripts/urxvtc.sh
# resize correctly in vmware
exec --no-startup-id vmware-user-suid-wrapper
exec --no-startup-id vmware-user
# start owncloud client
exec --no-startup-id owncloud &
#wallpaper
exec --no-startup-id ~/.fehbg
#Hide the mouse after some time
# exec --no-startup-id unclutter
# launch scripts
exec --no-startup-id /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
# launch redshift
exec --no-startup-id redshift -l 52.5200:13.4050
# launch dunst
exec --no-startup-id dunst -config ~/.dunstrc
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# set the modifier (Mod4: cmd)
set $mod Mod4
# Hide the bar
# bindsym $mod+h bar mode toggle
# Mouse doesn't jump from one screen to another
mouse_warping none
bindsym $mod+u border none
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Inconsolata 12
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec urxvtc
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run -fn Inconsolata -nb '$background' -nf '$foreground' -sb '$red1'
# 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+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
bindsym $mod+Ctrl+h move workspace to output left
bindsym $mod+Ctrl+l move workspace to output right
bindsym $mod+Ctrl+j workspace next
bindsym $mod+Ctrl+k workspace prev
# split in horizontal orientation
bindsym $mod+b 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
# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness
# Touchpad controls
#bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
# Media player controls
bindsym XF86AudioPlay exec playerctl play
bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
#############
# workspace #
#############
set $terms "1: terms"
set $web "2: web"
set $db "3: db"
set $file_manager "4: files"
set $mail "5: mails"
set $documents "6: documents"
set $mindmap "7: mindmap"
# switch to workspace
bindsym $mod+1 workspace $terms
bindsym $mod+2 workspace $web
bindsym $mod+3 workspace $db
bindsym $mod+4 workspace $file_manager
bindsym $mod+5 workspace $mail
bindsym $mod+6 workspace $documents
bindsym $mod+7 workspace $mindmap
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 $terms
bindsym $mod+Shift+2 move container to workspace $web
bindsym $mod+Shift+3 move container to workspace $db
bindsym $mod+Shift+4 move container to workspace $file_manager
bindsym $mod+Shift+5 move container to workspace $mail
bindsym $mod+Shift+6 move container to workspace $documents
bindsym $mod+Shift+7 move container to workspace $mindmap
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
# bind software to workspace
# can use xprop - WM_CLASS(STRING) = "urxvt", "URxvt"
#assign [class="URxvt" instance="urxvt"] → $terms
assign [class="Firefox" instance="Navigator"] → $web
assign [class="Min" instance="min"] → $web
assign [class="Chromium" instance="chromium"] → $web
assign [class="Mysql-workbench-bin" instance="mysql-workbench-bin"] → $db
assign [class="Thunar" instance="thunar"] → $file_manager
assign [class="Thunderbird" instance="Mail"] → $mail
assign [instance="libreoffice"] → $documents
assign [instance="evince"] → $documents
assign [instance="FreeMind"] → $mindmap
# start softwares and command lines in workspaces
exec --no-startup-id i3-msg workspace $terms; exec /usr/bin/urxvtc
####################
# restart / reload #
####################
# 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+F12 exec 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 h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l 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
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# floating pop up automatically
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
# floating windows
for_window [class="Keepassx"] floating enable
for_window [class="Arandr"] floating enable
for_window [class="Gcolor2"] floating enable
for_window [instance="gnome-alsamixer" class="Gnome-alsamixer"] floating enable
# Terminal scratchpad
for_window [instance="urxvt_scratchpad"] move to scratchpad, border none
bindsym $mod+Shift+t [instance="urxvt_scratchpad"] scratchpad show
exec urxvtc -name urxvt_scratchpad -e tmux -2 new-session -d -s scratchpad \; new-window -n vim 'nvim +e /tmp/nvim-tmp.md' \; attach-session -d -t scratchpad\;
# htop scratchpad
for_window [instance="htop_scratchpad"] move to scratchpad, border none
bindsym $mod+Shift+p [instance="htop_scratchpad"] scratchpad show
exec urxvtc -name htop_scratchpad -e htop
# keepass scratchpad
for_window [class="Keepassx"] move to scratchpad
bindsym $mod+Shift+a [class="Keepassx"] scratchpad show
exec keepassx
# bc scratchpad
for_window [instance="bc_scratchpad"] move to scratchpad, border none
bindsym $mod+Shift+b [instance="bc_scratchpad"] scratchpad show
exec urxvtc -name bc_scratchpad -e bc
# configuration of some software
for_window [class="URxvt*"] border pixel 1
# no focus following the mouse
focus_follows_mouse no
# using the same workspace shortcut will focus on your last
workspace_auto_back_and_forth yes
##########
# DESIGN #
##########
# hide borders
hide_edge_borders both
# class border backgr. text indicator child_border
client.focused #333333 $white1 $white2 #285577
client.focused_inactive #333333 $background $foreground #484e50
client.unfocused #333333 #222222 #888888 #292d2e #222222
client.urgent $red1 $red1 #ffffff $red1 $red1
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
status_command i3status --config ~/.i3/i3status.conf
# Disable all tray icons
tray_output none
# tray_output primary
colors {
background $black2
statusline $white2
separator $white2
# border background text
focused_workspace $background $background $red1
active_workspace $black2 $black1 $white2
inactive_workspace $black1 $black2 $foreground
urgent_workspace $red1 $red1 $white2
binding_mode $background $red2 $white2
}
}
# lockscreen
set $i3lockwall i3lock -i ~/wallpapers/forest.png -t
# In order to cache an image
# exec --no-startup-id betterlockscreen -u ~/wallpapers/snow_tree.png
# exec --no-startup-id betterlockscreen -w
# set $i3lockwall exec betterlockscreen --lock
bindsym $mod+Ctrl+Shift+l exec --no-startup-id $i3lockwall
#wallpaper and transparency
# exec --no-startup-id compton -b --active-opacity 1 --config ~/.compton --backend xrender --vsync opengl
exec --no-startup-id compton -b --active-opacity 1 --config ~/.compton --backend xrender --vsync none
# shutdown / restart / suspend...
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Ctrl+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id $i3lockwall, mode "default"
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id $i3lockwall && systemctl suspend, mode "default"
bindsym h exec --no-startup-id $i3lockwall && systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym Ctrl+s exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+BackSpace mode "$mode_system"
## Manual management of external displays
set $mode_display Config monitor resolution - Default loopline(1600x900) (d) Loopline triple monitor (t)
mode "$mode_display" {
bindsym d exec --no-startup-id xrandr --output VGA-1 --off --output eDP-1 --primary --mode 1600x900 --pos 0x0 --rotate normal --output HDMI-2 --off --output HDMI-1 --off --output DP-2 --off --output DP-1 --off && ~/.fehbg, mode "default"
bindsym t exec --no-startup-id xrandr --output VGA-1 --mode 1920x1080 --pos 1920x0 --rotate normal --output eDP-1 --primary --mode 1600x900 --pos 3840x120 --rotate normal --output HDMI-2 --off --output HDMI-1 --mode 1920x1200 --pos 0x0 --rotate normal --output DP-2 --off --output DP-1 --off && ~/.fehbg, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+x mode "$mode_display"
exec --no-startup-id ~/.i3/scripts/remaps.sh