From e5532752993f463524e0c89d5e82b5a84a77759b Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Mon, 3 Feb 2020 00:01:16 +0300 Subject: load gtk settings on sway start, vpn shortcut and waybar indicator --- dotfiles/.config/ranger/rc.conf | 4 ++-- dotfiles/.config/sway/config | 13 +++++++++++-- dotfiles/.config/waybar/config | 15 ++++++++++++--- dotfiles/.config/waybar/style.css | 3 ++- dotfiles/.local/bin/barrecstatus | 8 ++++++++ dotfiles/.local/bin/barvpnstatus | 9 +++++++++ dotfiles/.local/bin/barweather | 18 ++++++++++++++++++ dotfiles/.local/bin/i3barmusic | 18 ------------------ dotfiles/.local/bin/i3barrecstatus | 8 -------- dotfiles/.local/bin/i3barweather | 18 ------------------ dotfiles/.local/bin/swayrecord | 8 ++++---- dotfiles/.local/bin/swaystart | 12 ------------ dotfiles/.local/bin/togglevpn | 16 ++++++++++++++++ dotfiles/.profile | 5 +++-- 14 files changed, 85 insertions(+), 70 deletions(-) create mode 100755 dotfiles/.local/bin/barrecstatus create mode 100755 dotfiles/.local/bin/barvpnstatus create mode 100755 dotfiles/.local/bin/barweather delete mode 100755 dotfiles/.local/bin/i3barmusic delete mode 100755 dotfiles/.local/bin/i3barrecstatus delete mode 100755 dotfiles/.local/bin/i3barweather delete mode 100755 dotfiles/.local/bin/swaystart create mode 100755 dotfiles/.local/bin/togglevpn (limited to 'dotfiles') diff --git a/dotfiles/.config/ranger/rc.conf b/dotfiles/.config/ranger/rc.conf index 5a56a0e..e775dfb 100644 --- a/dotfiles/.config/ranger/rc.conf +++ b/dotfiles/.config/ranger/rc.conf @@ -441,7 +441,7 @@ map om cd ~/Music map opp cd ~/Pictures map opw cd ~/Pictures/wallpapers map ops cd ~/Pictures/screenshots -map ovv cd ~/Video +map ovv cd ~/Videos map or cd ~/Repositories map os cd ~/.local/bin map ocf cd ~/.config @@ -456,7 +456,7 @@ map Omm tab_new ~/Music map Opp tab_new ~/Pictures map Opw tab_new ~/Pictures/wallpapers map Ops tab_new ~/Pictures/screenshots -map Ovv tab_new ~/Video +map Ovv tab_new ~/Videos map Or tab_new ~/Repositories map Os tab_new ~/.local/bin map Ocf tab_new ~/.config diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index 1cf4d43..94b0de9 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -24,6 +24,12 @@ font pango:BlexMono Nerd Font Mono 10 # Use Mouse+$mod to drag floating windows floating_modifier $mod +# GTK theme and icons +set $gnome-schema org.gnome.desktop.interface +exec_always { + gsettings set $gnome-schema gtk-theme 'oomox-materia-dark' + gsettings set $gnome-schema icon-theme 'Papirus-Dark' +} ##### Startup scripts and programs ##### # Waybar @@ -31,7 +37,6 @@ exec --no-startup-id waybar_launch # KDE Connect exec --no-startup-id kdeconnect-indicator # music daemon -# exec_always --no-startup-id ~/.scripts/mopidy_launch exec --no-startup-id mpd # Bluetooth adapter applet exec_always --no-startup-id blueman-applet @@ -113,7 +118,7 @@ input 2:10:TPPS/2_IBM_TrackPoint pointer_accel 1 # Outputs output "*" background ~/.config/wall1.png fill # Laptop display -output "eDP-1" scale 1.53 pos 0 0 +output "eDP-1" scale 1.6 pos 0 0 scale_filter smart # Keymaps input * xkb_layout "us,es,ru" @@ -186,6 +191,10 @@ bindsym --to-code { $mod+grave exec --no-startup-id menuducksearch $mod+Shift+grave exec --no-startup-id menuemoji $mod+F1 exec --no-startup-id zathura ~/.config/i3/i3guide.pdf + + # Network management + $mod+Shift+c exec togglevpn + # Network management $mod+Shift+n exec $term -e 'nmtui' # Screenshot and recording diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config index c543e94..a0aa3a6 100644 --- a/dotfiles/.config/waybar/config +++ b/dotfiles/.config/waybar/config @@ -14,8 +14,10 @@ "custom/weather" ], "modules-right": [ + "custom/rec-status", "custom/swaykbd", "backlight", + "custom/vpn-status", "network", "battery#bat0", "battery#bat1", @@ -159,14 +161,21 @@ "on-click": "termite -e ncpamixer" }, "custom/rec-status": { - "format": "{}", + "format": "{}", "signal": 5, - "exec": "i3barrecstatus" + "interval": "once", + "exec": "barrecstatus" + }, + "custom/vpn-status": { + "format": "{}", + "signal": 6, + "interval": "once", + "exec": "barvpnstatus" }, "custom/weather": { "format": "{}", "interval": 900, - "exec": "i3barweather" + "exec": "barweather" }, "custom/swaykbd": { "format": " {}", diff --git a/dotfiles/.config/waybar/style.css b/dotfiles/.config/waybar/style.css index 44bae1e..e066c6a 100644 --- a/dotfiles/.config/waybar/style.css +++ b/dotfiles/.config/waybar/style.css @@ -63,8 +63,9 @@ window#waybar { #temperature, #custom-weather, #custom-rec-status, +#custom-vpn-status, #custom-swaykbd { - padding: 0 8px; + padding: 0 6px; } #custom-weather { color: #5b8277; 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/barweather b/dotfiles/.local/bin/barweather new file mode 100755 index 0000000..0ae6d3c --- /dev/null +++ b/dotfiles/.local/bin/barweather @@ -0,0 +1,18 @@ +#!/bin/bash + +location="Saint Petersburg" + +if [[ "$location" != "" ]] +then + location="~${location// /+}" +fi + +forecast=$(curl -s wttr.in/$location?format=1) + +if [[ ${#forecast} -gt 30 ]] +then + exit +fi + +echo $forecast + 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/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//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/i3barweather b/dotfiles/.local/bin/i3barweather deleted file mode 100755 index 0ae6d3c..0000000 --- a/dotfiles/.local/bin/i3barweather +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -location="Saint Petersburg" - -if [[ "$location" != "" ]] -then - location="~${location// /+}" -fi - -forecast=$(curl -s wttr.in/$location?format=1) - -if [[ ${#forecast} -gt 30 ]] -then - exit -fi - -echo $forecast - 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 diff --git a/dotfiles/.profile b/dotfiles/.profile index 28465da..5e37a2f 100644 --- a/dotfiles/.profile +++ b/dotfiles/.profile @@ -1,6 +1,6 @@ export PATH=$PATH:$HOME/.local/bin export SCROT_DIR=$HOME/Pictures/screenshots/ -export GDK_BACKEND=wayland +#export GDK_BACKEND=wayland export EGL_PLATFORM=wayland export CLUTTER_PLATFORM=wayland export SDL_VIDEODRIVER=wayland @@ -16,8 +16,9 @@ export TERMINAL=termite export EDITOR="nvim" export BROWSER=qutebrowser export ZDOTDIR="$HOME/.config/zsh" +export INPUTRC="$HOME/.config/zsh/inputrc" if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then - .scripts/swaystart + sway fi -- cgit v1.2.3