chore: clean up deprecated files

This commit is contained in:
Swarsel 2024-12-10 18:01:42 +01:00
parent bac35ee49b
commit c99993330e
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
28 changed files with 0 additions and 1306 deletions

View file

@ -1,56 +0,0 @@
kitty=0
element=0
discord=0
spotifyplayer=0
while :; do
case ${1:-} in
-k|--kitty) kitty=1
;;
-e|--element) element=1
;;
-d|--discord) discord=1
;;
-s|--spotifyplayer) spotifyplayer=1
;;
*) break
esac
shift
done
if [[ $kitty -eq 1 ]]; then
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm || true)
CHECK=$(swaymsg -t get_tree | grep kittyterm || true)
if [ "$CHECK" == "" ]; then
exec kitty -T kittyterm & sleep 1
fi
if [ "$STR" == "" ]; then
exec swaymsg '[title="kittyterm"]' scratchpad show
else
exec swaymsg '[title="kittyterm"]' scratchpad show
fi
elif [[ $element -eq 1 ]]; then
STR=$(swaymsg -t get_tree | grep Element || true)
if [ "$STR" == "" ]; then
exec element-desktop
else
exec swaymsg '[app_id=Element]' kill
fi
elif [[ $discord -eq 1 ]]; then
STR=$(swaymsg -t get_tree | grep discord || true)
if [ "$STR" == "" ]; then
exec discord
else
exec swaymsg '[app_id=discord]' kill
fi
elif [[ $spotifyplayer -eq 1 ]]; then
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep spotifytui || true)
CHECK=$(swaymsg -t get_tree | grep spotifytui || true)
if [ "$CHECK" == "" ]; then
exec kitty -T spotifytui -o confirm_os_window_close=0 spotify_player & sleep 1
fi
if [ "$STR" == "" ]; then
exec swaymsg '[title="spotifytui"]' scratchpad show
else
exec swaymsg '[title="spotifytui"]' scratchpad show
fi
fi

View file

@ -1,27 +0,0 @@
#!/bin/bash
# CFG=$(git --git-dir=$HOME/.cfg/ --work-tree=$HOME diff --numstat | wc -l)
CFG=$(git --git-dir=$HOME/.dotfiles/.git --work-tree=$HOME/.dotfiles/ status -s | wc -l)
CSE=$(git --git-dir=$HOME/Documents/GitHub/CSE_TUWIEN/.git --work-tree=$HOME/Documents/GitHub/CSE_TUWIEN/ status -s | wc -l)
PASS=$(git --git-dir=$HOME/.local/share/password-store/.git --work-tree=$HOME/.local/share/password-store/ status -s | wc -l)
if [ $CFG != 0 ]; then
CFG_STR='CONFIG'
else
CFG_STR=''
fi
if [ $CSE != 0 ]; then
CSE_STR=' CSE'
else
CSE_STR=''
fi
if [ $PASS != 0 ]; then
PASS_STR=' PASS'
else
PASS_STR=''
fi
OUT="$CFG_STR""$CSE_STR""$PASS_STR"
echo "$OUT"

View file

@ -1,10 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | grep discord)
if [ "$STR" == "" ]; then
exec discord
#exec swaymsg '[class=discord]' move container to scratchpad; scratchpad show
else
exec swaymsg '[app_id=discord]' kill
fi
exit 0

View file

@ -1,10 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | grep Element)
if [ "$STR" == "" ]; then
exec element-desktop
#exec swaymsg '[app_id=SchildiChat]' move container to scratchpad; scratchpad show
else
exec swaymsg '[app_id=Element]' kill
fi
exit 0

View file

@ -1,12 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep gomuksterm)
CHECK=$(swaymsg -t get_tree | grep gomuksterm)
if [ "$CHECK" == "" ]; then
exec kitty -T gomuksterm -o confirm_os_window_close=0 gomuks & sleep 1
fi
if [ "$STR" == "" ]; then
exec swaymsg '[title="gomuksterm"]' scratchpad show
else
exec swaymsg '[title="gomuksterm"]' scratchpad show
fi
exit 0

View file

