initial commit

This commit is contained in:
Felix Buehler 2017-01-26 13:48:55 +01:00
commit 86a1da2632
35 changed files with 1162 additions and 0 deletions

63
i3/Xresources Normal file
View file

@ -0,0 +1,63 @@
xterm*selectToClipboard: true
xterm*faceName: Source Code Pro:size=10
xterm*font: 8x13
xterm*saveLines: 4096
xterm*locale: true
xterm*termName: xterm-256color
xterm*borderWidth: 0
xterm*scrollTtyOutput: false
xterm*scrollKey: true
XTerm*VT100.AutoWrap: true
xterm*allowWindowOps: true
XTerm*VT100.utf8Title: true
! http://unix.stackexchange.com/questions/227701/how-to-use-ctrl-insert-to-copy-from-xterm
XTerm*VT100.Translations: #override\n\
Shift Ctrl <KeyPress> v: insert-selection(CLIPBOARD)\n\
Shift Ctrl <KeyPress> c: copy-selection(CLIPBOARD)\n
! Color definition
#define COLOR_THEME_FG #E0E0E0
#define COLOR_THEME_BG #080808
! Colours stolen from user 'Barrucadu' in the ArchLinux Thread:
! https://bbs.archlinux.org/viewtopic.php?pid=652678#p652678
#define COLOR_THEME_BLACK #202426
#define COLOR_THEME_DARK_RED #B80000
#define COLOR_THEME_DARK_GREEN #04822A
#define COLOR_THEME_DARK_YELLOW #804400
#define COLOR_THEME_DARK_BLUE #193B6B
#define COLOR_THEME_DARK_MAGENTA #5C3F61
#define COLOR_THEME_DARK_CYAN #036466
#define COLOR_THEME_DARK_GREY #555753
#define COLOR_THEME_LIGHT_GREY #D7D4D7
#define COLOR_THEME_LIGHT_RED #E62727
#define COLOR_THEME_LIGHT_GREEN #23994A
#define COLOR_THEME_LIGHT_YELLOW #D77200
#define COLOR_THEME_LIGHT_BLUE #547599
#define COLOR_THEME_LIGHT_MAGENTA #946D90
#define COLOR_THEME_LIGHT_CYAN #059799
#define COLOR_THEME_WHITE #EBE8EB
*color0: COLOR_THEME_BLACK
*color8: COLOR_THEME_DARK_GREY
*color1: COLOR_THEME_DARK_RED
*color9: COLOR_THEME_LIGHT_RED
*color2: COLOR_THEME_DARK_GREEN
*color10: COLOR_THEME_LIGHT_GREEN
*color3: COLOR_THEME_DARK_YELLOW
*color11: COLOR_THEME_LIGHT_YELLOW
*color4: COLOR_THEME_DARK_BLUE
*color12: COLOR_THEME_LIGHT_BLUE
*color5: COLOR_THEME_DARK_MAGENTA
*color13: COLOR_THEME_LIGHT_MAGENTA
*color6: COLOR_THEME_DARK_CYAN
*color14: COLOR_THEME_LIGHT_CYAN
*color7: COLOR_THEME_LIGHT_GREY
*color15: COLOR_THEME_WHITE
*foreground: COLOR_THEME_FG
*background: COLOR_THEME_BG

7
i3/checknofullscreen.sh Executable file
View file

@ -0,0 +1,7 @@
#! /bin/bash
FOCUSED=$(xprop -root _NET_ACTIVE_WINDOW | awk -F' ' '{print $NF}')
if xprop -id ${FOCUSED} _NET_WM_STATE | grep -q _NET_WM_STATE_FULLSCREEN; then
exit 1
else
exit 0
fi

229
i3/i3config Normal file
View file

