Restructure bar restart and fix typos in ethz-vpn

This commit is contained in:
2025-09-09 13:28:31 +02:00
parent a199569aac
commit 106fe9cd9e
4 changed files with 21 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
connect() { connect() {
read -sp $'Please type in your Encryption Password:\n' encpass read -sp $'Please enter your Encryption Password:\n' encpass
TOKEN=$(cat ~/.local/share/ethz-vpn-connect/ethzvpntoken.secret | openssl enc -aes-256-cbc -pbkdf2 -d -a -k $encpass) TOKEN=$(cat ~/.local/share/ethz-vpn-connect/ethzvpntoken.secret | openssl enc -aes-256-cbc -pbkdf2 -d -a -k $encpass)
PASSWORD=$(cat ~/.local/share/ethz-vpn-connect/ethzvpnpass.secret | openssl enc -aes-256-cbc -pbkdf2 -d -a -k $encpass) PASSWORD=$(cat ~/.local/share/ethz-vpn-connect/ethzvpnpass.secret | openssl enc -aes-256-cbc -pbkdf2 -d -a -k $encpass)
USERNAME=$(cat ~/.local/share/ethz-vpn-connect/ethzvpnusername.txt) USERNAME=$(cat ~/.local/share/ethz-vpn-connect/ethzvpnusername.txt)
@@ -17,13 +17,13 @@ disconnect() {
setup() { setup() {
echo 'You are about to overwrite your secrets. Press ctrl + C to cancel.' echo 'You are about to overwrite your secrets. Press ctrl + C to cancel.'
read -p $'Please type in your Username: ' USERNAME read -p $'Please enter your ETHZ-Username: ' USERNAME
echo 'Ok!' echo 'Ok!'
read -sp $'Please type in your Encryption Password: ' encpass read -sp $'Please choose and enter your Encryption Password (will be required when launching): ' encpass
echo 'Ok!' echo 'Ok!'
read -sp $'Please type in your ETHZ WLAN Password: ' PASSWORD read -sp $'Please enter your ETHZ WLAN (= Radius) Password: ' PASSWORD
echo 'Ok!' echo 'Ok!'
read -sp $'Please type in your ETHZ OTP Secret: ' TOKEN read -sp $'Please enter your ETHZ OTP Secret: ' TOKEN
mkdir ~/.local/share/ethz-vpn-connect mkdir ~/.local/share/ethz-vpn-connect
echo $PASSWORD | openssl enc -aes-256-cbc -pbkdf2 -a -k $encpass >~/.local/share/ethz-vpn-connect/ethzvpnpass.secret echo $PASSWORD | openssl enc -aes-256-cbc -pbkdf2 -a -k $encpass >~/.local/share/ethz-vpn-connect/ethzvpnpass.secret
echo $TOKEN | openssl enc -aes-256-cbc -pbkdf2 -a -k $encpass >~/.local/share/ethz-vpn-connect/ethzvpntoken.secret echo $TOKEN | openssl enc -aes-256-cbc -pbkdf2 -a -k $encpass >~/.local/share/ethz-vpn-connect/ethzvpntoken.secret
@@ -54,6 +54,6 @@ setup)
setup setup
;; ;;
*) *)
echo -e 'Usage: ethz-vpn [Option] \n [Option]: \n connect, c: Connect VPN \n disconnect, d, dc: Disconnect VPN \n setup: set secrets and eth-Kürzel.\n' echo -e 'Usage: ethz-vpn [Option] \n [Option]: \n connect, c: Connect VPN \n disconnect, d, dc: Disconnect VPN \n setup: set secrets and eth-Username.\n'
;; ;;
esac esac

View File

@@ -3,13 +3,6 @@
cp -f ~/.config/hypr/hyprland_docked.conf ~/.config/hypr/hyprland.conf cp -f ~/.config/hypr/hyprland_docked.conf ~/.config/hypr/hyprland.conf
cp -f ~/.config/rofi/config_desktop.rasi ~/.config/rofi/config.rasi cp -f ~/.config/rofi/config_desktop.rasi ~/.config/rofi/config.rasi
echo " ==> Restarting ags... " ./restart-bar
killall gjs
killall ags
sleep 5
ags run -d ~/projects/active/dotfiles/config/astal --gtk4 & disown
sleep 2
ags run -d ~/projects/active/dotfiles/config/ags/notifications & disown
echo " ==> Done! To revert to normal config, run change-wallpaper" echo " ==> Done! To revert to normal config, run change-wallpaper"

13
scripts/restart-bar Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
echo "
=> Restarting ags
"
killall gjs
killall ags
sleep 4
ags run -d ~/projects/active/dotfiles/config/astal --gtk4 & disown
sleep 2
ags run -d ~/projects/active/dotfiles/config/ags/notifications & disown

11
setup
View File

@@ -97,16 +97,7 @@ sudo cp ./system/environment /etc/environment
sudo cp -r ./system/greetd/* /etc/greetd/ sudo cp -r ./system/greetd/* /etc/greetd/
hyprctl reload hyprctl reload
echo " ./scripts/restart-bar
=> Restarting bars, etc
-> This will take a couple of seconds to ensure them quitting properly
"
killall gjs
killall ags
sleep 5
ags run -d ~/projects/active/dotfiles/config/astal --gtk4 & disown
sleep 2
ags run -d ~/projects/active/dotfiles/config/ags/notifications & disown
echo " echo "