diff --git a/i3wm/Authenticator.sh b/i3wm/Authenticator.sh new file mode 100755 index 0000000..d635548 --- /dev/null +++ b/i3wm/Authenticator.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +SECRET_GOOGLE="asdf" +SECRET_FACEBOOK="asdf" +SECRET_DROPBOX="asdf" + +ARG="${1}" + +case ${ARG} in + "google") + jauth -secret=${SECRET_GOOGLE} + ;; + "facebook") + jauth -secret=${SECRET_FACEBOOK} + ;; + "dropbox") + jauth -secret=${SECRET_DROPBOX} + ;; +esac diff --git a/i3wm/config b/i3wm/config new file mode 100644 index 0000000..b07dc65 --- /dev/null +++ b/i3wm/config @@ -0,0 +1,277 @@ +####################################### +# _____ ____ # +# |_ _||___ \ # +# | | __) |__ __ _ __ ___ # +# | | |__ < \ \ /\ / /| '_ ` _ \ # +# _| |_ ___) | \ V V / | | | | | | # +# |_____||____/ \_/\_/ |_| |_| |_| # +# # +####################################### + +############################################# +# General configurations # +############################################# + +# font +set $font "pango:RobotoMono 12" +font $font + +# floating modifier +# mod1 = Alt (xmodmap to show) +# mod4 = Winkey (xmodmap to show) +set $mod mod4 +floating_modifier $mod + +# remove window decorations +new_window pixel + +# focus follows mouse +focus_follows_mouse yes + + +############################################# +# Script Section # +############################################# + +# +# "xev" and "showkeys" can be usefull to determine the keycodes. +# + +# Sound softkeys management +bindsym Print exec ~/.i3/volnotid.sh down +bindsym Scroll_Lock exec ~/.i3/volnotid.sh up +bindsym Pause exec ~/.i3/volnotid.sh mute + +# Display brightness management +bindsym XF86MonBrightnessUp exec "xbacklight +10" +bindsym XF86MonBrightnessDown exec "xbacklight -10" + +# Lenovo Key wifi-menu +bindsym XF86Launch1 exec urxvt -e sh -c "sudo wifi-menu wlp3s0" + +# jauth two factor authenticator +bindsym $mod+F1 exec ~/.i3/Authenticator.sh google +bindsym $mod+F2 exec ~/.i3/Authenticator.sh facebook +bindsym $mod+F3 exec ~/.i3/Authenticator.sh dropbox + +# start dmenu-launcher +bindsym $mod+d exec ~/.i3/i3dmenu-wrapper.sh + +# lock i3 with i3lock +bindsym $mod+Shift+x exec ~/.i3/i3blur.py && systemctl suspend + +############################################# +# Keymaps # +############################################# + +# start terminal +bindsym $mod+Return exec --no-startup-id i3-sensible-terminal + +# kill focused window +bindsym $mod+Shift+q kill + +# change focus vim Style +bindsym $mod+h focus left +bindsym $mod+l focus right +bindsym $mod+j focus up +bindsym $mod+k focus down + +# move focused window vim Style +bindsym $mod+Shift+h move left +bindsym $mod+Shift+l move right +bindsym $mod+Shift+j move up +bindsym $mod+Shift+k move down + +# 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+v split h + +# split in vertical orientation +bindsym $mod+c 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 +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 + +# reload the configuration file +bindsym $mod+Shift+c reload + +# restart i3 inplace +bindsym $mod+Shift+r restart + +# exit i3 +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Exit i3?' -b 'Yes' 'i3-msg exit'" + +# enter the resize mode +bindsym $mod+r mode "resize" + +# scratchpad +bindsym $mod+y scratchpad show +bindsym $mod+x move scratchpad + +############################################# +# Workspace & Tags # +############################################# + +# name for the workspaces +set $tag1 "1 Terminal" +set $tag2 "2 Internet" +set $tag3 "3 Coding" +set $tag4 "4 Music" + +# switch to workspace +bindsym $mod+1 workspace $tag1 +bindsym $mod+2 workspace $tag2 +bindsym $mod+3 workspace $tag3 +bindsym $mod+4 workspace $tag4 +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 $tag1 +bindsym $mod+Shift+2 move container to workspace $tag2 +bindsym $mod+Shift+3 move container to workspace $tag3 +bindsym $mod+Shift+4 move container to workspace $tag4 +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 + +############################################# +# Resize handling # +############################################# + +mode "resize" { + # bindings to resize + 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 + + # back to normal + bindsym Return mode "default" + bindsym Escape mode "default" +} + +############################################# +# Colors # +############################################# + +# colorscheme +set $DARKBROWN #402e2e +set $LIGHTBROWN #978965 +set $DARKGREY #1f1f1f +set $DARKRED #9b0e0e + +# name #top #border #text +client.focused $DARKBROWN $LIGHTBROWN $DARKBROWN +client.unfocused $DARKBROWN $DARKBROWN $LIGHTBROWN +client.focused_inactive $DARKBROWN $DARKBROWN $LIGHTBROWN +client.urgent $DARKBROWN $DARKBROWN $LIGHTBROWN + + +############################################# +# i3-bar # +############################################# + +bar { + position top + font $font + i3bar_command /usr/bin/i3bar + status_command i3status -c ~/.i3/i3status.conf + separator_symbol ".::" + + colors { + statusline $LIGHTBROWN + background $DARKGREY + separator $DARKRED + + # name #border #bg #text + focused_workspace $LIGHTBROWN $DARKBROWN $LIGHTBROWN + active_workspace $DARKBROWN $DARKBROWN $LIGHTBROWN + inactive_workspace $DARKBROWN $DARKBROWN $LIGHTBROWN + urgent_workspace $DARKBROWN $DARKBROWN $LIGHTBROWN + } +} + +############################################# +# specific windows # +############################################# + +# always floating +for_window [class="Thunar"] floating enable +for_window [class="Nautilus"] floating enable +for_window [class="GParted"] floating enable +for_window [class="Gedit"] floating enable +for_window [class="Evince"] floating enable +for_window [class="Telegram"] floating enable +for_window [class="teamspeak3"] floating enable +for_window [class="rhythmbox"] floating enable +for_window [class="LibreOffice"] floating enable +for_window [class="JAuth"] floating enable + +# 0px Border +for_window [class="chrome"] border none +for_window [class="Firefox"] border none + +# 1px Border +for_window [class="URxvt" ] border 1pixel + +############################################# +# auto start with i3 # +############################################# + +# less eye pain +exec --no-startup-id redshift-gtk +exec --no-startup-id compton -cCGb + +# fucking no beep! +exec --no-startup-id xset b off + +# set dpi for my monitor +exec --no-startup-id xrandr --dpi 81 + +# set mouse accel +exec --no-startup-id xset m 1/4 1 + +# volnoti volume changer +exec --no-startup-id volnoti + +# numlock on by default +exec --no-startup-id numlockx on + +# wallpapers +exec --no-startup-id nitrogen --restore + +# archlinux update notifier +exec --no-startup-id aarchup + +# dropbox daemon +exec dropbox start + +# telegram +#exec -no-startup-id telegram-desktop diff --git a/i3wm/i3blur.py b/i3wm/i3blur.py new file mode 100755 index 0000000..6eec5fe --- /dev/null +++ b/i3wm/i3blur.py @@ -0,0 +1,48 @@ +#!/usr/bin/python2 +import gtk.gdk +import os, sys +from PIL import ImageFilter +from PIL import Image + +# Get screen and its size +w = gtk.gdk.get_default_root_window() +sz = w.get_size() + +print "[DEBUG]: The size of the window is %d x %d" % sz + +# Get a drawable with the size of the desktop +scr = gtk.gdk.Pixbuf( gtk.gdk.COLORSPACE_RGB, + False, + 8, + sz[0], + sz[1]) + +# Fill it with the screenshot +scr = scr.get_from_drawable(w, + w.get_colormap(), + 0, + 0, + 0, + 0, + sz[0], + sz[1]) + +# Save the screenshot as png +if(scr != None): + scr.save("/tmp/i3screen.png","png") + print "[DEBUG]: Screenshot saved to /tmp/i3screen.png." +else: + print "[DEBUG]: Unable to get the screenshot." + +# Load the screenshot as image and blur it +iml = Image.open("/tmp/i3screen.png") +iml = iml.filter(ImageFilter.BLUR) + +# Save the blured screenshot and call i3lock +if(iml != None): + iml.save("/tmp/i3screenblr.png", "png") + os.system("i3lock -i /tmp/i3screenblr.png") + print "[DEBUG]: Screenshot blured and saved to /tmp/i3screenblr.png." +else: + print "[DEBUG]: Unable to blur the screenshot." + diff --git a/i3wm/i3dmenu-wrapper.sh b/i3wm/i3dmenu-wrapper.sh new file mode 100755 index 0000000..b05523f --- /dev/null +++ b/i3wm/i3dmenu-wrapper.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +BACKGROUND='#402e2e' +FOREGOURND='#978965' +SELECTED_BACKGROUND='#808080' +SELECTED_FOREGROUND='#ffff00' + +i3-dmenu-desktop --dmenu='dmenu -i -nb '#402e2e' -nf '#978965' -sb '#808080' -sf '#ffff00' -l 8' diff --git a/i3wm/i3status.conf b/i3wm/i3status.conf new file mode 100644 index 0000000..9a7c253 --- /dev/null +++ b/i3wm/i3status.conf @@ -0,0 +1,63 @@ +# i3status configuration file. + +general { + colors = true + interval = 1 +} + +#order += "ipv6" +order += "disk /home" +order += "disk /" +order += "disk /media/Data1" +order += "disk /media/Data2" +order += "run_watch VPN" +order += "ethernet eth0" +order += "cpu_temperature 0" +order += "volume master" +order += "tztime local" + +ethernet eth0 { + format_up = "๐Ÿ”Œ %ip (%speed)" + format_down = "๐Ÿ”Œ down" +} + +run_watch DHCP { + pidfile = "/var/run/dhclient*.pid" +} + +run_watch VPN { + pidfile = "/var/run/vpn/pid" +} + +tztime local { + format = " ๐Ÿ“… %d-%m-%Y ๐Ÿ•‘ %H:%M:%S" +} + +cpu_temperature 0 { + format = "๐ŸŒก %degrees ยฐC" + max_threshold = 65 + path = "/sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input" +} + +disk "/" { + format = "root: %free" +} + +disk "/home" { + format = "home: %free" +} + +disk "/media/Data1" { + format = "data1: %free" +} + +disk "/media/Data2" { + format = "data2: %free" +} + +volume master { + format = "โ™ช %volume" + device = "default" + mixer = "Master" + mixer_idx = 0 +} diff --git a/i3wm/volnotid.sh b/i3wm/volnotid.sh new file mode 100755 index 0000000..9633b2e --- /dev/null +++ b/i3wm/volnotid.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +VOLUME=$(amixer get Master | grep Mono: | sed 's|[^[]*\[\([0-9]*\).*|\1|') +VALUE=3dB +MUTE=0 + +case "$1" in + "up") + # Increase Volume + [[ "$VOLUME" -eq 100 ]] && VALUE=0 + amixer -q set Master $VALUE+ unmute && killall -SIGUSR1 i3status + MUTE=0 + ;; + "down") + # Decrease Volume + amixer -q set Master $VALUE- unmute && killall -SIGUSR1 i3status + MUTE=0 + # If the Volume is already 0, then mute + if [ "$VOLUME" == "0" ]; then + MUTE=1 + amixer -q set Master toggle && killall -SIGUSR1 i3status + fi + ;; + "mute") + # Mute + amixer -q set Master toggle && killall -SIGUSR1 i3status + MUTE=1 + ;; +esac + +VOLUME=$(amixer get Master | grep Mono: | sed 's|[^[]*\[\([0-9]*\).*|\1|') + +if [ "$MUTE" == "0" ]; then + volnoti-show $VOLUME +else + volnoti-show -m $VOLUME +fi diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..077bd16 --- /dev/null +++ b/vim/vimrc @@ -0,0 +1,25 @@ +"vimrc - VIM Configuration file" + +"Autointend" +:set cindent + +"Tabstop, Shiftwith and replace tabs with spaces" +:set tabstop=4 +:set shiftwidth=4 +:set expandtab + +"Stuff needed by urxvt" +:set nocompatible +:set mouse=a +:set backspace=2 + +"Syntaxhighlighting, colorscheme, linenumbers" +:syntax on +:colorscheme calmar256-dark +:set number +:set list +:set nowrap +:set hlsearch + +"Automaticly reread a file, if file has changed" +set autoread diff --git a/zsh/zshrc b/zsh/zshrc new file mode 100644 index 0000000..34c77fe --- /dev/null +++ b/zsh/zshrc @@ -0,0 +1,108 @@ +autoload -U compinit promptinit +compinit +promptinit + +# History +export HISTSIZE=100000 +export HISTFILE="$HOME/.history" +export SAVEHIST=$HISTSIZE +setopt hist_ignore_all_dups +setopt hist_ignore_space + +# Promptstyle +prompt walters + +# Autocomplete stuff +zstyle ':completion:*' menu select +setopt completealiases +typeset -A key + +# Key settings +key[Home]=${terminfo[khome]} +key[End]=${terminfo[kend]} +key[Insert]=${terminfo[kich1]} +key[Delete]=${terminfo[kdch1]} +key[Up]=${terminfo[kcuu1]} +key[Down]=${terminfo[kcud1]} +key[Left]=${terminfo[kcub1]} +key[Right]=${terminfo[kcuf1]} +key[PageUp]=${terminfo[kpp]} +key[PageDown]=${terminfo[knp]} + +# Key bindings +[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line +[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line +[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode +[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char +[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history +[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history +[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char +[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char +[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history +[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history +[[ -n ${key[Backspace]} ]] && bindkey "${key[Backspace]}" backward-delete-char +[[ -n ${key[Insert]} ]] && bindkey "${key[Insert]}" overwrite-mode +[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line +[[ -n ${key[PageUp]} ]] && bindkey "${key[PageUp]}" up-line-or-history +[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char +[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line +[[ -n ${key[PageDown]} ]] && bindkey "${key[PageDown]}" down-line-or-history +[[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-line-or-search +[[ -n ${key[Left]} ]] && bindkey "${key[Left]}" backward-char +[[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-line-or-search +[[ -n ${key[Right]} ]] && bindkey "${key[Right]}" forward-char +[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" history-beginning-search-backward +[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" history-beginning-search-forward +bindkey "[C" forward-word +bindkey "[D" backward-word + +if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then + function zle-line-init () { + printf '%s' "${terminfo[smkx]}" + } + function zle-line-finish () { + printf '%s' "${terminfo[rmkx]}" + } + zle -N zle-line-init + zle -N zle-line-finish +fi + +DIRSTACKFILE="$HOME/.cache/zsh/dirs" +if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then + dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) + [[ -d $dirstack[1] ]] && cd $dirstack[1] +fi +chpwd() { + print -l $PWD ${(u)dirstack} >$DIRSTACKFILE +} + +DIRSTACKSIZE=20 + +# Colored manpages +man() { + env LESS_TERMCAP_mb=$'\E[30;43m' \ + LESS_TERMCAP_md=$'\E[01;38;5;74m' \ + LESS_TERMCAP_me=$'\E[0m' \ + LESS_TERMCAP_se=$'\E[0m' \ + LESS_TERMCAP_so=$'\E[38;5;246m' \ + LESS_TERMCAP_ue=$'\E[0m' \ + LESS_TERMCAP_us=$'\E[04;38;5;146m' \ + man "$@" +} + +alias ll="ls -l" +alias llm='ls -al | more' +alias ls='ls --color=auto' +alias grep='grep --color=auto' +alias egrep='egrep --color=auto' +alias fgrep='fgrep --color=auto' +alias diff='colordiff' +alias ports='netstat -tulanp' +alias penis="cowsay -f head-in ahh ja so lรคssig" + +setopt autopushd pushdsilent pushdtohome +setopt pushdignoredups +setopt pushdminus +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +rehash +setopt nohashdirs