@ -0,0 +1,229 @@
set $mod Mod4
floating_modifier $mod
exec setxkbmap de -option ctrl:nocaps
exec --no-startup-id xsetroot -solid "#2F343F"
# startup programs:
#exec --no-startup-id hsetroot -center ~/.wallpaper
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec --no-startup-id nm-applet
exec --no-startup-id gnome-keyring-daemon
exec --no-startup-id /usr/bin/feedreader-daemon
exec --no-startup-id ~/.local/bin/xmon default
exec --no-startup-id ~/.local/bin/lockscreen -d
exec --no-startup-id albert
exec --no-startup-id owncloud
exec --no-startup-id seafile-applet
exec --no-startup-id telegram-desktop -startintray
exec --no-startup-id redshift-gtk
exec --no-startup-id rhythmbox
exec --no-startup-id firefox
font pango:Fira Sans Mono 12
##Various
assign [class="Evolution"] 9
for_window [class="Evolution"] move workspace 9
assign [class="Rhythmbox"] 10
for_window [class="Rhythmbox"] move workspace 10
hide_edge_borders both
focus_follows_mouse no
# to switch workspace-tabs
bindsym $mod+Tab workspace next
bindsym Shift+$mod+Tab workspace prev
bindsym $mod+m exec keepassx2
bindsym $mod+e exec subl3
bindsym $mod+w exec firefox
# ESP8266
bindsym $mod+F1 exec curl http://esp8266/socket0Toggle || curl http://home.stunkymonkey.de:61611/socket0Toggle
bindsym $mod+Shift+F1 exec curl http://esp8266/socket0Off || curl http://home.stunkymonkey.de:61611/socket0Off
# Screenshot
bindsym Print exec "scrot ~/Downloads/Screenshot%Y-%m-%d-%H:%M:%S.png -z"
# forward an backward at arrow-keys
bindsym --release XF86Back exec --no-startup-id xdotool key --clearmodifiers Ctrl+Page_Up
bindsym --release XF86Forward exec --no-startup-id xdotool key --clearmodifiers Ctrl+Page_Down
set $bg-color #2F343F
set $inactive-bg-color #2F343F
set $text-color #F3F4F5
set $inactive-text-color #676E7D
set $urgent-bg-color #E53935
set $indicator-color #00FF00
set $workspace-color #5294E2
set $inactive-workspace #2F343F
set $seperator-color #666666
set $ws-text-color #FFFFFF
set $ws-inactive-text-color #D3DAE3
# window colors
client.focused $bg-color $bg-color $text-color $indicator-color
client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color $indicator-color
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color $indicator-color
client.urgent $urgent-bg-color $urgent-bg-color $text-color $indicator-color
bar {
status_command i3status
position top
workspace_buttons yes
colors {
background $bg-color
statusline $ws-inactive-text-color
separator $seperator-color
focused_workspace $workspace-color $workspace-color $ws-text-color
active_workspace $inactive-workspace $inactive-workspace $ws-inactive-text-color
inactive_workspace $inactive-workspace $inactive-workspace $ws-inactive-text-color
urgent_workspace $urgent-bg-color $urgent-bg-color $ws-text-color
}
}
# Sreen brightness controls
#increase screen brightness
bindsym XF86MonBrightnessUp exec xbacklight -inc 10
#decrease screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 10
# Touchpad controls
#bindsym XF86TouchpadToggle exec /some/path/toggletouchpad.sh # toggle touchpad
# 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
# Media player controls
bindsym XF86AudioPlay exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
bindsym XF86AudioPause exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
bindsym XF86AudioNext exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
bindsym XF86AudioPrev exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
# Microphone
bindsym XF86AudioMicMute exec pulseaudio-ctl mute-input #toggle
##firefox bughelper
bindsym $mod+^ floating toggle; floating toggle;
# main commands
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exit
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# screensaver
bindsym $mod+z exec ~/.local/bin/lockscreen -fl
bindsym $mod+y exec ~/.local/bin/lockscreen -fl
# start dmenu (a program launcher)
bindsym $mod+x exec --no-startup-id i3-dmenu-desktop --entry-type=command
bindsym $mod+d exec --no-startup-id albert && albert show
# kill focused window
bindsym $mod+Shift+q kill
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
bindsym $mod+g fullscreen global
# change layouts
bindsym $mod+b split h
bindsym $mod+v split v
bindsym $mod+c layout toggle split
#bindsym $mod+z layout stacking
#bindsym $mod+t layout tabbed
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
#bindsym $mod+space focus mode_toggle
# focus the child container
bindsym $mod+s focus child
# focus the parent container
bindsym $mod+a focus parent
bindsym Mod1+Left move workspace to output left
bindsym Mod1+Right move workspace to output right
bindsym Mod1+Up move workspace to output up
bindsym Mod1+Down move workspace to output down
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
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
bindsym $mod+Shift+2 move container to workspace 2
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
# move windows to workspace and switch to it
bindsym Ctrl+1 move container to workspace 1; workspace 1
bindsym Ctrl+2 move container to workspace 2; workspace 2
bindsym Ctrl+3 move container to workspace 3; workspace 3
bindsym Ctrl+4 move container to workspace 4; workspace 4
bindsym Ctrl+5 move container to workspace 5; workspace 5
bindsym Ctrl+6 move container to workspace 6; workspace 6
bindsym Ctrl+7 move container to workspace 7; workspace 7
bindsym Ctrl+8 move container to workspace 8; workspace 8
bindsym Ctrl+9 move container to workspace 9; workspace 9
# for settings the zoom-level back to default in firefox
#bindsym Ctrl+0 move container to workspace 10; workspace 10
bindsym $mod+n exec i3-input -F 'rename workspace to "%s"' -P 'New name: '
#FOCUS
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
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
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# resize window (you can also use the mouse for that)
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize shrink height 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Up resize grow height 10 px or 10 ppt
bindsym Down resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"