@ -1,13 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm)
CHECK=$(swaymsg -t get_tree | grep kittyterm)
if [ "$CHECK" == "" ]; then
exec kitty -T kittyterm & sleep 1
fi
if [ "$STR" == "" ]; then
exec swaymsg '[title="kittyterm"]' scratchpad show
else
exec swaymsg '[title="kittyterm"]' scratchpad show
fi
exit 0

View file

@ -1,10 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | grep SchildiChat)
if [ "$STR" == "" ]; then
exec schildichat-desktop
#exec swaymsg '[app_id=SchildiChat]' move container to scratchpad; scratchpad show
else
exec swaymsg '[app_id=SchildiChat]' kill
fi
exit 0

View file

@ -1,7 +0,0 @@
#!/bin/bash
# this is a crutch script that is to be used until spotify
# properly sets an app_id upon launch
swaymsg '[app_id="^$"]' scratchpad show
# exec spotify

View file

@ -1,10 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | grep spotify)
if [ "$STR" == "" ]; then
exec spotify & sleep 2
exec swaymsg '[class="Spotify"]' scratchpad show
else
exec swaymsg '[class="Spotify"]' scratchpad show
fi
exit 0

View file

@ -1,12 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep spotifytui)
CHECK=$(swaymsg -t get_tree | grep spotifytui)
if [ "$CHECK" == "" ]; then
exec kitty -T spotifytui -o confirm_os_window_close=0 spotify_player & sleep 1
fi
if [ "$STR" == "" ]; then
exec swaymsg '[title="spotifytui"]' scratchpad show
else
exec swaymsg '[title="spotifytui"]' scratchpad show
fi
exit 0

View file

@ -1,13 +0,0 @@
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm || true )
if [ "$STR" == "" ]; then
VAR="1"
swaymsg '[title="kittyterm"]' scratchpad show
else
VAR="0"
fi
emacsclient -c -a "" "$@" # open emacs in a new frame, start new daemon if it is dead and open arg
if [ "$VAR" == "1" ]
then
swaymsg '[title="kittyterm"]' scratchpad show
fi
exit 0

View file

@ -1,15 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm)
if [ "$STR" == "" ]; then
VAR="1"
swaymsg '[title="kittyterm"]' scratchpad show
else
VAR="0"
fi
emacsclient -c -a "" "$@" # open emacs in a new frame, start new daemon if it is dead and open arg
if [ "$VAR" == "1" ]
then
swaymsg '[title="kittyterm"]' scratchpad show
fi
exit 0

View file

@ -1,16 +0,0 @@
#!/bin/bash
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm)
if [ "$STR" == "" ]; then
VAR="1"
swaymsg '[title="kittyterm"]' scratchpad show
emacsclient -c -a "" "$@"
else
VAR="0"
emacsclient -n -c -a "" "$@"
fi
if [ "$VAR" == "1" ]
then
swaymsg '[title="kittyterm"]' scratchpad show
fi
exit 0

View file

