Compare commits
3 Commits
f579405d8c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
13b1fd9ba9
|
|||
|
fed0835ad7
|
|||
| 7ebccf3057 |
4
cachyos
Normal file
4
cachyos
Normal file
@ -0,0 +1,4 @@
|
||||
cachyos-keyring
|
||||
cachyos-mirrorlist
|
||||
cachyos-v3-mirrorlist
|
||||
cachyos-v4-mirrorlist
|
||||
@ -27,7 +27,7 @@ monitor = ,highrr,auto,1
|
||||
# Set programs that you use
|
||||
$terminal = kitty
|
||||
$fileManager = dolphin
|
||||
$menu = fuzzel
|
||||
$menu = tofi-drun --drun-launch=true -c /home/fergus/.config/tofi.conf
|
||||
|
||||
|
||||
#################
|
||||
|
||||
94
packages
Normal file
94
packages
Normal file
@ -0,0 +1,94 @@
|
||||
base
|
||||
base-devel
|
||||
bash
|
||||
bat
|
||||
btop
|
||||
coreutils
|
||||
curl
|
||||
discord
|
||||
docker
|
||||
docker-buildx
|
||||
docker-compose
|
||||
efibootmgr
|
||||
efitools
|
||||
elixir
|
||||
erlang
|
||||
exfat-utils
|
||||
eza
|
||||
fastfetch
|
||||
fd
|
||||
firefox
|
||||
fzf
|
||||
gdm
|
||||
git
|
||||
go
|
||||
golangci-lint
|
||||
gopls
|
||||
hip-runtime-amd
|
||||
hipblas
|
||||
hipblas-common
|
||||
hsa-rocr
|
||||
hyprcursor
|
||||
hypridle
|
||||
hyprland
|
||||
hyprlock
|
||||
hyprshot
|
||||
inotify-tools
|
||||
intel-ucode
|
||||
jq
|
||||
just
|
||||
kitty
|
||||
linux-firmware
|
||||
linux
|
||||
lld
|
||||
lua
|
||||
lua-language-server
|
||||
luajit
|
||||
neovim
|
||||
nodejs
|
||||
noto-fonts
|
||||
noto-fonts-emoji
|
||||
noto-fonts-extra
|
||||
npm
|
||||
nvtop
|
||||
pipewire
|
||||
python
|
||||
rdma-core
|
||||
ripgrep
|
||||
rocblas
|
||||
rocm-core
|
||||
rocm-device-libs
|
||||
rocm-llvm
|
||||
rocminfo
|
||||
rocprim
|
||||
rocprofiler-register
|
||||
rocsolver
|
||||
rocsparse
|
||||
roctracer
|
||||
rtkit
|
||||
rustup
|
||||
sbctl
|
||||
starship
|
||||
stow
|
||||
stylua
|
||||
sudo
|
||||
swaync
|
||||
tmux
|
||||
ttf-jetbrains-mono-nerd
|
||||
ttf-liberation
|
||||
ttf-noto-nerd
|
||||
ufw
|
||||
unzip
|
||||
uwsm
|
||||
watchexec
|
||||
waybar
|
||||
wayland
|
||||
wget
|
||||
wireguard-tools
|
||||
wireplumber
|
||||
wl-clipboard
|
||||
xdg-desktop-portal
|
||||
xdg-user-dirs
|
||||
zsh
|
||||
zsh-autosuggestions
|
||||
zstd
|
||||
33
vpn/PKGBUILD
Normal file
33
vpn/PKGBUILD
Normal file
@ -0,0 +1,33 @@
|
||||
# Maintainer: Your Name <fergus@molloy.xyz>
|
||||
pkgname=vpn
|
||||
pkgver=1.0.0
|
||||
pkgrel=1
|
||||
epoch=
|
||||
pkgdesc="Bash script to manage wireguard vpn connections"
|
||||
arch=(any)
|
||||
url=""
|
||||
license=('Unlicense')
|
||||
groups=()
|
||||
depends=(wireguard-tools)
|
||||
makedepends=()
|
||||
checkdepends=()
|
||||
optdepends=()
|
||||
provides=()
|
||||
conflicts=()
|
||||
replaces=()
|
||||
backup=()
|
||||
options=()
|
||||
install=
|
||||
changelog=
|
||||
source=("vpn")
|
||||
noextract=("vpn")
|
||||
sha256sums=(
|
||||
4049e2b082f88a06ef0890498f556018d07939d5f2fb54a9d409fbeb8023be47
|
||||
)
|
||||
validpgpkeys=()
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir"
|
||||
install -D -m 755 vpn "${pkgdir}/usr/bin/vpn"
|
||||
}
|
||||
|
||||
119
vpn/vpn
Executable file
119
vpn/vpn
Executable file
@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# check user is root
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Initialize variables
|
||||
ACTION=""
|
||||
VPN_NAME=""
|
||||
DEFAULT_VPN="p-sweden"
|
||||
|
||||
# Function to display usage
|
||||
usage() {
|
||||
echo "Usage: $0 [COMMAND] [VPN_NAME]"
|
||||
echo "Commands:"
|
||||
echo " (no args) Get VPN status"
|
||||
echo " list List available VPN connections"
|
||||
echo " down Disconnect from VPN"
|
||||
echo " up Connect to default VPN"
|
||||
echo " up <name> Connect to specific VPN"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse command line arguments
|
||||
case $# in
|
||||
0)
|
||||
# No arguments - get status
|
||||
ACTION="status"
|
||||
;;
|
||||
1)
|
||||
case $1 in
|
||||
"list")
|
||||
ACTION="list"
|
||||
;;
|
||||
"down")
|
||||
ACTION="down"
|
||||
;;
|
||||
"up")
|
||||
ACTION="up"
|
||||
VPN_NAME="$DEFAULT_VPN"
|
||||
;;
|
||||
"help"|"-h"|"--help")
|
||||
usage
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unknown command '$1'"
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
2)
|
||||
case $1 in
|
||||
"up")
|
||||
ACTION="up"
|
||||
VPN_NAME="$2"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Command '$1' does not accept additional arguments"
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Error: Too many arguments"
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
down() {
|
||||
CURRENT_CONNECTION="$(wg | grep interface | sed 's/.*: //')"
|
||||
|
||||
if [ ! -z $CURRENT_CONNECTION ]; then
|
||||
wg-quick down $CURRENT_CONNECTION
|
||||
printf "\n\x1b[1;31mDisconnected from $CURRENT_CONNECTION\x1b[0m\n"
|
||||
else
|
||||
echo "Not connected"
|
||||
fi
|
||||
}
|
||||
|
||||
up() {
|
||||
down
|
||||
|
||||
FOUND_CONFIGS=$(fd -tf "$VPN_NAME" -e "conf" --format '{/.}' /etc/wireguard)
|
||||
POSSIBLE_CONFIG_COUNTS=$(echo $FOUND_CONFIGS | wc -l)
|
||||
|
||||
if [ $POSSIBLE_CONFIG_COUNTS -eq 0 ]; then
|
||||
echo "No configuration found for $VPN_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $POSSIBLE_CONFIG_COUNTS -gt 1 ]; then
|
||||
echo "Mulitple configurations found for $VPN_NAME:"
|
||||
echo $FOUND_CONFIGS
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "\n\x1b[1;32mConnecting to $FOUND_CONFIGS\x1b[0m\n\n"
|
||||
wg-quick up $FOUND_CONFIGS
|
||||
}
|
||||
|
||||
|
||||
# Example of how to use the variables
|
||||
case $ACTION in
|
||||
"status")
|
||||
wg
|
||||
;;
|
||||
"list")
|
||||
echo "Possible connections:"
|
||||
fd . -tf -e "conf" --format '{/.}' /etc/wireguard
|
||||
;;
|
||||
"down")
|
||||
down
|
||||
;;
|
||||
"up")
|
||||
up
|
||||
;;
|
||||
esac
|
||||
@ -86,7 +86,7 @@ total %*E
|
||||
|
||||
# add common bin dirs to path
|
||||
export PATH="/home/fergus/.local/bin:$PATH"
|
||||
export PATH="/home/fergus/.local/bin:/home/fergus/.cargo/bin:$PATH"
|
||||
export PATH="/home/fergus/.cargo/bin:$PATH"
|
||||
export PATH="/home/fergus/go/bin/:$PATH"
|
||||
|
||||
# import any extra env that doesn't want to be kept in vsc
|
||||
|
||||
Reference in New Issue
Block a user