#!/bin/bash

# Variables
config=$HOME/.config/hypr
scripts=$config/scripts

# Plugins
pypr &

# Notification Daemon
swaync &

# Wallpaper Backend
swww init
"$scripts"/wallpaper random &

# Bar
waybar &

# OSD Window
swayosd &

# Automounter for removable media
udiskie &

# Notify about devices connecting and disconnecting
devify &

# Idle daemon to screen lock
swayidle &

# Clipboard
wl-clip-persist --clipboard regular &
wl-paste --watch cliphist store &

# Gnome polkit authentication
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &

# umm is this unnecessary?
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &

# Launch tui monitors for cpu and gpu
hyprctl dispatch exec "[workspace 24 silent] kitty btop" &
hyprctl dispatch exec "[workspace 24 silent] kitty nvtop" &

# Activity Watch
# aw-server-rust &
# aw-watcher-window-wayland &
# aw-watcher-afk &

#Launch autostart apps
dex -a -s ~/.config/autostart/ & # Easyeffects, Spotify, Discord and Thunderbird

# Screen sharing and portals
"$scripts"/launch_portals &
xwaylandvideobridge &
