Various changes.

This commit is contained in:
2014-08-17 23:34:02 +02:00
parent 135b5449d3
commit 46c9c6de47
8 changed files with 91 additions and 62 deletions

View File

@@ -174,17 +174,19 @@
# regenerate and reload the configuration file # regenerate and reload the configuration file
# if genconfig gets any paramters, it will invoke i3-msg reload # if genconfig gets any paramters, it will invoke i3-msg reload
bindsym $mod+$reload exec --no-startup-id bash ~/.i3/scripts/genconfig.bash 1 bindsym $mod+$reload exec --no-startup-id ~/.i3/scripts/genconfig.bash 1
bindsym $mod+$restart restart bindsym $mod+$restart restart
bindsym $mod+$exit exit bindsym $mod+$exit exit
### START APPLICATIONS ##################################################### ### START APPLICATIONS #####################################################
bindsym $mod+d exec j4-dmenu-desktop --dmenu="dmenu -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000'" bindsym $mod+d exec j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans Mono:size=11' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000'"
bindsym $mod+Return exec $terminal bindsym $mod+Return exec $terminal
bindsym $mod+F1 exec firefox bindsym $mod+F1 exec firefox
bindsym Pause exec --no-startup-id ~/.i3/scripts/shutdown-menu.bash
################################################################################ ################################################################################
### MODES ###################################################################### ### MODES ######################################################################
################################################################################ ################################################################################
@@ -214,23 +216,6 @@
} }
bindsym $mod+r mode "resize" bindsym $mod+r mode "resize"
# 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 $key_lock exec --no-startup-id $path_i3exit $signal_lock, mode "default"
bindsym $key_logout exec --no-startup-id $path_i3exit $signal_logout, mode "default"
bindsym $key_suspend exec --no-startup-id $path_i3exit $signal_suspend, mode "default"
bindsym $key_hibernate exec --no-startup-id $path_i3exit $signal_hibernate, mode "default"
bindsym $key_reboot exec --no-startup-id $path_i3exit $signal_reboot, mode "default"
bindsym $key_shutdown exec --no-startup-id $path_i3exit $signal_shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Pause mode "$mode_system"
bindsym Pause exec --no-startup-id $path_i3exit lock
################################################################################ ################################################################################
### GENERAL SETUP ############################################################## ### GENERAL SETUP ##############################################################
################################################################################ ################################################################################
@@ -321,6 +306,7 @@ client.urgent #2f343a #900000 #ffffff #900000
for_window [class="^main\.py$" ] floating enable for_window [class="^main\.py$" ] floating enable
for_window [class="^Xfce4-panel$"] floating enable for_window [class="^Xfce4-panel$"] floating enable
for_window [class="^Thunderbird"] border none for_window [class="^Thunderbird"] border none
for_window [instance="^shutdown-menu$"] border normal
assign [class="^Thunderbird"] $workspace9 assign [class="^Thunderbird"] $workspace9
assign [class="^Skype$"] $workspace10 assign [class="^Skype$"] $workspace10

View File

Before

Width:  |  Height:  |  Size: 327 KiB

After

