#!/bin/bash

killNC="$(swaync-client -cp)"

logout(){
    loginctl terminate-session "${XDG_SESSION_ID-}"
}

screenshot() {
    "$killNC"
    hyprctl dispatch -- exec hyprland-interactive-screenshot
}

wifi() {
    "$killNC"
    wofi-wifi-menu
}

bluetooth() {
    "$killNC"
    wofi-bluetooth
}

nwg-look() {
    "$killNC"
    nwg-look
}

files() {
    "$killNC"
    thunar
}

update() {
    "$killNC"
    kitty -e fpf -U
}

browser() {
    "$killNC"
    firefox
}

for opt in "$@"; do
	case $opt in
		-l|--logout)
			logout
			;;
   		-s|--screenshot)
   			screenshot
   			;
   		-w|--wifi)
   			wifi
   			;;
   		-b|--bluetooth)
   			bluetooth
   			;;
   		-n|--nwg-look)
   			nwg-look
   			;;
		-u|--update)
   			update
   			;;
		-ff|--firefox)
   			browser
   			;; 			
		-*)
			echo "Invalid Usage"
   			;;
	esac
done