i3wm config (scrot)
hallowweed Jun 14, 2015 (wms/i3)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | # 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 http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
set $Alt Mod1
set $programing :programmation
set $office :office
set $files :files
set $mail :mail
set $web :web
set $media :media
set $games :games
set $torrent :torrent
set $irc :irc
set $useless :useless
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# 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 12
#new_window pixel 5
#hide_edge_borders vertical
# Before i3 v4.8, we used to recommend this one as the default:
# 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, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec xfce4-terminal --hide-menubar
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run -fn -bitstream-*-*-r-*-*-17-*-*-*-*-*-*-*
# 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
# 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+x 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+y focus child
# switch to workspace
bindsym $mod+1 workspace $web
bindsym $mod+2 workspace $mail
bindsym $mod+3 workspace $files
bindsym $mod+4 workspace $irc
bindsym $mod+5 workspace $torrent
bindsym $mod+6 workspace $useless
bindsym $mod+7 workspace $media
bindsym $mod+8 workspace $games
bindsym $mod+9 workspace $office
bindsym $mod+0 workspace $programing
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $web
bindsym $mod+Shift+2 move container to workspace $mail
bindsym $mod+Shift+3 move container to workspace $files
bindsym $mod+Shift+4 move container to workspace $irc
bindsym $mod+Shift+5 move container to workspace $torrent
bindsym $mod+Shift+6 move container to workspace $useless
bindsym $mod+Shift+7 move container to workspace $media
bindsym $mod+Shift+8 move container to workspace $games
bindsym $mod+Shift+9 move container to workspace $office
bindsym $mod+Shift+0 move container to workspace $programing
# 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 Control+$Alt+Return exec i3-msg exit
# shutdown computer
bindsym Control+$Alt+Delete exec systemctl poweroff
# reboot computer
bindsym Control+$Alt+BackSpace exec systemctl reboot
# lock screen
bindsym Control+$Alt+l exec mate-screensaver-command -l
# moving forward and backward in the workspace
bindsym Control+$mod+Left workspace prev
bindsym Control+$mod+Right workspace next
# print screen
bindsym Print exec mate-screenshot
# print screen interactive
bindsym Control+Print exec mate-screenshot -i &
# print screen window
bindsym Shift+Print exec mate-screenshot -w
# volume control
bindsym XF86AudioRaiseVolume exec amixer set Master 3%+
bindsym XF86AudioLowerVolume exec amixer set Master 3%-
bindsym XF86AudioMute exec amixer -D pulse set Master 1+ toggle
# 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 d resize shrink width 10 px or 10 ppt
bindsym w resize grow height 10 px or 10 ppt
bindsym s resize shrink height 10 px or 10 ppt
bindsym a 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"
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
mode dock
status_command ~/.i3/measure-net-speed-i3status.bash
position top
workspace_buttons yes
}
# application shortcut
bindsym Control+$Alt+f exec /home/romain/logiciel/firefox/firefox-bin
bindsym Control+$Alt+m exec /usr/bin/thunderbird
bindsym Control+$Alt+o exec /usr/bin/libreoffice -writer
bindsym Control+$Alt+p exec /usr/bin/thunar
bindsym Control+$Alt+k exec gvim
# assigne the application to workspace
assign [instance="libreoffice"] $office
assign [class="Thunderbird"] $mail
assign [class="libreoffice-writer"] $office
assign [class="libreoffice-math"] $office
assign [class="libreoffice-calc"] $office
assign [class="libreoffice-draw"] $office
assign [instance="libreoffice-writer"] $office
assign [instance="libreoffice-math"] $office
assign [instance="libreoffice-calc"] $office
assign [instance="libreoffice-draw"] $office
assign [class="Atom"] $programing
assign [class="Firefox"] $web
assign [instance="Firefox"] $web
assign [class="Caja"] $files
assign [class="Thunar"] $files
assign [class="Steam"] $games
assign [instance="Steam"] $games
assign [class="Exfalso"] $media
assign [class="Quodlibet"] $media
assign [class="Vlc"] $media
assign [class="Atril"] $files
assign [class="Eclipse"] $programing
assign [class="Gimp"] $media
assign [class="Hexchat"] $irc
assign [instance="Hexchat"] $irc
assign [class="Transmission-gtk"] $torrent
assign [instance="Transmission-gtk"] $torrent
assign [class="Gvim"] $programing
# runing commande at boot
exec --no-startup-id setxkbmap ch fr
exec --no-startup-id nitrogen --restore
exec --no-startup-id mate-screensaver &
exec --no-startup-id transmission-gtk -m &
exec --no-startup-id nm-applet
|
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # 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 {
output_format=i3bar
color_good = '#33cc00'
color_degraded = '#ffff66'
color_bad = '#ff0000'
colors = true
interval = 5
}
order += "tztime local"
order += "cpu_usage"
order += "volume master"
tztime local {
format = " %d-%m-%Y %H:%M "
}
volume master {
format = " %volume "
format_muted = " %volume "
device = "default"
mixer = "Master"
mixer_idx = 0
}
cpu_usage {
format = " : %usage"
}
|
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #!/bin/bash
# Public Domain
# (someone claimed the next lines would be useful for… people. So here goes:
# © 2012 Stefan Breunig
# stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de)
# path to store the old results in
path="/dev/shm/measure-net-speed"
# grabbing data for each adapter.
# You can find the paths to your adapters using
# find /sys/devices -name statistics
# If you have more (or less) than two adapters, simply adjust the script here
# and in the next block.
eth0="/sys/devices/pci0000:00/0000:00:1c.5/0000:02:00.0/net/enp2s0/statistics"
read eth0_rx < "${eth0}/rx_bytes"
read eth0_tx < "${eth0}/tx_bytes"
tot=`(free -h | grep "Mem" | cut -c 16-19)`
use=`(free -h | grep "Mem" | cut -c 28-31)`
# get time and sum of rx/tx for combined display
time=$(date +%s)
rx=$(( $eth0_rx ))
tx=$(( $eth0_tx ))
# write current data if file does not exist. Do not exit, this will cause
# problems if this file is sourced instead of executed as another process.
if ! [[ -f "${path}" ]]; then
echo "${time} ${rx} ${tx}" > "${path}"
chmod 0666 "${path}"
fi
# read previous state and update data storage
read old < "${path}"
echo "${time} ${rx} ${tx}" > "${path}"
# parse old data and calc time passed
old=(${old//;/ })
time_diff=$(( $time - ${old[0]} ))
# sanity check: has a positive amount of time passed
if [[ "${time_diff}" -gt 0 ]]; then
# calc bytes transferred, and their rate in byte/s
rx_diff=$(( $rx - ${old[1]} ))
tx_diff=$(( $tx - ${old[2]} ))
rx_rate=$(( $rx_diff / $time_diff ))
tx_rate=$(( $tx_diff / $time_diff ))
# shift by 10 bytes to get KiB/s. If the value is larger than
# 1024^2 = 1048576, then display MiB/s instead (simply cut off
# the last two digits of KiB/s). Since the values only give an
# rough estimate anyway, this improper rounding is negligible.
# incoming
rx_kib=$(( $rx_rate >> 10 ))
if [[ "$rx_rate" -gt 1048576 ]]; then
echo -n " ${rx_kib:0:-3}.${rx_kib: -3:-2} M↓ "
else
echo -n " ${rx_kib} K↓ "
fi
echo -n " "
# outgoing
tx_kib=$(( $tx_rate >> 10 ))
if [[ "$tx_rate" -gt 1048576 ]]; then
echo -n "${tx_kib:0:-3}.${tx_kib: -3:-2} M↑ | : $use / $tot "
else
echo -n "${tx_kib} K↑ | : $use / $tot "
fi
else
echo -n " ? "
fi
|
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/bin/bash
# Public Domain
# (someone claimed the next lines would be useful for… people. So here goes:
# © 2012 Stefan Breunig
# stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de)
# append i3status output to the measure-net-speed’s one. the quote and escape
# magic is required to get valid JSON output, which is expected by i3bar (if
# you want colors, that is. Otherwise plain text would be fine). For colors,
# your i3status.conf should contain:
# general {
# output_format = i3bar
# }
# i3 config looks like this:
# bar {
# status_command measure-net-speed-i3status.bash
# }
i3status -c ~/.i3/i3status.conf | (read line && echo $line && while :
do
read line
dat=$(sh ~/.i3/measure-net-speed.bash)
dat="[{ \"full_text\": \"${dat}\" },"
echo "${line/[/$dat}" || exit 1
done)
|
x
Notes
This is my i3 configuration.
Tips:
-To enable the icons, you have to download the Awesome Font (on their website) , extract and then:
mkdir ~/.fonts/ && cp FontAwesome.otf ~/.fonts/
-all the files go on .i3/
- “firstscript.bash” must be rename as “measure-net-speed.bash” -“secondscript.bash” must be rename as “measure-net-speed-i3status.bash”