Width:  |  Height:  |  Size: 327 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -12,6 +12,7 @@ touch "$LOGFILE"
log() log()
{ {
echo "$1"
echo "[$(date +%FT%T)] $1" >> "$LOGFILE" echo "[$(date +%FT%T)] $1" >> "$LOGFILE"
} }
@@ -19,24 +20,30 @@ lock()
{ {
resolution=$(xrandr | grep '*' | awk '{ print $1 }' | head -n1) resolution=$(xrandr | grep '*' | awk '{ print $1 }' | head -n1)
log "[I] Resolution found: \"$resolution\"" log "[I] Resolution found: \"$resolution\""
lockscreen="$HOME/.i3/data/lockscreen_$resolution.png" lockscreen="$HOME/.i3/data/lockscreen/$resolution.png"
log "[I] Looking for lockscreen at \"$lockscreen\"" log "[I] Looking for lockscreen at \"$lockscreen\""
if [[ -f "$lockscreen" ]] ; then if [[ -f "$lockscreen" ]] ; then
log "[I] Lockscreen found, will be used as background image." log "[I] Lockscreen found, will be used as background image."
background_options="--image $lockscreen -t" background_options="--image $lockscreen -t"
else else
log "[W] Lockscreen not found, using color #$FALLBACK_COLOR as background." log "[W] Lockscreen not found, using color #$FALLBACK_COLOR as background."
background_options="--color $FALLBACK_COLOR" background_options="--color $FALLBACK_COLOR"
fi fi
i3lock $background_options #-p win --image "$HOME/pictures/windows-lockscreen.jpg" i3lock $background_options #-p win --image "$HOME/pictures/windows-lockscreen.jpg"
retval=$? retval=$?
[[ -z "$1" ]] && sleep 1 && xset dpms force off [[ -z "$1" ]] && sleep 3 && xset dpms force off
return $retval return $retval
} }
log "[I] Received signal \"$1\"." if [[ "$1" == '-' ]]; then
read signal
else
signal="$1"
fi
case "$1" in log "[I] Received signal \"$signal\"."
case "$signal" in
lock) lock)
log "[I] Locking session." log "[I] Locking session."
lock lock
@@ -64,7 +71,7 @@ case "$1" in
;; ;;
*) *)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
log "[E] Signal \"$1\" unknown. Aborting." log "[E] Signal \"$signal\" unknown. Aborting."
exit 2 exit 2
esac esac

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
options=(
"lock"
"logout"
"suspend"
"hibernate"
"reboot"
"shutdown")
i=1
output=$(
for option in "${options[@]}"; do
echo "($i) $option"
(( i++ ))
done | dmenu -fn 'DejaVu Sans Mono:size=11' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000' -w 200 -name 'shutdown-menu')
[[ "$output" ]] && "$(dirname "$0")"/i3exit.bash "${output#(*) }"

View File

@@ -24,7 +24,7 @@ URxvt.termName: urxvt
URxvt.cursorBlink: true URxvt.cursorBlink: true
URxvt.transparent: true URxvt.transparent: true
URxvt.shading: 10 URxvt.shading: 15
! Solarized color scheme for the X Window System ! Solarized color scheme for the X Window System
! !

View File

@@ -59,7 +59,7 @@ wallpaper_interval="900"
# redshift settings # redshift settings
redshift_lat_long="49.5:11" redshift_lat_long="49.5:11"
redshift_colortemp="5500:4000" redshift_colortemp="5500:3700"
# start mpd # start mpd
if ! pgrep --euid hannes --exact '^mpd$' ; then if ! pgrep --euid hannes --exact '^mpd$' ; then

View File

@@ -12,9 +12,11 @@ SAVEHIST=10000
HISTFILE="$HOME/.zsh_history" HISTFILE="$HOME/.zsh_history"
PROMPT="%{$fg[white]%}╭─%{$fg[green]%}%M %{$fg[red]%}▶ %{$fg[yellow]%}%~ PROMPT="%{$fg[white]%}╭─%{$fg[green]%}%M %{$fg[red]%}▶ %{$fg[yellow]%}%~
%{$fg[white]%}╰─%B$%b " %{$fg[white]%}╰─%B%#%b "
RPROMPT="%{$fg[red]%}%? %{$fg[white]%}%*%{$reset_color%}" RPROMPT="%{$fg[red]%}%? %{$fg[white]%}%*%{$reset_color%}"
PATH="$PATH:$HOME/bin"
man() { man() {
env LESS_TERMCAP_mb=$'\E[01;31m' \ env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \ LESS_TERMCAP_md=$'\E[01;38;5;74m' \
@@ -110,7 +112,7 @@ alias much="git"
alias wow="git status" alias wow="git status"
alias v="vim" alias v="vim"
alias g="grep" alias g="git"
# rebase the current branch onto WTF ARE YOU DOING YOU ARE DRUNNK TO GO BED # rebase the current branch onto WTF ARE YOU DOING YOU ARE DRUNNK TO GO BED
@@ -134,11 +136,11 @@ slideshow() {
"$@" "$@"
} }
function cd() { cd() {
builtin cd $* && ls builtin cd $* && ls
} }
function mount() { mount() {
if [[ $# == 0 ]] ; then if [[ $# == 0 ]] ; then
/usr/bin/env mount | column -t /usr/bin/env mount | column -t
else else
@@ -147,42 +149,45 @@ function mount() {
} }
ff() { ff() {
find . -type f -iname "*"$*"*" ; find . -type f -iname "*"$*"*" ;
} }
ffcs() { ffcs() {
find . -type f -name "*"$*"*" ; find . -type f -name "*"$*"*" ;
} }
extract() # Handy Extract Program. extr()
{ {
if [ -f $1 ] ; then if [[ -f "$1" ]] ; then
case $1 in case "$1" in
*.tar.bz2 ) tar xvjf $1 ;; *.tar.bz2 ) tar xvjf "$1" ;;
*.tar.gz ) tar xvzf $1 ;; *.tar.gz ) tar xvzf "$1" ;;
*.bz2 ) bunzip2 $1 ;; *.tar.xz ) tar xvJf "$1" ;;
*.rar ) unrar x $1 ;; *.bz2 ) bunzip2 "$1" ;;
*.gz ) gunzip $1 ;; *.rar ) unrar x "$1" ;;
*.tar ) tar xvf $1 ;; *.gz ) gunzip "$1" ;;
*.tbz2 ) tar xvjf $1 ;; *.tar ) tar xvf "$1" ;;
*.tgz ) tar xvzf $1 ;; *.tbz2 ) tar xvjf "$1" ;;
*.zip ) unzip $1 ;; *.tgz ) tar xvzf "$1" ;;
*.Z ) uncompress $1 ;; *.zip ) unzip "$1" ;;
*.7z ) 7z x $1 ;; *.Z ) uncompress "$1" ;;
*) echo "$1 cannot be extracted via extract()" ;; *.7z ) 7z x "$1" ;;
esac *)
else echo "$1 cannot be extracted via $0"
echo "$1 is not a valid file" ;;
fi esac
else
echo "$1 is not a valid file"
fi
} }
ruler() { ruler() {
for s in '....^....|' '1234567890'; do for s in '....^....|' '1234567890'; do
w=${#s} w=${#s}
str=$(for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done ) str=$(for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done )
str=$(echo $str | cut -c -$COLUMNS) str=$(echo $str | cut -c -$COLUMNS)
echo $str echo $str
done done
} }
addext() { addext() {
@@ -192,15 +197,15 @@ addext() {
} }
ckwww() { ckwww() {
ping -c 3 www.google.com ping -c 3 www.google.com
} }
topcmds() { topcmds() {
history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head
} }
fnottype() { fnottype() {
find . -maxdepth 1 ! -type $1 find . -maxdepth 1 ! -type $1
} }
# simple calculator # simple calculator
@@ -208,6 +213,19 @@ c () {
echo "$*" | bc -l echo "$*" | bc -l
} }
function http() { http() {
curl http://httpcode.info/$1 curl http://httpcode.info/$1
} }
bak() {
[[ -e "$1" ]] && cp -ai "$1" "$1.$(date +%FT%T).bak"
}
fstab() {
# yeah
expand /etc/fstab | grep -v '^#' | grep -P '^.+$' | tr -s ' ' | tr ' ' '|' | cat <(grep -P '<.+>' /etc/fstab | cut -f 2- -d ' ' | sed 's/>[^<]*</>|</g') - | column -ts '|'
}
rmext() {
[[ -e "$1" ]] && mv -i "$1" "${1%.*}"
}