77
i3/i3status Normal file
View file

@ -0,0 +1,77 @@
general {
output_format = "i3bar"
colors = true
interval = 2
color_good = "#60FF60"
color_degraded = "#FFFF60"
color_bad = "#FF6060"
}
order += "disk /"
order += "disk /home"
order += "ipv6"
order += "wireless wlp3s0"
order += "ethernet enp0s25"
order += "cpu_usage"
order += "volume master"
order += "battery 0"
order += "time"
time {
format = "%a %d.%m.%Y %H:%M:%S"
}
disk "/" {
format = " %avail"
low_threshold = 10
threshold_type = percentage_free
}
disk "/home" {
format = " %avail"
low_threshold = 10
threshold_type = percentage_free
}
volume master {
format = " %volume"
format_muted = ""
device = "default"
mixer = "Master"
}
ipv6 {
format_up = "v6"
#format_up = "%ip"
format_down = "v6"
}
wireless wlp3s0 {
format_up = "( %quality  %essid  %bitrate) %ip"
format_down = ""
}
ethernet enp0s25 {
format_up = "( %speed) %ip"
format_down = ""
}
battery 0 {
format = "%status %percentage %remaining %emptytime"
format_down = "No battery"
status_chr = ""
status_bat = ""
status_full = ""
hide_seconds = true
integer_battery_capacity = true
last_full_capacity = true
path = "/sys/class/power_supply/BAT%d/uevent"
low_threshold = 10
threshold_type = percentage
}
cpu_usage {
format = " %usage"
}

5
i3/locknow.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/bash
xautolock -enable
sleep 1
xautolock -locknow

92
i3/lockscreen.sh Executable file
View file

@ -0,0 +1,92 @@
#!/usr/bin/bash
[ -f "~/.lockvars" ] && [ -r "~/.lockvars" ] && . ~/.lockvars
LOCK_TIME=${LOCK_TIME:-3}
LOCK_NOTIFY_TIME=${LOCK_NOTIFY_TIME:-15}
PROGNAME=$(basename $0)
OUTPUT_IMAGE="/tmp/i3lock.png"
error(){
echo -e '\e[01;31m'$*'\e[0m' >&2
}
usage(){
#TODO
cat >&2 <<-FIN
Usage:
-f force lock
-l execute the locker
-n send notification
-d execute the xautolock daemon
-h help
Mind, that the options are order-sensitive. -lf != -fl && -l == -lf
(-fl is probably the thing you want)
FIN
exit 1
}
checkfull(){
[ 1 -eq "$force" ] || ~/.local/bin/checknofullscreen
}
lock(){
scrot -z $OUTPUT_IMAGE
convert $OUTPUT_IMAGE -resize 20% -level 0%,100%,0.9 -blur 0x2 -resize 500% $OUTPUT_IMAGE
i3lock -i $OUTPUT_IMAGE -t
rm $OUTPUT_IMAGE
}
notification(){
notify-send \
-u critical \
-t 5000 \
-i screensaver \
"Locking Screen" \
"Will Lock Screen in 15s"
}
daemon(){
xautolock \
-time $LOCK_TIME \
-locker "$0 -l" \
-nowlocker "$0 -fl" \
-notify $LOCK_NOTIFY_TIME \
-notifier "$0 -n" \
-noclose
}
force=0
while getopts ":hdfln" opt; do
case $opt in
h)
usage
;;
f)
force=1
;;
l)
checkfull && lock
;;
n)
checkfull && notification
;;
d)
daemon
;;
\?)
error "Invalid option: -args"
usage
;;
:)
error "Option -args requires an argument."
usage
;;
esac
done
exit 0