1
1
Fork 0

fixed intendation

This commit is contained in:
david 2018-05-13 16:13:14 +02:00
parent 865c3e2332
commit 35d1e634ea
1 changed files with 97 additions and 102 deletions

View File

@ -2,19 +2,18 @@
# It might not be very useful for you. # It might not be very useful for you.
# Options # **** zsh options ****
set -o shwordsplit set -o shwordsplit
# Aliases # **** aliases definitions ****
alias zz='source ~/.zshrc' alias zz='source $HOME/.zshrc'
alias vz='vim ~/.zshrc && source ~/.zshrc' alias vz='vim $HOME/.zshrc && source $HOME/.zshrc'
#alias vp='vim $ZSH/plugins/david.zsh && source ~/.zshrc' alias vp='vim $ZSH_CUSTOM/plugins/zsh-david/zsh-david.plugin.zsh && source $HOME/.zshrc'
#alias vt='vim $ZSH/themes/david.zsh && source ~/.zshrc' alias vu='upgrade_oh_my_zsh && _upgrade_custom'
#alias vs='vim $ZSH/myzsh.sh && source ~/.zshrc'
#alias vu='cd $ZSH > /dev/null; git pull origin master; cd - > /dev/null; echo $timestamp > $ZSH/lastrun; source ~/.zshrc'
alias vi='vim' alias vi='vim'
alias v='vim' alias v='vim'
alias vv='vim $HOME/.vimrc'
alias serve="python2 -m SimpleHTTPServer" alias serve="python2 -m SimpleHTTPServer"
alias push="git push origin master" alias push="git push origin master"
alias pull="git pull origin master" alias pull="git pull origin master"
@ -36,127 +35,123 @@ alias systemctl='sudo systemctl'
alias se='ls /usr/bin | grep' alias se='ls /usr/bin | grep'
# Variables # **** variables ****
export EDITOR=vim export EDITOR=vim
if [[ $LANG = '' ]]; then if [[ $LANG = '' ]]; then
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
fi fi
# Functions # **** function definitions ****
## RDP client
rdp() rdp()
{ {
if [ -z $1 ]; then if [ -z $1 ]; then
echo -e "server: \c" echo -e "server: \c"
read server read server
else else
server=$1 server=$1
fi fi
echo -e "username [davidadm]: \c" echo -e "username [davidadm]: \c"
read username read username
if [ -z $username ]; then if [ -z $username ]; then
username="davidadm" username="davidadm"
fi fi
echo -e "domain [aec.at]: \c" echo -e "domain [aec.at]: \c"
read domain read domain
if [ -z $domain ]; then if [ -z $domain ]; then
domain="aec.at" domain="aec.at"
fi fi
which rdesktop >/dev/null which rdesktop >/dev/null
if [ $? -eq 0 ]; then
#rdesktop -u $username -p - -d $domain -g 1366x768 $server -k de
rdesktop -K -u $username -p - -d $domain -g workarea $server -k de
else
which xfreerdp >/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
#rdesktop -u $username -p - -d $domain -g 1366x768 $server -k de #xfreerdp +clipboard /v:$server /u:$username /d:$domain /size:1920x1080
rdesktop -K -u $username -p - -d $domain -g workarea $server -k de xfreerdp /v:$server /u:$username /d:$domain /size:1366x768 -wallpaper:on
else else
which xfreerdp >/dev/null echo "error: no rdp client found"
if [ $? -eq 0 ]; then return 1
#xfreerdp +clipboard /v:$server /u:$username /d:$domain /size:1920x1080
xfreerdp /v:$server /u:$username /d:$domain /size:1366x768 -wallpaper:on
else
echo "error: no rdp client found"
return 1
fi
fi fi
fi
} }
## OS Upgrade for various systems.
update() update()
{ {
# OS Upgrade function for various systems. systems="ubuntu arch solus raspbian antergos"
issue="$(cat /etc/issue)"
for item in $systems; do
echo $issue | grep -i $item >> /dev/null
if [ $? -eq 0 ]; then
system=$item
fi
done
#checking for system case $system in
systems="ubuntu arch solus raspbian antergos" ubuntu|debian|raspbian)
issue="$(cat /etc/issue)" echo "Updating Ubuntu/Debian.."
for item in $systems; do sudo apt-get update && sudo apt-get dist-upgrade
echo $issue | grep -i $item >> /dev/null ;;
if [ $? -eq 0 ]; then arch|antergos)
system=$item echo "Updating Arch Linux.."
fi sudo pacman -Syu
done ;;
solus)
#trying to update parsed system echo "Updating Solus OS.."
case $system in sudo eopkg update-repo && sudo eopkg upgrade
ubuntu|debian|raspbian) ;;
echo "Updating Ubuntu/Debian.." ?)
sudo apt-get update && sudo apt-get dist-upgrade echo "error: unknown system."
;; return 1
arch|antergos) ;;
echo "Updating Arch Linux.." esac
sudo pacman -Syu if [ $? -ne 0 ]; then
;; echo "error: something went wrong."
solus) return 1
echo "Updating Solus OS.." fi
sudo eopkg update-repo && sudo eopkg upgrade
;;
?)
echo "error: unknown system."
return 1
;;
esac
if [ $? -ne 0 ]; then
echo "error: something went wrong."
return 1
fi
} }
## Cross-platform install routine
install() install()
{ {
systems="ubuntu arch"
issue="$(cat /etc/issue)"
packages=$*
for item in $systems; do
echo $issue | grep -i $item >> /dev/null
if [ $? -eq 0 ]; then
system=$item
fi
done
#checking for system case $system in
systems="ubuntu arch" ubuntu)
issue="$(cat /etc/issue)" sudo apt-get install -y $packages
packages=$* ;;
for item in $systems; do arch)
echo $issue | grep -i $item >> /dev/null sudo pacman -Sy --noconfirm $packages
if [ $? -eq 0 ]; then ;;
system=$item ?)
fi echo "unknown system. could not run install."
done ;;
esac
case $system in
ubuntu)
sudo apt-get install -y $packages
;;
arch)
sudo pacman -Sy --noconfirm $packages
;;
?)
echo "unknown system. could not run install."
;;
esac
} }
## Thinkpad Trackpoint input fix (for for thinkpad x131e/chromebook)
fixtrackpoint() fixtrackpoint()
{ {
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 1
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 2
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 200
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
xinput set-prop "TPPS/2 IBM TrackPoint" "Device Accel Constant Deceleration" 0.75 xinput set-prop "TPPS/2 IBM TrackPoint" "Device Accel Constant Deceleration" 0.75
} }