diff options
author | toni <matzeton@googlemail.com> | 2017-02-04 21:32:57 +0100 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2017-02-04 21:34:50 +0100 |
commit | 4437f782fad4e961f779c25b2fa683fbc092bdd0 (patch) | |
tree | 91bed30d9e416c453f1032cf50803062246e9f14 | |
parent | b4e2f7bcbe37b132fd852f836db1f859f20c502d (diff) |
update
-rw-r--r-- | configs/bashrc | 126 | ||||
-rw-r--r-- | configs/bashrc_home | 139 | ||||
-rw-r--r-- | configs/xmonad.hs | 28 |
3 files changed, 209 insertions, 84 deletions
diff --git a/configs/bashrc b/configs/bashrc index 9ab0b65..3d66852 100644 --- a/configs/bashrc +++ b/configs/bashrc @@ -1,102 +1,78 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples +# System-wide .bashrc file for interactive bash(1) shells. + +# To enable the settings / commands in this file for login shells as well, +# this file has to be sourced in /etc/profile. # If not running interactively, don't do anything [ -z "$PS1" ] && return -# don't put duplicate lines in the history. See bash(1) for more options -# don't overwrite GNU Midnight Commander's setting of `ignorespace'. -HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups -# ... or force ignoredups and ignorespace -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) - # 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 (used in the prompt below) -if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -#force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt +# set a fancy prompt (non-color, overwrite the one in /etc/profile) +PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default. # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' ;; *) ;; esac -alias ssh-htwk='ssh -C -X kain.imn.htwk-leipzig.de -l tuhlig' -alias ssh-petra='ssh -C upjetra.no-ip.org -L 5900:127.0.0.1:5900 -l toni' -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - alias grep='grep --color=auto' +# enable bash completion in interactive shells +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi fi -# some more ls aliases -alias ll='ls -l' -alias la='ls -A' -alias l='ls -CF' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases +# if the command-not-found package is installed, use it +if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then + function command_not_found_handle { + # check because c-n-f could've been removed in the meantime + if [ -x /usr/lib/command-not-found ]; then + /usr/lib/command-not-found -- "$1" + return $? + elif [ -x /usr/share/command-not-found/command-not-found ]; then + /usr/share/command-not-found/command-not-found -- "$1" + return $? + else + printf "%s: command not found\n" "$1" >&2 + return 127 + fi + } fi -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if [ -f /etc/bash_completion ] && ! shopt -oq posix; then - . /etc/bash_completion +alias x11vnc-default="x11vnc -scale 4/7 -noxdamage -localhost -cursor X -noalphablend -cursorpos -display :0 -grabptr -notruecolor -bg" +alias vpn-htwk="sudo -- /usr/sbin/vpnc /etc/vpnc/htwk.conf" +alias vpn-pdev="sudo -- /usr/sbin/openvpn --dev tun0 --config /etc/openvpn/htwk-pdev.ovpn" +alias vpn-end="sudo -- /usr/bin/killall -u root vpnc" +alias s2r="sudo /usr/sbin/s2ram --force" +alias android_adb="sudo /usr/sbin/android_adb.sh" +alias grub-nextboot-win7="grub-set-default 6" +alias grub-nextboot-vmlinuz="grub-set-default 1,3" +export _JAVA_AWT_WM_NONREPARENTING=1 + +if [ "x$TERM" = "xlinux" ]; then + setterm -blank 0 + tty | grep -qE 'tty1$' + if [ $? -eq 0 ] && [ $(id -u) -ne 0 ]; then + exec startx + fi +fi +if [ "x$USER" = "xguest" ]; then + exec startx fi -export PATH="${PATH}:$HOME/bin" -DEBEMAIL="matzeton@googlemail.com" -DEBFULLNAME="Toni Uhlig" -export DEBEMAIL DEBFULLNAME -export CLICOLOR=TRUE +export GEM_HOME=${HOME}/.gem diff --git a/configs/bashrc_home b/configs/bashrc_home new file mode 100644 index 0000000..ebc957c --- /dev/null +++ b/configs/bashrc_home @@ -0,0 +1,139 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# don't put duplicate lines in the history. See bash(1) for more options +# don't overwrite GNU Midnight Commander's setting of `ignorespace'. +HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups +# ... or force ignoredups and ignorespace +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) + +# 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 (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +alias ssh-htwk='ssh -C -X kain.imn.htwk-leipzig.de -l tuhlig' +alias sshfs-htwk='sshfs -C tuhlig@kain.imn.htwk-leipzig.de:/home/tuhlig' +alias ssh-wwws='ssh -C -X wwws.htwk-leipzig.de -l tuhlig' +alias ssh-petra='ssh -C upjetra.no-ip.org -L 5900:127.0.0.1:5900 -l toni' +alias ssh-petra-root='ssh -C upjetra.no-ip.org -L 5900:127.0.0.1:5900 -l root' +alias ssh-ddwrt='ssh -v -C -D 6666 ddwrt.local -l root' +alias ssh-imn='ssh -v -C portal.imn.htwk-leipzig.de -l dev0' +alias ssh-fimn='ssh -v -C fimndev.gruni23hh.net -l dev0' +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias grep='grep --color=auto' +fi + +# some more ls aliases +alias ll='ls -l' +alias la='ls -A' +alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ] && ! shopt -oq posix; then + . /etc/bash_completion +fi + +export PATH="${PATH}:$HOME/bin" +DEBEMAIL="matzeton@googlemail.com" +DEBFULLNAME="Toni Uhlig" +export DEBEMAIL DEBFULLNAME +export CLICOLOR=TRUE + +alias vpn-htwk="sudo -- /usr/sbin/vpnc /etc/vpnc/htwk.conf" +alias vpn-end="sudo -- /usr/bin/killall -u root vpnc" +alias s2r="/usr/bin/xtrlock & /usr/sbin/s2ram --force" +alias android_adb="sudo /usr/sbin/android_adb.sh" +alias backup="rdiff-backup ~/Dokumente admin@obelix::/home/backup/pdp7" +export XIDLE_FILE=/tmp/disable_xidle +alias disable_xidle="touch ${XIDLE_FILE}" +alias enable_xidle="rm -f ${XIDLE_FILE}" +alias mktun="sudo openvpn --mktun --dev tap0 --user root" +alias star_wars="telnet towel.blinkenlights.nl" +alias irssi-agora='irssi-tor.sh cfyfz6afpgfeirst.onion 6667 segfault' +alias irssi-hackint='irssi-tor.sh 5ogdsfyoqk47ompu.onion 6697 segfault' +alias irssi-killyourirc='irssi-tor.sh e4bqnvfdasnx4plk.onion 6667 segfault' +alias irssi-onion='irssi-tor.sh cgl7owaxduu2eupi.onion 6667 segfault' +alias irssi-netsec='irssi-tor.sh netseclgxigdsvpj.onion 6697 segfault' +alias git-shortver="git log -n 1 | head -n 1 | sed -e 's/^commit //' | head -c" +alias chrome-telegram="/usr/lib/chromium/chromium --profile-directory=Default --app-id=clhhggbfdinjmjhajaheehoeibfljjno" +alias chrome-signal="/usr/lib/chromium/chromium --profile-directory=Default --app-id=bikioccmkafdpakkkcpdbppfkghcmihk" + +export _JAVA_AWT_WM_NONREPARENTING=1 + +if [ "x$TERM" = "xlinux" ]; then + tty | grep -qE 'tty1$' + if [ $? -eq 0 ] && [ $(id -u) -ne 0 ]; then + trap - SIGINT SIGTERM + startx -- vt7 + logout + fi +fi + diff --git a/configs/xmonad.hs b/configs/xmonad.hs index 14bec93..119072e 100644 --- a/configs/xmonad.hs +++ b/configs/xmonad.hs @@ -9,6 +9,7 @@ import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers import XMonad.Hooks.SetWMName +import XMonad.Hooks.UrgencyHook import XMonad.Layout.NoBorders import XMonad.Layout.Tabbed import XMonad.Layout.Grid @@ -18,6 +19,7 @@ import XMonad.Layout.IM import XMonad.Actions.SpawnOn import XMonad.Actions.PhysicalScreens import XMonad.Actions.CycleWS +import XMonad.Util.Replace import XMonad.Util.Run import XMonad.Util.EZConfig(additionalKeys) import qualified XMonad.StackSet as W @@ -61,10 +63,16 @@ myWorkspaces = [ comWS, fileWS, webWS, w1WS, w2WS ] ++ map show [6..9] myManageHook = composeAll [ className =? "Seahorse" --> doShift webWS , className =? "Iceweasel" --> doShift webWS + , className =? "chromium" --> doShift webWS , className =? "chromium-browser" --> doShift webWS + , className =? "Chromium-browser" --> doShift webWS , className =? "Icedove" --> doShift webWS , className =? "Pidgin" --> doShift comWS , className =? "qTox" --> doShift comWS + , className =? "telegram-desktop" --> doShift comWS + , className =? "crx_clhhggbfdinjmjhajaheehoeibfljjno" --> doShift comWS + , className =? "TelegramDesktop" --> doShift comWS + , className =? "crx_bikioccmkafdpakkkcpdbppfkghcmihk" --> doShift comWS , className =? "Eclipse" --> doShift fileWS , className =? "Kmail" --> doShift webWS , className =? "Konqueror" --> doShift fileWS @@ -336,7 +344,7 @@ myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ myStartupHook :: X () myStartupHook = do safeSpawnProg "seahorse" - safeSpawnProg "chrome" + safeSpawnProg "chromium" safeSpawnProg "pidgin" safeSpawnProg "qtox" setWMName "LG3D" @@ -348,15 +356,17 @@ myStartupHook = do -- Run xmonad with all the defaults we set up. -- main = do + replace xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmobarrc" - xmonad $ defaults { - logHook = dynamicLogWithPP $ xmobarPP { - ppOutput = hPutStrLn xmproc - , ppTitle = xmobarColor xmobarTitleColor "" . shorten 100 - , ppCurrent = xmobarColor xmobarCurrentWorkspaceColor "" - , ppSep = " "} - , manageHook = myManageHook <+> manageSpawn <+> manageDocks - } + xmonad $ withUrgencyHook dzenUrgencyHook { args = ["-bg", "darkgreen", "-xs", "1"] } + $ defaults { + logHook = dynamicLogWithPP $ xmobarPP { + ppOutput = hPutStrLn xmproc + , ppTitle = xmobarColor xmobarTitleColor "" . shorten 100 + , ppCurrent = xmobarColor xmobarCurrentWorkspaceColor "" + , ppSep = " "} + , manageHook = myManageHook <+> manageSpawn <+> manageDocks + } ------------------------------------------------------------------------ |