diff --git a/.bashrc b/.bashrc index 8369399..9bef3e0 100644 --- a/.bashrc +++ b/.bashrc @@ -9,8 +9,12 @@ #Exports EDITOR=vim -#Thanks to http://bashrcgenerator.com/ -export PS1="\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]@\h:\[\e[0m\]\[\e[00;36m\][\[\e[0m\]\[\e[00;32m\]\w\[\e[0m\]\[\e[00;36m\]]\[\e[0m\]\[\e[00;37m\]\\$ \[\e[0m\]" + +getCurrentSKMKey() { + skm ls | grep -e '->' | awk '{print $2}' +} + +export PS1='`date +'%H:%M'`:[\h]|\e[00;33m\]πŸ”‘`getCurrentSKMKey`\e[00;0m\]|`pwd` \n\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]$ ' #Aliases alias ls='ls -hF --color' # add colors for filetype recognition @@ -22,8 +26,6 @@ alias mv='mv -i' # ^ alias ..='cd ..' # convinient navigation alias vi='vim' # Also convinient -alias joplin='/home/david/.joplin/Joplin.AppImage' - alias ss='sshch' alias rtv='rtv --enable-media' @@ -103,7 +105,6 @@ alias yavide="gvim --servername yavide -f -N -u /opt/yavide/.vimrc" alias t="clear; todoist list --filter '(overdue | today | tomorrow) | p1'" - # function ta() { # t "$1" # t @@ -126,7 +127,6 @@ PATH=$GOPATH/bin:$PATH # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. export PATH="$PATH:$HOME/.rvm/bin" -eval "$(starship init bash)" [[ -s "/etc/profile.d/grc.bashrc" ]] && source /etc/profile.d/grc.bashrc source /home/david/.config/broot/launcher/bash/br diff --git a/i3/config b/i3/config index 8c47afe..8ead6eb 100644 --- a/i3/config +++ b/i3/config @@ -64,6 +64,7 @@ bindsym $mod+Shift+q kill #bindsym $mod+d exec dmenu_run bindsym $mod+d exec rofi -show run -modi run -theme Arc-Dark bindsym $mod+Shift+d exec rofi -show drun -modi run -show-icons -theme Arc-Dark +bindsym F4 exec exec /home/david/dotfiles/scripts/rofi/rofi-openvpn.sh bindsym F3 exec rofi -modi ssh -show ssh -theme Arc-Dark bindsym F2 exec rofi -modi window -show window -theme Arc-Dark diff --git a/i3blocks.conf b/i3blocks.conf index 4fd9851..ea663f0 100644 --- a/i3blocks.conf +++ b/i3blocks.conf @@ -25,8 +25,14 @@ command= sh ~/dotfiles/scripts/corona.sh color=#ffffff interval=240 +[ip] +command=curl -s ip.me | awk '{ print "IP:" $1 }' +interval=once +signal=10 +color=#91E78B + # Update time every 5 seconds [time] command=echo "πŸ‡±πŸ‡Ή $(date +%H:%M) πŸ‡ΊπŸ‡Έ $(TZ="America/Los_Angeles" date +%H:%M) " color=#ffffff -interval=5 +interval=10 diff --git a/scripts/rofi/rofi-openvpn.sh b/scripts/rofi/rofi-openvpn.sh new file mode 100755 index 0000000..61cd3a4 --- /dev/null +++ b/scripts/rofi/rofi-openvpn.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copied from: https://git.john.me.tz/jpm/scripts +# Passwordless sudo required + +res=$(echo "SecurEdge|homelab|bohdan|Disconnect|Restart" | rofi -sep "|" -dmenu -i -p 'OpenVPN: ' "" -theme Arc-Dark -columns 9 -width 45 -l 1 -hide-scrollbar -eh 1 -location 0 -auto-select -no-fullscreen) + +if [ $res = "SecurEdge" ]; then + sudo /usr/bin/systemctl stop openvpn@* + sudo /usr/bin/systemctl start openvpn@SecurEdge +elif [ $res = "homelab" ]; then + sudo /usr/bin/systemctl stop openvpn@* + sudo /usr/bin/systemctl start openvpn@homelab +elif [ $res = "bohdan" ]; then + sudo /usr/bin/systemctl stop openvpn@* + sudo /usr/bin/systemctl start openvpn@bogdan +elif [ $res = "Disconnect" ]; then + sudo /usr/bin/systemctl stop openvpn@* +elif [ $res = "Restart" ]; then + sudo /usr/bin/systemctl restart openvpn@* +fi + +if [ "$(pgrep -c i3blocks)" -gt 0 ]; then + sleep 2s + pkill -SIGRTMIN+10 i3blocks + sleep 2s + pkill -SIGRTMIN+10 i3blocks +fi + +exit 0 \ No newline at end of file