diff --git a/.bashrc b/.bashrc index 9bef3e0..4b373e9 100644 --- a/.bashrc +++ b/.bashrc @@ -132,3 +132,6 @@ export PATH="$PATH:$HOME/.rvm/bin" source /home/david/.config/broot/launcher/bash/br alias repl="NODE_PATH=$(npm root -g) node" + +# Scaleway CLI autocomplete initialization. +eval "$(scw autocomplete script shell=bash)" diff --git a/i3/config b/i3/config index 8ead6eb..f1a3c74 100644 --- a/i3/config +++ b/i3/config @@ -17,12 +17,12 @@ set $super Mod4 font pango:monospace 8 #exec feh --bg-fill /home/david/Pictures/Wallpapers/ellie_full.jpg -exec feh --bg-fill /home/david/Pictures/wall.jpg +exec feh --bg-fill /home/david/Pictures/wall.png exec setxkbmap -layout gb,ru -variant ,winkeys -option grp:caps_toggle,grp_led:scroll,terminate:ctrl_alt_bksp,compose:ralt exec dunst exec xbindkeys exec pasystray - +exec clipit # This font is widely installed, provides lots of unicode glyphs, right-to-left # text rendering and scalability on retina/hidpi displays (thanks to pango). @@ -65,7 +65,7 @@ bindsym $mod+Shift+q kill 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 F3 exec exec /home/david/dotfiles/scripts/rofi/rofi-ssh.sh bindsym F2 exec rofi -modi window -show window -theme Arc-Dark # There also is the (new) i3-dmenu-desktop which only displays applications @@ -169,7 +169,8 @@ bindsym $mod+i exec "/usr/bin/mocp -r" # Force mpv to left-most screen for_window [class="mpv"] move to workspace media -bindsym $super+l exec i3lock-fancy & sleep 1 && xset dpms force off +bindsym $super+l exec i3lock -i /home/david/Pictures/wall.png & sleep 1 && xset dpms force off +#bindsym $super+l exec i3lock & sleep 1 && xset dpms force off # reload the configuration file bindsym $mod+Shift+t reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) diff --git a/scripts/rofi/rofi-openvpn.sh b/scripts/rofi/rofi-openvpn.sh index 61cd3a4..55268cb 100755 --- a/scripts/rofi/rofi-openvpn.sh +++ b/scripts/rofi/rofi-openvpn.sh @@ -1,25 +1,25 @@ #!/bin/bash -# Copied from: https://git.john.me.tz/jpm/scripts -# Passwordless sudo required +# David Aizenberg +# 2020 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 +if [ "$res" = "SecurEdge" ]; then sudo /usr/bin/systemctl stop openvpn@* sudo /usr/bin/systemctl start openvpn@SecurEdge -elif [ $res = "homelab" ]; then +elif [ "$res" = "homelab" ]; then sudo /usr/bin/systemctl stop openvpn@* sudo /usr/bin/systemctl start openvpn@homelab -elif [ $res = "bohdan" ]; then +elif [ "$res" = "bohdan" ]; then sudo /usr/bin/systemctl stop openvpn@* sudo /usr/bin/systemctl start openvpn@bogdan -elif [ $res = "Disconnect" ]; then +elif [ "$res" = "Disconnect" ]; then sudo /usr/bin/systemctl stop openvpn@* -elif [ $res = "Restart" ]; then +elif [ "$res" = "Restart" ]; then sudo /usr/bin/systemctl restart openvpn@* fi -if [ "$(pgrep -c i3blocks)" -gt 0 ]; then +if [ ! -z "$res" ] && [ "$(pgrep -c i3blocks)" -gt 0 ]; then sleep 2s pkill -SIGRTMIN+10 i3blocks sleep 2s diff --git a/scripts/rofi/rofi-ssh.sh b/scripts/rofi/rofi-ssh.sh new file mode 100755 index 0000000..ed7b63d --- /dev/null +++ b/scripts/rofi/rofi-ssh.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# David Aizenberg +# 2020 +# hosts file format, comma separated +# hostname, port, pretty_name, path_to_key user + + +hostsFile='/home/david/.ssh/ssh.hosts' +lines=20 + +while read host; do + + if [[ ! ${host:0:1} = \# ]]; then + if [ ! -z "$host" ]; then + hosts+=$(echo $host | awk -F, '{print $3}')'|' + fi + fi + +done <$hostsFile + +res=$(echo "${hosts::-1}" | rofi -sep "|" -dmenu -i -p 'SSH: ' "" -theme Arc-Dark -columns 1 -width 45 -l "$lines" -hide-scrollbar -eh1 -location 0 -auto-select -no-fullscreen) +if [ ! -z "$res" ]; then + connectString=$(cat $hostsFile | grep "$res" | awk -F, '{print "ssh " $5 "@" $1 " -p " $2 " -i " $4}') + xfce4-terminal -e "$connectString" +fi +exit 0 \ No newline at end of file