From f807658d3807340dc370999bc7a284c89de68c48 Mon Sep 17 00:00:00 2001 From: Tyler Starr Date: Fri, 7 Jul 2023 23:55:13 -0700 Subject: [PATCH] Updates including wireguard vpn control --- home/dot_config/mimeapps.list | 2 +- home/dot_config/sway/config.tmpl | 3 +- .../sway/scripts/executable_status.sh.tmpl | 7 ++++- .../sway/scripts/executable_toggle-vpn.sh | 8 +++++ home/dot_config/tmuxp/dev.yml | 9 ++++++ provision/arch/additional-setup.md | 31 ++++++++++++++----- .../arch/ansible/tasks/desktop/packages.yml | 1 + .../arch/ansible/tasks/system/packages.yml | 1 + 8 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 home/dot_config/sway/scripts/executable_toggle-vpn.sh create mode 100644 home/dot_config/tmuxp/dev.yml diff --git a/home/dot_config/mimeapps.list b/home/dot_config/mimeapps.list index e52d8001..33a77b75 100644 --- a/home/dot_config/mimeapps.list +++ b/home/dot_config/mimeapps.list @@ -3,4 +3,4 @@ inode/directory=pcmanfm.desktop; text/html=firefox.desktop; x-scheme-handler/http=firefox.desktop; x-scheme-handler/https=firefox.desktop; - +application/pdf=firefox.desktop diff --git a/home/dot_config/sway/config.tmpl b/home/dot_config/sway/config.tmpl index 21bfcfaf..c5731e7d 100644 --- a/home/dot_config/sway/config.tmpl +++ b/home/dot_config/sway/config.tmpl @@ -5,7 +5,7 @@ #----- VARIABLES #------------------------------------------------------------------------------- -set $HOME /home/tstarr +set $HOME /home/{{ .user }} set $DISP_PRI DP-2 set $DISP_SEC HDMI-A-1 @@ -126,6 +126,7 @@ mode utility { bindsym q exit bindsym r reload bindsym g exec "~/.config/sway/scripts/gamemode.sh", $e + bindsym v exec "~/.config/sway/scripts/toggle-vpn.sh {{ .hostname }}", $e bindsym Escape mode default } diff --git a/home/dot_config/sway/scripts/executable_status.sh.tmpl b/home/dot_config/sway/scripts/executable_status.sh.tmpl index dc0db324..b99b49fe 100644 --- a/home/dot_config/sway/scripts/executable_status.sh.tmpl +++ b/home/dot_config/sway/scripts/executable_status.sh.tmpl @@ -43,7 +43,12 @@ rx=`expr $r2 - $r1` txmb=$(echo "scale = 1; $tx / 1280000" | bc | awk '{printf "%05.1f\n", $0}') rxmb=$(echo "scale = 1; $rx / 1280000" | bc | awk '{printf "%05.1f\n", $0}') +# Vpn status +vpn=$(nmcli c show --active | grep wireguard | cut -d ' ' -f1) +if $vpn ; then + vpn="none" +fi #lel -echo -e "👍 $txmb 👎 $rxmb | ⬆️ $uptime_formatted | 🔉$volume% | $gamemode | 🐧 $linux_version | $date_formatted " +echo -e "👍 $txmb 👎 $rxmb | 📡 $vpn | ⬆️ $uptime_formatted | 🔉$volume% | $gamemode | 🐧 $linux_version | $date_formatted " diff --git a/home/dot_config/sway/scripts/executable_toggle-vpn.sh b/home/dot_config/sway/scripts/executable_toggle-vpn.sh new file mode 100644 index 00000000..326fe195 --- /dev/null +++ b/home/dot_config/sway/scripts/executable_toggle-vpn.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +cons=$(nmcli -t -f NAME c show --active | grep $1) +if [ $cons ]; then + nmcli c down $1 1> /dev/null +else + nmcli c up $1 1> /dev/null +fi diff --git a/home/dot_config/tmuxp/dev.yml b/home/dot_config/tmuxp/dev.yml new file mode 100644 index 00000000..e507e14b --- /dev/null +++ b/home/dot_config/tmuxp/dev.yml @@ -0,0 +1,9 @@ +# tmuxp config for general dev + +session_name: dev +windows: + - window_name: editor + panes: + - shell_command: + - nvim + - window_name: term diff --git a/provision/arch/additional-setup.md b/provision/arch/additional-setup.md index 4773bfdf..2e7d85eb 100644 --- a/provision/arch/additional-setup.md +++ b/provision/arch/additional-setup.md @@ -1,6 +1,6 @@ # Additional Setup -The following documents some Debian setup that wasn't automated with ansible. +The following documents some Arch setup that wasn't automated with ansible. ## Wireguard Client @@ -12,6 +12,7 @@ Wireguard is nice for a home vpn and [pivpn](https://pivpn.io/) makes it easy. nmcli connection import type wireguard file ``` 3. Use `nm-connection-editor` to disable automatic connection +4. Connect to vpn with `nmcli connection up ## Mount network drives @@ -24,7 +25,7 @@ linux-mount- ## Taskopen for taskwarrior -[taskopen](https://github.com/jschlatow/taskopeni) is easier to install +[taskopen](https://github.com/jschlatow/taskopen) is easier to install manually at this point since it isn't packaged and uses nim. Might get this automated in the future. @@ -104,12 +105,26 @@ setup should usually be avoided by transfering the VM between machines: 2. On the source host run `virsh dumpxml VMNAME > domxml.xml` and copy this xml to the destination host 3. On the destination host run `virsh define domxml.xml` -## Google earth pro +## AUR Helper -[Google earth](https://www.google.com/earth/versions/) is nice for visualizing -my hikes and checking out snow levels. Download the RPM and install with yum. +I install the absolute minimum number of AUR packages (and I don't automate +thier installation). Run the following to install: -## Google chrome +```bash +git clone https://aur.archlinux.org/yay-git.git +cd yay +makepkg -si +``` -[Google chrome](https://www.google.com/chrome/) is gross, but I like to watch baseball. -Download the RPM and install with yum. +I usually install the following packages: + +1. Google Earth +2. Google Chrome (I like baseball) + +## Yuzu + +Copy over the `~/.config/yuzu` and `~/.local/share/yuzu` from prior install. + +## GTK Theme + +Set the GTK theme to `dracula` within the gnome-tweaks application. diff --git a/provision/arch/ansible/tasks/desktop/packages.yml b/provision/arch/ansible/tasks/desktop/packages.yml index 8a8b17d3..c71a5f01 100644 --- a/provision/arch/ansible/tasks/desktop/packages.yml +++ b/provision/arch/ansible/tasks/desktop/packages.yml @@ -4,6 +4,7 @@ - mpv # Video player based on MPlayer/mplayer2 - ffmpeg # Decoding, encoding and streaming software - firefox + - gnome-tweaks state: present become: true diff --git a/provision/arch/ansible/tasks/system/packages.yml b/provision/arch/ansible/tasks/system/packages.yml index fcf61290..8afca4c6 100644 --- a/provision/arch/ansible/tasks/system/packages.yml +++ b/provision/arch/ansible/tasks/system/packages.yml @@ -21,6 +21,7 @@ - chezmoi - dbus-broker - vulkan-tools + - fuse2 state: present become: true