@ -1,24 +0,0 @@
shopt -s nullglob globstar
typeit=0
if [[ $# -ge 1 && $1 == "--type" ]]; then
typeit=1
shift
fi
export PASSWORD_STORE_DIR=~/.local/share/password-store
prefix=${PASSWORD_STORE_DIR-~/.local/share/password-store}
password_files=( "$prefix"/otp/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
password=$(printf '%s\n' "${password_files[@]}" | fuzzel --dmenu "$@")
[[ -n $password ]] || exit
if [[ $typeit -eq 0 ]]; then
pass otp -c "$password" &>/tmp/pass-fuzzel
else
pass otp "$password" | { IFS= read -r pass; printf %s "$pass"; } | wtype -
fi
notify-send -u critical -a pass -t 1000 "Copied/Typed OTPassword"

View file

@ -1,21 +0,0 @@
# The ID doesn't really matter, put whatever you want.
id: doublepuppet
# The URL is intentionally left empty (null), as the homeserver shouldn't
# push events anywhere for this extra appservice. If you use a
# non-spec-compliant server, you may need to put some fake URL here.
url:
# Generate random strings for these three fields. Only the as_token really
# matters, hs_token is never used because there's no url, and the default
# user (sender_localpart) is never used either.
as_token: doublepuppet
hs_token: notused
sender_localpart: notused
# Bridges don't like ratelimiting. This should only apply when using the
# as_token, normal user tokens will still be ratelimited.
rate_limited: false
namespaces:
users:
# Replace your\.domain with your server name (escape dots for regex)
- regex: '@.*:matrix2\.swarsel\.win'
# This must be false so the appservice doesn't take over all users completely.
exclusive: false

View file

@ -1,40 +0,0 @@
#! /usr/bin/env bash
export INTERFACE="tun0"
export VPNUSER="vpn"
export LOCALIP="192.168.1.2"
export NETIF="enp3s0"
# flushes all the iptables rules, if you have other rules to use then add them into the script
iptables -F -t nat
iptables -F -t mangle
iptables -F -t filter
# mark packets from $VPNUSER
iptables -t mangle -A OUTPUT -j CONNMARK --restore-mark
iptables -t mangle -A OUTPUT ! --dest $LOCALIP -m owner --uid-owner $VPNUSER -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT --dest $LOCALIP -p udp --dport 53 -m owner --uid-owner $VPNUSER -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT --dest $LOCALIP -p tcp --dport 53 -m owner --uid-owner $VPNUSER -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT ! --src $LOCALIP -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT -j CONNMARK --save-mark
# allow responses
iptables -A INPUT -i $INTERFACE -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# block everything incoming on $INTERFACE to prevent accidental exposing of ports
iptables -A INPUT -i $INTERFACE -j REJECT
# let $VPNUSER access lo and $INTERFACE
iptables -A OUTPUT -o lo -m owner --uid-owner $VPNUSER -j ACCEPT
iptables -A OUTPUT -o $INTERFACE -m owner --uid-owner $VPNUSER -j ACCEPT
# all packets on $INTERFACE needs to be masqueraded
iptables -t nat -A POSTROUTING -o $INTERFACE -j MASQUERADE
iptables -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# reject connections from predator IP going over $NETIF
iptables -A OUTPUT ! --src $LOCALIP -o $NETIF -j REJECT
# Start routing script
/etc/openvpn/routing.sh
exit 0

View file

@ -1,47 +0,0 @@
#! /usr/bin/env bash
export INTERFACE="tun0"
export VPNUSER="vpn"
export LOCALIP="192.168.1.2"
export NETIF="enp3s0"
# flushes all the iptables rules, if you have other rules to use then add them into the script
iptables -F -t nat
iptables -F -t mangle
iptables -F -t filter
# mark packets from $VPNUSER
iptables -t mangle -A OUTPUT -j CONNMARK --restore-mark
iptables -t mangle -A OUTPUT ! --dest $LOCALIP -m owner --uid-owner $VPNUSER -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT --dest $LOCALIP -p udp --dport 53 -m owner --uid-owner $VPNUSER -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT --dest $LOCALIP -p tcp --dport 53 -m owner --uid-owner $VPNUSER -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT ! --src $LOCALIP -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT -j CONNMARK --save-mark
# allow responses
iptables -A INPUT -i $INTERFACE -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# block everything incoming on $INTERFACE to prevent accidental exposing of ports
iptables -A INPUT -i $INTERFACE -j REJECT
# let $VPNUSER access lo and $INTERFACE
iptables -A OUTPUT -o lo -m owner --uid-owner $VPNUSER -j ACCEPT
iptables -A OUTPUT -o $INTERFACE -m owner --uid-owner $VPNUSER -j ACCEPT
# all packets on $INTERFACE needs to be masqueraded
iptables -t nat -A POSTROUTING -o $INTERFACE -j MASQUERADE
iptables -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# reject connections from predator IP going over $NETIF
iptables -A OUTPUT ! --src $LOCALIP -o $NETIF -j REJECT
VPNIF="tun0"
VPNUSER="vpn"
GATEWAYIP=$(ifconfig $VPNIF | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | egrep -v '255|(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})' | tail -n1)
if [[ `ip rule list | grep -c 0x1` == 0 ]]; then
ip rule add from all fwmark 0x1 lookup $VPNUSER
fi
ip route replace default via $GATEWAYIP table $VPNUSER
ip route append default via 127.0.0.1 dev lo table $VPNUSER
ip route flush cache
exit 0

View file

@ -1,14 +0,0 @@
#! /usr/bin/env bash
VPNIF="tun0"
VPNUSER="vpn"
GATEWAYIP=$(ifconfig $VPNIF | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | egrep -v '255|(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})' | tail -n1)
if [[ `ip rule list | grep -c 0x1` == 0 ]]; then
ip rule add from all fwmark 0x1 lookup $VPNUSER
fi
ip route replace default via $GATEWAYIP table $VPNUSER
ip route append default via 127.0.0.1 dev lo table $VPNUSER
ip route flush cache
/etc/openvpn/update-resolv-conf
exit 0

View file

@ -1,14 +0,0 @@
#! /usr/bin/env bash
VPNIF="tun0"
VPNUSER="vpn"
GATEWAYIP=$(ifconfig $VPNIF | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | egrep -v '255|(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})' | tail -n1)
if [[ `ip rule list | grep -c 0x1` == 0 ]]; then
ip rule add from all fwmark 0x1 lookup $VPNUSER
fi
ip route replace default via $GATEWAYIP table $VPNUSER
ip route append default via 127.0.0.1 dev lo table $VPNUSER
ip route flush cache
bash /etc/openvpn/update-resolv-conf
exit 0

View file

@ -1,45 +0,0 @@
#! /usr/bin/env bash
foreign_option_1='dhcp-option DNS 209.222.18.222'
foreign_option_2='dhcp-option DNS 209.222.18.218'
foreign_option_3='dhcp-option DNS 8.8.8.8'
[ -x /sbin/resolvconf ] || exit 0
[ "$script_type" ] || exit 0
[ "$dev" ] || exit 0
split_into_parts()
{
part1="$1"
part2="$2"
part3="$3"
}
case "$script_type" in
up)
NMSRVRS=""
SRCHS=""
for optionvarname in ${!foreign_option_*} ; do
option="${!optionvarname}"
echo "$option"
split_into_parts $option
if [ "$part1" = "dhcp-option" ] ; then
if [ "$part2" = "DNS" ] ; then
NMSRVRS="${NMSRVRS:+$NMSRVRS }$part3"
elif [ "$part2" = "DOMAIN" ] ; then
SRCHS="${SRCHS:+$SRCHS }$part3"
fi
fi
done
R=""
[ "$SRCHS" ] && R="search $SRCHS
"
for NS in $NMSRVRS ; do
R="${R}nameserver $NS
"
done
echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn"
;;
down)
/sbin/resolvconf -d "${dev}.openvpn"
;;
esac

View file

@ -1,45 +0,0 @@
#! /usr/bin/env bash
foreign_option_1='dhcp-option DNS 209.222.18.222'
foreign_option_2='dhcp-option DNS 209.222.18.218'
foreign_option_3='dhcp-option DNS 8.8.8.8'
[ -x /sbin/resolvconf ] || exit 0
[ "$script_type" ] || exit 0
[ "$dev" ] || exit 0
split_into_parts()
{
part1="$1"
part2="$2"
part3="$3"
}
case "$script_type" in
up)
NMSRVRS=""
SRCHS=""
for optionvarname in ${!foreign_option_*} ; do
option="${!optionvarname}"
echo "$option"
split_into_parts $option
if [ "$part1" = "dhcp-option" ] ; then
if [ "$part2" = "DNS" ] ; then
NMSRVRS="${NMSRVRS:+$NMSRVRS }$part3"
elif [ "$part2" = "DOMAIN" ] ; then
SRCHS="${SRCHS:+$SRCHS }$part3"
fi
fi
done
R=""
[ "$SRCHS" ] && R="search $SRCHS
"
for NS in $NMSRVRS ; do
R="${R}nameserver $NS
"
done
echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn"
;;
down)
/sbin/resolvconf -d "${dev}.openvpn"
;;
esac

View file

@ -1,11 +0,0 @@
#!/bin/bash
swaymsg opacity plus 0.01
if [ $? -eq 0 ]; then
# opacity was not 1, we toggle off
swaymsg opacity 1
else
# opacity was 1, we toggle on
swaymsg opacity 0.95
fi