diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 9fd1c4d..7c2575e 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -18,15 +18,15 @@ bindsym $mod+shift+apostrophe bar mode dock # Rename a workspace bindsym $mod+shift+d exec i3-input -F 'rename workspace to "%s"' -P 'Rename to: ' # Rofi shortcuts -bindsym $mod+p exec "~/.i3/run.sh run" +bindsym $mod+p exec "~/.config/i3/run.sh run" # Clipboard manager -bindsym ctrl+Mod1+v exec "~/.i3/run.sh clip" +#bindsym ctrl+Mod1+v exec "~/.config/i3/run.sh clip" # Pass shortcut #bindsym $mod+shift+p exec "keepass --auto-type" -bindsym $mod+shift+p exec "rofi-pass --last-used" +#bindsym $mod+shift+p exec "rofi-pass --last-used" # Misc shortcuts bindsym --release Num_Lock exec "xdotool key --clearmodifiers Shift+Insert;numlockx on" -bindsym Print exec "~/.i3/run.sh screenshot" +bindsym Print exec "~/.config/i3/run.sh screenshot" # Split in vertical orientation bindsym $mod+v split h # Split in horizontal orientation @@ -76,10 +76,10 @@ bindsym $mod+shift+Down move down bindsym $mod+shift+Up move up bindsym $mod+shift+Right move right # Moving to corners -bindsym $mod+ctrl+h exec "~/.i3/run.sh move left" -bindsym $mod+ctrl+j exec "~/.i3/run.sh move bottom" -bindsym $mod+ctrl+k exec "~/.i3/run.sh move top" -bindsym $mod+ctrl+l exec "~/.i3/run.sh move right" +bindsym $mod+ctrl+h exec "~/.config/i3/run.sh move left" +bindsym $mod+ctrl+j exec "~/.config/i3/run.sh move bottom" +bindsym $mod+ctrl+k exec "~/.config/i3/run.sh move top" +bindsym $mod+ctrl+l exec "~/.config/i3/run.sh move right" # Fullscreen bindsym $mod+f fullscreen bindsym $mod+shift+f fullscreen global @@ -89,7 +89,7 @@ bindsym $mod+w layout tabbed bindsym $mod+e layout toggle split bindsym $mod+shift+space floating toggle bindsym $mod+space focus mode_toggle -bindsym $mod+comma exec "~/.i3/run.sh window" +bindsym $mod+comma exec "~/.config/i3/run.sh window" bindsym $mod+1 $x_switch 1 bindsym $mod+2 $x_switch 2 bindsym $mod+3 $x_switch 3 @@ -110,21 +110,21 @@ 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 -bindsym $mod+d exec "~/.i3/run.sh copy" -bindsym $mod+grave exec "~/.i3/run.sh screen-lock" -bindsym $mod+shift+grave exec "~/.i3/run.sh screen-lock" +bindsym $mod+d exec "~/.config/i3/run.sh copy" +bindsym $mod+grave exec "~/.config/i3/run.sh screen-lock" +bindsym $mod+shift+grave exec "~/.config/i3/run.sh screen-lock" bindsym $mod+r mode "resize" bindsym $mod+u focus parent bindsym $mod+shift+u focus child -bindsym --release $mod+n exec "~/.i3/run.sh paste" +bindsym --release $mod+n exec "~/.config/i3/run.sh paste" # Reload i3 bindsym $mod+shift+r reload;exec notify-send -a i3 Reloaded # Exit/restart i3 bindsym $mod+q restart #bindsym $mod+shift+q exec "i3-nagbar -m 'NMRestart/Shutdown/Restart/Logout' -t warning -b NMRestart 'nmcli radio wifi off;sleep 1;nmcli radio wifi on' -b Shutdown 'sudo /sbin/poweroff' -b Restart 'sudo /sbin/shutdown -r now' -b Logout 'i3-msg exit' -b Sleep 'amixer set Master 0% mute;slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on'" -bindsym $mod+shift+q exec "~/.i3/run.sh shutdownprompt" +bindsym $mod+shift+q exec "~/.config/i3/run.sh shutdownprompt" # Wallpaper -bindsym $mod+shift+w exec "~/.i3/run.sh wall" +bindsym $mod+shift+w exec "~/.config/i3/run.sh wall" # Visuals workspace_layout tabbed @@ -154,8 +154,8 @@ client.urgent $rd $rd $tx # Bar bar { #height 12 - status_command i3status --config ~/.i3/i3status.conf - #status_command ~/.i3/status.sh + status_command i3status --config ~/.config/i3/i3status.conf + #status_command ~/.config/i3/status.sh font -*-*-*-*-*-*-8-*-*-*-*-*-*-* tray_output primary mode dock @@ -205,7 +205,7 @@ exec --no-startup-id "zsh -c 'xrandr --output eDP1 --primary || xrandr --output # Mute on boot exec --no-startup-id amixer set Master 0% mute # Wallpaper -exec --no-startup-id "~/.i3/run.sh wall" +exec --no-startup-id "~/.config/i3/run.sh wall" # Keyboard exec --no-startup-id xmodmap ~/.xmodmap #exec --no-startup-id ~/xmodmap.sh @@ -218,8 +218,8 @@ exec --no-startup-id /usr/bin/urxvt # Orange tint exec --no-startup-id /usr/bin/redshift -l 36.3:-80.3 -t 4000:2000 # Sync x11 clipboards -#exec --no-startup-id /usr/bin/parcellite -exec --no-startup-id /usr/bin/gpaste-client dr +exec --no-startup-id /usr/bin/parcellite +#exec --no-startup-id /usr/bin/gpaste-client dr # Turn off numlock! exec --no-startup-id /usr/bin/numlockx # Run firefox/firefox-bin diff --git a/i3/.xsession b/i3/.xsession index 3d9bab9..a8afe72 100644 --- a/i3/.xsession +++ b/i3/.xsession @@ -1,4 +1,4 @@ -exec ~/.i3/run.sh boot +exec ~/.config/i3/run.sh boot #exec /usr/bin/ck-launch-session /usr/local/bin/i3 #exec numlockx& #exec syndaemon -i .5 -d& diff --git a/shell/.bashrc b/shell/.bashrc index 4bf68ec..5e7fee7 100644 --- a/shell/.bashrc +++ b/shell/.bashrc @@ -1 +1,7 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games +#prompt_cmd() { +# PS1="$(~/git/cesium/cesium --mode ps1 --rc "$?" --shell bash)" +# unset CESIUM_LAST_COMMAND_TIME +#} +#trap 'export CESIUM_LAST_COMMAND_TIME="$(date +%s)"' DEBUG +#PROMPT_COMMAND=prompt_cmd diff --git a/shell/.zshrc b/shell/.zshrc index 17143d9..db5de9f 100644 --- a/shell/.zshrc +++ b/shell/.zshrc @@ -8,14 +8,12 @@ setopt complete_in_word # Allow completion from within a word/phrase setopt INTERACTIVECOMMENTS setopt EXTENDED_GLOB setopt HIST_EXPIRE_DUPS_FIRST +setopt APPEND_HISTORY EXTENDED_HISTORY SHARE_HISTORY HISTIGNOREALLDUPS export HIST_STAMPS="dd.mm.yyyy" export HISTSIZE=12000 export SAVEHIST=10000000 export HISTFILE="$HOME/.zsh_history" -setopt APPEND_HISTORY -setopt EXTENDED_HISTORY -setopt APPEND_HISTORY SHARE_HISTORY HISTIGNOREALLDUPS -export EDITOR='vim' +export EDITOR="vim" export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x' zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.cache/zsh @@ -86,6 +84,9 @@ run() { echo "Building..." >&2 gcc -Wall -g -std=c99 "${1:r}.c" -o "${1:r}" && (echo "Running..." >&2;./"${1:r}") } +ex todotxt && alias t='todotxt' +ex todo-txt && alias t='todo-txt' +alias ta='t a' ex vim && alias vi='vim' ex rc-service && alias service='rc-service' ex ip && alias ip='ip -c' @@ -98,14 +99,13 @@ ex tmux && alias tmux='tmux -2' ex tree && alias tree='tree -C' ex ocp && alias ocp="ocp -vs0 -dcurses" alias jupyter='docker run --rm --user="$(id -u):$(id -g)" -v "$PWD":/home/jovyan/work -p 8888:8888 ymatsunaga/octave' -alias afci='git x ./autoformat.sh;git commit -am "Autoformatted"' alias con='git x php bin/console' alias disphost='export DISPLAY=:0.0' alias l='ls -CF' alias la='ls -A' alias less='less -R' alias ll='ls -AlhF' -alias logout='sudo pkill -u "$USER"' +alias logout='pkill -u "$USER"' alias mouse1="xmodmap <(echo pointer = 1 2 3)" alias mouse2="xmodmap <(echo pointer = 3 2 1)" alias nmrestart='nmcli radio wifi off;sleep 1;nmcli radio wifi on' @@ -180,7 +180,6 @@ if ex git; then alias g="git" fi alias stdns="sudo sh -c 'echo nameserver 1.1.1.1 > /etc/resolv.conf'" -#alias fvim="vim -u NONE +\"so ~/.vim/plugged/flappyvird-vim/plugin/flappyvird.vim\" +\"so ~/.vim/plugged/flappyvird-vim/autoload/flappyvird.vim\" +\":FlappyVird\" +\":q\"" alias fk='k `fzf --no-mouse -m -1 -x`' alias susp="sudo true && (slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on)" if ex sudo; then @@ -223,18 +222,6 @@ fixsh() { mv() { /bin/mv -v "$@" } m() { mv "$@" } compdef _cp c cfat m mv cp adb apush apull -paste() { - local PRIVATE=0 - if [[ ! -z "$1" ]] && [[ "$1" -eq "-p" ]]; then - PRIVATE=1 - shift - fi - local NAME="-d title=Command run at $(date '+%d/%h/%y %H:%M:%S') on $(hostname)" - if [[ ! -z "$1" ]]; then - NAME="-d title=$1" - fi - sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | curl --data-urlencode text@- $NAME -d name=$USER -d expire="40320" -d private="$PRIVATE" https://austenwares.com/paste/api/create -} linx() { if [[ -z "$1" ]]; then curl -T- -H "Linx-Randomize: yes" -H "Linx-Expiry: 2592000" https://linx.austenwares.com/upload | perl -pe 's/https:\/\/linx.austenwares.com\/(\w+)/https:\/\/linx.austenwares.com\/selif\/\1/' @@ -246,8 +233,6 @@ linx() { } ltar() { tar -cf - "$@"|pv -WcN tar|xz|pv -WcN lzma - #tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest - #tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest } ctar() { tar -cf - "$@"|pv -WcN tar|gzip|pv -WcN gzip @@ -259,19 +244,6 @@ offline() { sudo unshare -n -- sudo -u "$USER" LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh fi } -dnstest() { - echo "resolv.conf:" - cat /etc/resolv.conf - echo "Testing DNS:" - dig google.com - echo "Testing ping:" - ping -c 2 1.1.1.1 - echo "Testing IP curl:" - curl -L 178.33.250.62 - echo - echo "Testing DNS" - curl -L portquiz.net -} tsh() { ssh "$@" echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n" @@ -285,35 +257,14 @@ compdefas () { compdefas ssh tsh compdefas mv m mv mcl() { - mkdir -p $1 - cd $1 -} -create-repo() { - PRIVATE="true" - while getopts ":p" opt; do - case $opt in - p) - echo "-p was used, making public" - PRIVATE="false" - shift - ;; - esac - done - if [ -z "$1" ]; then - echo "No repo name" >&2 - return 2 - fi - echo -n "Username: " - read username - echo -n "Password: " - read -s password - curl --user "$username:$password" -d name="$1" -d private="$PRIVATE" https://gitea.austenwares.com/api/v1/user/repos + mkdir -p "$1" + cd "$1" } rc() { case $1 in z) vim ~/.zshrc;; v) vim ~/.vimrc;; - i) vim ~/.i3/config;; + i) vim ~/.config/i3/config;; use) sudo vim /etc/portage/package.use/package.use;; make) sudo vim /etc/portage/make.conf;; unmask) sudo vim /etc/portage/package.unmask/package.unmask;; @@ -325,17 +276,16 @@ rc() { esac } k() { - #More than 1 arguement + # More than 1 arguement if [[ $# > 1 ]] ; then vim $@ elif [ -d "$@" ] ; then - #cd then ls cd "$@" && ls elif [[ "$@" == "-" ]] ; then - #Because if this isn't here, k - won't work + # Because if this isn't here, k - won't work cd - && ls elif [ -f "$@" ] ; then - #Extract if it's extractable + # Extract if it's extractable case $1 in # Images *.png|*.jpg|*.gif) feh "$1" ;; @@ -365,7 +315,7 @@ k() { *) vim "$1" esac else - #Edit with vim + # Edit with vim echo -n "vim? " read a vim "$@" @@ -374,21 +324,29 @@ k() { if (( $+TMUX )) || [[ "$TERM" = "screen-256color" ]] || [[ "$TERM" = "screen.xterm-256color" ]]; then unset zle_bracketed_paste fi -#(( $+TMUX )) && unset zle_bracketed_paste [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh if ex fasd; then eval "$(fasd --init auto)" fi -#alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"' echo -ne '[# ]\r' -source ~/.zsh-git/liquidprompt/liquidprompt -#source ~/.zsh-git/omg/base.sh -#source ~/.zsh-git/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -#source ~/.zsh-git/oh-my-git-themes/af-magic.zsh-theme +#source ~/.zsh-git/liquidprompt/liquidprompt if [[ -f ~/.zsh-git/custom-config/zshrc ]]; then source ~/.zsh-git/custom-config/zshrc fi +function prompt_pre() { + export CESIUM_LAST_COMMAND_TIME="$(date +%s)" +} +function prompt_cmd() { + PS1="$(~/git/cesium/cesium --mode ps1 --rc "$?" --shell zsh)" + RPS1="$(~/git/cesium/cesium --mode rps1 --rc "$?" --shell zsh)" + unset CESIUM_LAST_COMMAND_TIME +} +function tmp() { + autoload -Uz add-zsh-hook + precmd_functions+=(prompt_cmd) + add-zsh-hook preexec prompt_pre +} echo -e '[##]' #zprof