aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-02-03 00:01:16 +0300
committerYaroslav <contact@yaroslavps.com>2020-02-03 00:01:16 +0300
commite5532752993f463524e0c89d5e82b5a84a77759b (patch)
tree0ce47eba97ecd5256d6cd29c86a50ac756b30cc1 /dotfiles/.local/bin
parent2cb2af9d66ef98877ffee2f588c7a85036750d55 (diff)
downloadswayrice-e5532752993f463524e0c89d5e82b5a84a77759b.tar.gz
swayrice-e5532752993f463524e0c89d5e82b5a84a77759b.zip
load gtk settings on sway start, vpn shortcut and waybar indicator
Diffstat (limited to 'dotfiles/.local/bin')
-rwxr-xr-xdotfiles/.local/bin/barrecstatus8
-rwxr-xr-xdotfiles/.local/bin/barvpnstatus9
-rwxr-xr-xdotfiles/.local/bin/barweather (renamed from dotfiles/.local/bin/i3barweather)0
-rwxr-xr-xdotfiles/.local/bin/i3barmusic18
-rwxr-xr-xdotfiles/.local/bin/i3barrecstatus8
-rwxr-xr-xdotfiles/.local/bin/swayrecord8
-rwxr-xr-xdotfiles/.local/bin/swaystart12
-rwxr-xr-xdotfiles/.local/bin/togglevpn16
8 files changed, 37 insertions, 42 deletions
diff --git a/dotfiles/.local/bin/barrecstatus b/dotfiles/.local/bin/barrecstatus
new file mode 100755
index 0000000..b7bb8b4
--- /dev/null
+++ b/dotfiles/.local/bin/barrecstatus
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ -f "$HOME/.cache/recordingpid" ]; then
+ printf "⏺ rec"
+ exit
+fi
+
+printf ""
diff --git a/dotfiles/.local/bin/barvpnstatus b/dotfiles/.local/bin/barvpnstatus
new file mode 100755
index 0000000..1af57c4
--- /dev/null
+++ b/dotfiles/.local/bin/barvpnstatus
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -f "$HOME/.cache/openvpnpid" ]; then
+ printf "🔐 vpn"
+ exit
+fi
+
+printf ""
+
diff --git a/dotfiles/.local/bin/i3barweather b/dotfiles/.local/bin/barweather
index 0ae6d3c..0ae6d3c 100755
--- a/dotfiles/.local/bin/i3barweather
+++ b/dotfiles/.local/bin/barweather
diff --git a/dotfiles/.local/bin/i3barmusic b/dotfiles/.local/bin/i3barmusic
deleted file mode 100755
index 5647a81..0000000
--- a/dotfiles/.local/bin/i3barmusic
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-filter() {
- sed "/^volume:/d" | tac | sed -e "s/\\&/&amp;/g;s/\\[paused\\].*/<span color=\"gray\" font_style=\"italic\">/g;s/\\[playing\\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\\/span>/g"
- }
-
-case $BLOCK_BUTTON in
- 1) mpc toggle | filter ;;
- 2) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;;
- 3) mpc status | filter && notify-send "🎵 Music module" "\- Shows mpd song playing.
-- Italic when paused.
-- Left click opens ncmpcpp.
-- Middle click pauses.
-- Scroll changes track.";; # right click, pause/unpause
- 4) mpc prev | filter ;; # scroll up, previous
- 5) mpc next | filter ;; # scroll down, next
- *) mpc status | filter ;;
-esac; exit
diff --git a/dotfiles/.local/bin/i3barrecstatus b/dotfiles/.local/bin/i3barrecstatus
deleted file mode 100755
index 5c8160a..0000000
--- a/dotfiles/.local/bin/i3barrecstatus
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ -f "$HOME/.recordingpid" ]; then
- printf "rec ⏺"
- exit
-fi
-
-printf ""
diff --git a/dotfiles/.local/bin/swayrecord b/dotfiles/.local/bin/swayrecord
index 90ed24a..378b46f 100755
--- a/dotfiles/.local/bin/swayrecord
+++ b/dotfiles/.local/bin/swayrecord
@@ -1,14 +1,14 @@
#!/bin/sh
-if [ -f "$HOME/.recordingpid" ]; then
+if [ -f "$HOME/.cache/recordingpid" ]; then
killall -SIGINT wf-recorder
- rm -f ~/.recordingpid
+ rm -f ~/.cache/recordingpid
notify-send "⏺ Screen recording" "Recording stopped"
killall -39 waybar
exit
fi
-wf-recorder -f "$HOME/Video/recordings/$(date '+%y%m%d-%H%M-%S').mp4" &
-echo $! > ~/.recordingpid
+wf-recorder -f "$HOME/Videos/recordings/$(date '+%y%m%d-%H%M-%S').mp4" &
+echo $! > ~/.cache/recordingpid
notify-send "⏺ Screen recording" "Recording started"
killall -39 waybar
diff --git a/dotfiles/.local/bin/swaystart b/dotfiles/.local/bin/swaystart
deleted file mode 100755
index 46f6f0e..0000000
--- a/dotfiles/.local/bin/swaystart
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-export SCROT_DIR=$HOME/Pictures/screenshots/
-export GDK_BACKEND=wayland
-export EGL_PLATFORM=wayland
-export CLUTTER_PLATFORM=wayland
-export SDL_VIDEODRIVER=wayland
-export QT_QPA_PLATFORM=wayland-egl
-export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
-export QT_QPA_PLATFORMTHEME="qt5ct"
-export _JAVA_AWT_WM_NONREPARENTING=1
-sway --my-next-gpu-wont-be-nvidia
diff --git a/dotfiles/.local/bin/togglevpn b/dotfiles/.local/bin/togglevpn
new file mode 100755
index 0000000..f1a6bdb
--- /dev/null
+++ b/dotfiles/.local/bin/togglevpn
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+if [ -f "$HOME/.cache/openvpnpid" ]; then
+ sudo killall -SIGINT openvpn
+ exit
+fi
+
+sudo openvpn "$HOME/.config/ovpn/conf.ovpn" &
+PID=$!
+notify-send "🔐 OpenVPN" "VPN is being initialized"
+echo $PID > ~/.cache/openvpnpid
+killall -40 waybar
+wait $PID
+notify-send "🔐 OpenVPN" "VPN service has stopped with exit code $?"
+rm ~/.cache/openvpnpid
+killall -40 waybar