commit 6252ec3a090f8f5ab026b8c4cd607a84427a7cc6 Author: Hannes Körber Date: Sat Sep 14 14:35:23 2013 +0200 Initial commit. diff --git a/bash/bash_aliases b/bash/bash_aliases new file mode 100644 index 0000000..0623cea --- /dev/null +++ b/bash/bash_aliases @@ -0,0 +1,46 @@ +# File to define bash aliases. Read by ~/.bashrc. + +alias ll='ls -AlF' +alias la='ls -A' + +alias ls='ls --group-directories-first --classify --color=auto' + +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' + +alias rm='rm -v' +alias cp='cp -v' +alias mv='mv -v' +alias ln='ln -v' + +#alias 'sudo rm -rf --no-preserve-root /'='echo "..."' +#alias 'sudo find / -delete'='echo "..."' + +alias du='du -h' +alias df='df -h' + +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias .....='cd ../../../..' + +alias root='sudo -sE' + +alias back='cd $OLDPWD' + +alias more='less' + +alias sag='sudo apt-get' +alias sagi='sudo apt-get install' +alias sagu='sudo apt-get update' +alias sagug='sudo apt-get upgrade' +alias sagdug='sudo apt-get dist-upgrade' +alias sources='cat /etc/apt/sources.list /etc/apt/sources.list.d/*' + +alias cs="cryptsetup" + +alias le_haxxor_1='clear && dmesg | pv -qL $[15 + (RANDOM % 10)]' +alias le_haxxor_2='clear && hexdump -C /dev/urandom | grep "1e 4c"' + +alias YOLO="pacman -Syu --force" diff --git a/bash/bash_functions b/bash/bash_functions new file mode 100644 index 0000000..fb04401 --- /dev/null +++ b/bash/bash_functions @@ -0,0 +1,91 @@ +#!/bin/bash +# File to define bash functions. Read by ~/.bashrc. + +function mount() { + if [[ $# == 0 ]] ; then + /usr/bin/env mount | column -t + else + /usr/bin/env mount $* + fi +} + +ff() { + find . -type f -iname "*"$*"*" ; +} + +ffcs() { + find . -type f -name "*"$*"*" ; +} + +extract() # Handy Extract Program. +{ + if [ -f $1 ] ; then + case $1 in + *.tar.bz2 ) tar xvjf $1 ;; + *.tar.gz ) tar xvzf $1 ;; + *.bz2 ) bunzip2 $1 ;; + *.rar ) unrar x $1 ;; + *.gz ) gunzip $1 ;; + *.tar ) tar xvf $1 ;; + *.tbz2 ) tar xvjf $1 ;; + *.tgz ) tar xvzf $1 ;; + *.zip ) unzip $1 ;; + *.Z ) uncompress $1 ;; + *.7z ) 7z x $1 ;; + *) echo "$1 cannot be extracted via extract()" ;; + esac + else + echo "$1 is not a valid file" + fi +} + +update() { + sudo bash -c "apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove" +} + +showclock() { + while : ; do + clear + echo "========" + date +"%T" + echo "========" + sleep 1 + done +} + +ruler() { + for s in '....^....|' '1234567890'; do + w=${#s} + str=$(for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done ) + str=$(echo $str | cut -c -$COLUMNS) + echo $str + done +} + +up() { + [ "${1/[^0-9]/}" == "$1" ] && { + local ups="" + for i in $(seq 1 $1) + do + ups=$ups"../" + done + cd $ups + } || echo "usage: up " +} + +ckwww() { + ping -c 3 www.google.com +} + +topcmds() { + history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head +} + +fnottype() { + find . -maxdepth 1 ! -type $1 +} + +# simple calculator +? () { + echo "$*" | bc -l +} diff --git a/bash/bash_greeting b/bash/bash_greeting new file mode 100644 index 0000000..790366b --- /dev/null +++ b/bash/bash_greeting @@ -0,0 +1,11 @@ +# File with instructions to greet the user. Read at the end of ~/.bashrc + +#COUNTER_DESTROYED=3 + + +clear +#echo -ne "${NC}Hello, $USER. Today is $(date +"%A, %-d %B %Y, %T")\n\n" +#echo -ne "${NC}" ; ncal -MC +#echo -ne "${NC}System is $(uptime | grep -o "up.*:[[:digit:]][[:digit:]]" | tr -s " ") hours\n" +#echo -ne "${NC}Your personal counter for destroyed linuxes is: $COUNTER_DESTROYED\n" +#echo -ne "${NC}Keep it up and have fun.\n" diff --git a/bash/bash_logout b/bash/bash_logout new file mode 100644 index 0000000..de4f5f7 --- /dev/null +++ b/bash/bash_logout @@ -0,0 +1,7 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/bash/bash_profile b/bash/bash_profile new file mode 100644 index 0000000..e69de29 diff --git a/bash/bash_prompt b/bash/bash_prompt new file mode 100644 index 0000000..76d7d29 --- /dev/null +++ b/bash/bash_prompt @@ -0,0 +1,18 @@ +### File to set the prompt of bash. Read by ~/.bashrc +### +### Usable veriables: +### \h Hostname auf dem die Shell läuft bis zum ersten "." +### \H Hostname komplett +### \t Uhrzeit im 24-Stunden Format (hh:mm:ss) +### \T Uhrzeit im 12-Stunden Format (hh:mm:ss) +### \u Name des Nutzers, der die Shell gestartet hat +### \w momentanes Arbeitsverzeichnis +### \W letzte Komponente des Arbeitsverzeichnisses +### \$ Wenn root ein "#", sonst ein "$" +### \\ Backslash + +export PS1="\[${BLUE}\][\t] [\!] \[${GREEN}\]\u\[${NC}\]@\[${RED}\]\h\[${NC}\]:\[${YELLOW}\] \w \[${NC}\]\$> " + +#export PS1=">" + +#export PS1="[\t] [\!] \u@\h: \w \$> " diff --git a/bash/bash_variables b/bash/bash_variables new file mode 100644 index 0000000..88b5ff7 --- /dev/null +++ b/bash/bash_variables @@ -0,0 +1,7 @@ +#!/bin/bash +export USERBIN=$HOME/bin + +export ENCFS_MOUNT="$HOME/.crypt/encfs/mount" +export ENCFS_DEV="$HOME/.crypt/encfs/dev" + +export MOZ_DISABLE_PANGO=1 diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 0000000..d08ab7c --- /dev/null +++ b/bash/bashrc @@ -0,0 +1,60 @@ +# If not interactive, do nothing. +[ -z "$PS1" ] && return + +HISTCONTROL=ignoreboth +shopt -s histappend +HISTSIZE="unlimited" +HISTFILESIZE="unlimited" +HISTCONTROL=ignorespace + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +BLACK='\e[0;30m' +BLUE='\e[0;34m' +GREEN='\e[0;32m' +CYAN='\e[0;36m' +RED='\e[0;31m' +PURPLE='\e[0;35m' +BROWN='\e[0;33m' +LIGHTGRAY='\e[0;37m' +DARKGRAY='\e[1;30m' +LIGHTBLUE='\e[1;34m' +LIGHTGREEN='\e[1;32m' +LIGHTCYAN='\e[1;36m' +LIGHTRED='\e[1;31m' +LIGHTPURPLE='\e[1;35m' +YELLOW='\e[1;33m' +WHITE='\e[1;37m' +NC='\e[0m' # No Color + +# Sets default editor. +export EDITOR=vim + +# adding some other program paths to PATH +export PATH=${PATH}:/sbin:/usr/sbin:usr/local/bin +# adding a user's private path if it exists +[ -d ~/bin/ ] && export PATH=${PATH}:${HOME}/bin + +[ -f /etc/bash_completion ] && . /etc/bash_completion + +export BASH_ALIASES="$HOME/.bash_aliases" +export BASH_FUNCTIONS="$HOME/.bash_functions" +export BASH_PROMPT="$HOME/.bash_prompt" +export BASH_GREETING="$HOME/.bash_greeting" +export BASH_VARIABLES="$HOME/.bash_variables" + +[ -f "$BASH_ALIASES" ] && . "$BASH_ALIASES" +[ -f "$BASH_FUNCTIONS" ] && . "$BASH_FUNCTIONS" +[ -f "$BASH_PROMPT" ] && . "$BASH_PROMPT" +[ -f "$BASH_GREETING" ] && . "$BASH_GREETING" +[ -f "$BASH_VARIABLES" ] && . "$BASH_VARIABLES" diff --git a/git/gitconfig b/git/gitconfig new file mode 100644 index 0000000..5acba0f --- /dev/null +++ b/git/gitconfig @@ -0,0 +1,31 @@ +[user] + name = Hannes Körber + email = hannes.koerber@gmail.com +[alias] + untrack = "rm --cached" + unstage = "reset HEAD" + unmodify = "checkout --" + ignore-changes = "update-index --assume-unchangend" + unignore-changes = "update-index --no-assume-unchanged" + visual = "!gitk" + + co = "checkout" + ci = "commit" + st = "status" + br = "branch" + rb = "rebase" + + last = "log -1 HEAD" +[core] + editor = vim + pager = less + whitespace = "" + excludesfile = "~/.gitignore_global" +[color] + ui = true +[gui] + recentrepo = /home/hannes/programming/git-repositories/autobackup +[push] + default = simple +[merge] + tool = vimdiff diff --git a/git/gitignore_global b/git/gitignore_global new file mode 100644 index 0000000..fb9d52c --- /dev/null +++ b/git/gitignore_global @@ -0,0 +1,82 @@ +# http://github.com/github/gitignore + +### Linux +.* +!.gitignore +*~ + +### Windows +# image file caches +Thumbs.db +ehthumbs.db +# Folder config file +Desktop.ini +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +### Mac OSX +.DS_Store +.AppleDouble +.LSOverride +Icon +# Thumbnails +._* +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +### compiled source +*.com +*.class +*.dll +*.exe +*.o +*.so + +### packages +# it's better to unpack these files and commit the raw source +# git has its own built in compression methods +*.7z +*.jar +*.rar +*.zip +*.gz +*.bzip +*.bz2 +*.xz +*.lzma + +### packing-only formats +*.iso +*.tar + +### package management formats +*.dmg +*.xpi +*.gem +*.egg +*.deb +*.rpm + +### logs and databases +*.log +*.sql +*.sqlite + +### eclipse specific +*.pydevproject +.project +.metadata +local.properties +.classpath +.settings/ +.loadpath +# External tool builders +.externalToolBuilders/ +# Locally stored "Eclipse launch configurations" +*.launch +# CDT-specific +.cproject +# PDT-specific +.buildpath + diff --git a/git/gitk b/git/gitk new file mode 100644 index 0000000..5a67d0a --- /dev/null +++ b/git/gitk @@ -0,0 +1,61 @@ +set mainfont {sans 9} +set textfont {monospace 9} +set uifont {sans 9 bold} +set tabstop 8 +set findmergefiles 0 +set maxgraphpct 50 +set maxwidth 16 +set cmitmode patch +set wrapcomment none +set autoselect 1 +set autosellen 40 +set showneartags 1 +set maxrefs 20 +set hideremotes 0 +set showlocalchanges 1 +set datetimeformat {%Y-%m-%d %H:%M:%S} +set limitdiffs 1 +set uicolor grey85 +set want_ttk 1 +set bgcolor white +set fgcolor black +set uifgcolor black +set uifgdisabledcolor #999 +set colors {green red blue magenta darkgrey brown orange} +set diffcolors {red "#00a000" blue} +set mergecolors {red blue green purple brown "#009090" magenta "#808000" "#009000" "#ff0080" cyan "#b07070" "#70b0f0" "#70f0b0" "#f0b070" "#ff70b0"} +set markbgcolor #e0e0ff +set diffcontext 3 +set selectbgcolor gray85 +set foundbgcolor yellow +set currentsearchhitbgcolor orange +set extdifftool meld +set perfile_attrs 0 +set headbgcolor green +set headfgcolor black +set headoutlinecolor black +set remotebgcolor #ffddaa +set tagbgcolor yellow +set tagfgcolor black +set tagoutlinecolor black +set reflinecolor black +set filesepbgcolor #aaaaaa +set filesepfgcolor black +set linehoverbgcolor #ffff80 +set linehoverfgcolor black +set linehoveroutlinecolor black +set mainheadcirclecolor yellow +set workingfilescirclecolor red +set indexcirclecolor green +set circlecolors {white blue gray blue blue} +set linkfgcolor blue +set circleoutlinecolor black +set geometry(main) 1024x516+0+0 +set geometry(state) normal +set geometry(topwidth) 1024 +set geometry(topheight) 210 +set geometry(pwsash0) "519 1" +set geometry(pwsash1) "844 1" +set geometry(botwidth) 550 +set geometry(botheight) 301 +set permviews {} diff --git a/i3/i3/config b/i3/i3/config new file mode 100644 index 0000000..5631f9a --- /dev/null +++ b/i3/i3/config @@ -0,0 +1,267 @@ +# 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). +# + +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +# Use the win-key as modifier +set $mod Mod4 + +# The default terminal +set $terminal terminator + +# Keyboard options +set $keyboard_layout de +set $keyboard_options nodeadkeys + +# Mouse options +set $mouse_repeat_delay 150 +set $mouse_repeat_speed 25 + +# Path to the exit script +set $path_i3exit ~/.i3/scripts/i3exit.bash + +# Path and options for the wallpaper changer script +set $path_wallchanger ~/.i3/scripts/wallchanger.bash +set $wallpaper_directory "$HOME/Bilder/wallpaper/misc" +set $wallpaper_logfile "$HOME/.i3/logs/wallpaper.log" +set $wallpaper_interval 900 + +# Path to the config file for i3status +set $path_i3status_config ~/.i3/i3status.conf + +# font for window titles. ISO 10646 = Unicode +#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +font pango:DejaVu Sans Mono 10 + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier Mod1 + +# start a terminal +bindsym $mod+Return exec $terminal + +# kill focused window +bindsym $mod+Shift+Q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec dmenu_run + +# 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+g 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, default) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout default + +# 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 +#bindcode $mod+d focus child + +# 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+exclam move container to workspace 1 +bindsym $mod+Shift+quotedbl move container to workspace 2 +bindsym $mod+Shift+section move container to workspace 3 +bindsym $mod+Shift+dollar move container to workspace 4 +bindsym $mod+Shift+percent move container to workspace 5 +bindsym $mod+Shift+ampersand move container to workspace 6 +bindsym $mod+Shift+slash move container to workspace 7 +bindsym $mod+Shift+parenleft move container to workspace 8 +bindsym $mod+Shift+parenright move container to workspace 9 +bindsym $mod+Shift+equal 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 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 113 resize shrink width 10 px or 10 ppt + bindsym 116 resize grow height 10 px or 10 ppt + bindsym 111 resize shrink height 10 px or 10 ppt + bindsym 114 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" + +# Default orientation for new workspaces will be derived from aspect ratio +default_orientation auto + +# New containers will start in tiling mode +workspace_layout default + +# Draw normal borders around all windows +new_window normal +new_float normal + +# Do not show vertical borders between windows +hide_edge_borders vertical + +# Focus follows mouse +focus_follows_mouse yes + +# Only map a popup in fullscreen mode if it belongs to the fullscreen window +popup_during_fullscreen smart + +# Do not always wrap but change to a container on the same level instead +force_focus_wrapping no + +# Do no force xinerama +force_xinerama no + +# Hit the current workspace button again to return to the previous workspace +workspace_auto_back_and_forth yes + +# Draw a window as urgent when switching to its workspace, even if focused, for +# 500 ms +force_display_urgency_hint 500 ms + +# Cycle through workspaces +bindsym $mod+u workspace prev_on_output +bindsym $mod+i workspace next_on_output + +bindsym $mod+Shift+u move container to workspace prev_on_output +bindsym $mod+Shift+i move container to workspace next_on_output + +# Always let the following applications float: + +# The wicd client GUI +for_window [class="^Wicd-client.py$"] floating enable + +# Notifications through xfce4-notifyd, e.g. notifications from wicd +for_window [class="^Xfce4-notifyd$"] floating enable + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + mode dock + position bottom + tray_output primary + font pango:DejaVu Sans Mono 8 + workspace_buttons yes + + colors { + background #000000 + statusline #ffffff + separator #666666 + + focused_workspace #4c7899 #285577 #ffffff + active_workspace #333333 #5f676a #ffffff + inactive_workspace #333333 #222222 #888888 + urgent_workspace #2f343a #900000 #ffffff + } + + status_command i3status --config $path_i3status_config +} + + + +# Start the wallpaper changer. +exec --no-startup-id $path_wallchanger $wallpaper_directory $wallpaper_interval > $wallpaper_logfile + +# Set keyboard layout +exec --no-startup-id setxkbmap $keyboard_layout $keyboard_options + +# Set key repeat delay +exec --no-startup-id xset r rate $mouse_repeat_delay $mouse_repeat_speed + +# Start wicd in tray +exec --no-startup-id wicd-gtk --tray + +# Enabling a mode to shutdown, reboot, lock screen and so on +set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown +mode "$mode_system" { + bindsym l exec --no-startup-id $path_i3exit lock, mode "default" + bindsym e exec --no-startup-id $path_i3exit logout, mode "default" + bindsym s exec --no-startup-id $path_i3exit suspend, mode "default" + bindsym h exec --no-startup-id $path_i3exit hibernate, mode "default" + bindsym r exec --no-startup-id $path_i3exit reboot, mode "default" + bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+Pause mode "$mode_system" +bindsym $mod+Shift+Pause exec --no-startup-id $path_i3exit lock + + +bindsym XF86Sleep exec --no-startup-id $path_i3exit suspend + +bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle +bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master %5+ +bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master %5- diff --git a/i3/i3/data/lockscreen.png b/i3/i3/data/lockscreen.png new file mode 100644 index 0000000..3effd26 Binary files /dev/null and b/i3/i3/data/lockscreen.png differ diff --git a/i3/i3/i3status.conf b/i3/i3/i3status.conf new file mode 100644 index 0000000..bbfa228 --- /dev/null +++ b/i3/i3/i3status.conf @@ -0,0 +1,85 @@ +# 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 { + colors = true + interval = 1 +} + +#order += "ipv6" +#order += "disk /" +#order += "disk /var" +order += "disk /home" +order += "cpu_temperature 0" +#order += "run_watch DHCP" +#order += "run_watch VPN" +order += "wireless wlp2s0" +order += "ethernet enp1s0" +#order += "ethernet eth0" +order += "battery 0" +order += "load" +order += "volume master" +order += "tztime local" + +wireless wlp2s0 { + format_up = "W: %quality %ip" +# format_up = "W: %essid: %quality %ip" + format_down = "W: down" +} + +ethernet enp1s0 { + # if you use %speed, i3status requires root privileges + format_up = "E: %ip (%speed)" + format_down = "E: down" +} + +battery 0 { + format = "%status %remaining (%percentage)" + integer_battery_capacity = true + low_threshold = 10 + threshold_type = percentage +} + +run_watch DHCP { + pidfile = "/var/run/dhclient*.pid" +} + +run_watch VPN { + pidfile = "/var/run/vpnc/pid" +} + +tztime local { + format = "%Y-%m-%d %H:%M:%S" +} + +load { + format = "L: %1min" + max_threshold = 5 +} + +disk "/" { + format = "/: %avail/%total free (%percentage_avail)" +} + +disk "/var" { + format = "/var: %avail/%total free (%percentage_avail)" +} + +disk "/home" { + format = "/home: %avail/%total free (%percentage_avail)" +} + +cpu_temperature 0 { + format = "T: %degrees °C" +} + +volume master { + format = "VOL: %volume" + device = "default" + mixer = "Master" +} diff --git a/i3/i3/scripts/i3exit.bash b/i3/i3/scripts/i3exit.bash new file mode 100755 index 0000000..0f624d8 --- /dev/null +++ b/i3/i3/scripts/i3exit.bash @@ -0,0 +1,33 @@ +#!/bin/bash + +### From http://www.archlinux.org/index.php/i3 + +lock() { + i3lock --image="$HOME/.i3/data/lockscreen.png" +} + +case "$1" in + lock) + lock + ;; + logout) + i3-msg exit + ;; + suspend) + lock && systemctl suspend + ;; + hibernate) + lock && systemctl hibernate + ;; + reboot) + systemctl reboot + ;; + shutdown) + systemctl poweroff + ;; + *) + echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" + exit 2 +esac + +exit 0 diff --git a/i3/i3/scripts/wallchanger.bash b/i3/i3/scripts/wallchanger.bash new file mode 120000 index 0000000..839022b --- /dev/null +++ b/i3/i3/scripts/wallchanger.bash @@ -0,0 +1 @@ +/home/hannes/development/projects/wallchanger/wallchanger.bash \ No newline at end of file diff --git a/scripts/makesymlinks.bash b/scripts/makesymlinks.bash new file mode 100755 index 0000000..e57b1ae --- /dev/null +++ b/scripts/makesymlinks.bash @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# config directory +config_dir="$HOME/config/" + +# backup directory, files that would otherwise be overwritten go there +backup_dir="$HOME/oldconfig/" + +# the following folders inside $config_dir will be inspected and symlinked: +symlink_folders="bash git i3 vim zsh" + +# backup the old config files +backup_dir="$backup_dir/$(date +%Y-%m-%dT%H:%M:%S)" +echo "Backing up old configuration files into \"$backup_dir\"." +mkdir -p "$backup_dir" +for folder in $symlink_folders ; do + for file in "$config_dir/$folder"/* ; do + oldfile="$HOME/.$(basename "$file")" + if [[ -e "$oldfile" ]] ; then + destination="$backup_dir/$(basename "$oldfile")" + echo "mv: \"$oldfile\" -> \"$destination\"" + mv "$oldfile" "$destination" + else + echo "\"$oldfile\" not found, skipped." + fi + done +done + +# now symlink the files in $config_dir into the home directory +echo "Creating symlinks for configuration files in \"$config_dir\"." +for folder in $symlink_folders ; do + for file in "$config_dir/$folder"/* ; do + destination="$HOME/.$(basename "$file")" + echo "ln -s \"$file\" -> \"$destination\"" + ln -s "$file" "$destination" + done +done + diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..c7e9fc7 --- /dev/null +++ b/vim/vimrc @@ -0,0 +1,74 @@ +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Filename: .vimrc " +" Maintainer: Michael J. Smalley " +" URL: http://github.com/michaeljsmalley/dotfiles " +" " +" " +" Sections: " +" 01. General ................. General Vim behavior " +" 02. Events .................. General autocmd events " +" 03. Theme/Colors ............ Colors, fonts, etc. " +" 04. Vim UI .................. User interface behavior " +" 05. Text Formatting/Layout .. Text, tab, indentation related " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 01. General " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set nocompatible " get rid of Vi compatibility mode. SET FIRST! + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 02. Events " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +filetype plugin indent on " filetype detection[ON] plugin[ON] indent[ON] + +" In Makefiles DO NOT use spaces instead of tabs +autocmd FileType make setlocal noexpandtab +" In Ruby files, use 2 spaces instead of 4 for tabs +autocmd FileType ruby setlocal sw=2 ts=2 sts=2 + +" Enable omnicompletion (to use, hold Ctrl+X then Ctrl+O while in Insert mode. +set ofu=syntaxcomplete#Complete + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 03. Theme/Colors " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set t_Co=256 " enable 256-color mode. +syntax enable " enable syntax highlighting (previously syntax on). +"colorscheme molokai " set colorscheme + +" Prettify JSON files +autocmd BufRead,BufNewFile *.json set filetype=json +autocmd Syntax json sou ~/.vim/syntax/json.vim + +" Prettify Vagrantfile +autocmd BufRead,BufNewFile Vagrantfile set filetype=ruby + +" Highlight characters that go over 80 columns +highlight OverLength ctermbg=red ctermfg=white guibg=#592929 +match OverLength /\%81v.\+/ + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 04. Vim UI " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set number " show line numbers +set cul " highlight current line +set laststatus=2 " last window always has a statusline +set nohlsearch " Don't continue to highlight searched phrases. +set incsearch " But do highlight as you type your search. +set ignorecase " Make searches case-insensitive. +set ruler " Always show info along bottom. +set showmatch +set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ col=%c%V\ \ totlin=%L%)\ \ \%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%P + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 05. Text Formatting/Layout " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set autoindent " auto-indent +set tabstop=4 " tab spacing +set softtabstop=4 " unify +set shiftwidth=4 " indent/outdent by 4 columns +set shiftround " always indent/outdent to the nearest tabstop +set expandtab " use spaces instead of tabs +set smarttab " use tabs at the start of a line, spaces elsewhere +set nowrap " don't wrap text diff --git a/zsh/zshrc b/zsh/zshrc new file mode 100644 index 0000000..f92148d --- /dev/null +++ b/zsh/zshrc @@ -0,0 +1,47 @@ +# Path to your oh-my-zsh configuration. +ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="bira" #robbyrussell" + +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +# Set to this to use case-sensitive completion +CASE_SENSITIVE="true" + +# Comment this out to disable bi-weekly auto-update checks +DISABLE_AUTO_UPDATE="true" + +# Uncomment to change how often before auto-updates occur? (in days) +# export UPDATE_ZSH_DAYS=13 + +# Uncomment following line if you want to disable colors in ls +# DISABLE_LS_COLORS="true" + +# Uncomment following line if you want to disable autosetting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment following line if you want to disable command autocorrection +# DISABLE_CORRECTION="true" + +# Uncomment following line if you want red dots to be displayed while waiting for completion +# COMPLETION_WAITING_DOTS="true" + +# Uncomment following line if you want to disable marking untracked files under +# VCS as dirty. This makes repository status check for large repositories much, +# much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# Customize to your needs...