mirror of
https://github.com/neoromantique/dotfiles.git
synced 2026-03-13 21:53:20 +03:00
ovpn rofi
This commit is contained in:
12
.bashrc
12
.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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
29
scripts/rofi/rofi-openvpn.sh
Executable file
29
scripts/rofi/rofi-openvpn.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user