summaryrefslogtreecommitdiff
path: root/skel/.config/qtile/scripts/autostart.sh
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-09-26 12:37:59 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-09-26 12:37:59 +0100
commitc60488a70caca3df618c1001f60fb863fd1c512c (patch)
treeb0fb5f47011242834a9469f1bdd391803ecebe7c /skel/.config/qtile/scripts/autostart.sh
parentdec7496290c9473c49b88caecf564edc6678a236 (diff)
fine tune qtile skel, more work needed...probably
Diffstat (limited to 'skel/.config/qtile/scripts/autostart.sh')
-rwxr-xr-xskel/.config/qtile/scripts/autostart.sh76
1 files changed, 65 insertions, 11 deletions
diff --git a/skel/.config/qtile/scripts/autostart.sh b/skel/.config/qtile/scripts/autostart.sh
index ba259ee..d522008 100755
--- a/skel/.config/qtile/scripts/autostart.sh
+++ b/skel/.config/qtile/scripts/autostart.sh
@@ -1,17 +1,71 @@
#!/bin/bash
-function run {
- if ! pgrep $1 ;
- then
- $@&
- fi
+set_wallpaper() {
+ if [[ "$(loginctl show-session "$XDG_SESSION_ID" -p Type --value)" != wayland ]]; then
+ if [[ -x /usr/bin/feh ]] ; then # x11
+ /usr/bin/feh --bg-scale /usr/share/backgrounds/redcore-community/0.png & disown
+ fi
+ else
+ if [[ -x /usr/bin/swaybg ]] ; then # wayland
+ /usr/bin/swaybg --image /usr/share/backgrounds/redcore-community/0.png & disown
+ fi
+ fi
}
+start_polkit_agent() {
+ if [[ -x /usr/libexec/polkit-kde-authentication-agent-1 ]] ; then
+ pkill -f /usr/libexec/polkit-kde-authentication-agent-1
+ /usr/libexec/polkit-kde-authentication-agent-1 & disown
+ elif [[ -x /usr/libexec/polkit-gnome-authentication-agent-1 ]] ; then
+ pkill -f /usr/libexec/polkit-gnome-authentication-agent-1
+ /usr/libexec/polkit-gnome-authentication-agent-1 & disown
+ fi
+}
+
+start_notification_daemon() {
+ if [[ -x /usr/bin/dunst ]] ; then
+ pkill -f dunst
+ /usr/bin/dunst & disown
+ fi
+}
+
+start_compositor() {
+ if [[ "$(loginctl show-session "$XDG_SESSION_ID" -p Type --value)" != wayland ]]; then
+ if [[ -x /usr/bin/picom ]] ; then # x11
+ pkill -f picom
+ /usr/bin/picom --vsync & disown
+ fi
+ fi
+}
+
+start_nm-applet() {
+ if [[ -x /usr/bin/nm-applet ]] ; then
+ pkill -f nm-applet
+ /usr/bin/nm-applet & disown
+ fi
+}
+
+start_pipewire() {
+ if [[ -x /usr/bin/gentoo-pipewire-launcher ]] ; then
+ /usr/bin/gentoo-pipewire-launcher restart
+ fi
+}
-dunst &
+start_xdg-desktop-portal() {
+ if [[ -x /usr/libexec/xdg-desktop-portal-wlr ]] ; then
+ pkill -f xdg-desktop-portal-wlr
+ /usr/libexec/xdg-desktop-portal-wlr & disown
+ fi
+}
+
+main() {
+ set_wallpaper
+ start_polkit_agent
+ start_notification_daemon
+ start_compositor
+ start_nm-applet
+ start_pipewire
+ start_xdg-desktop-portal
+}
-#starting utility applications at boot time
-picom --vsync &
-/usr/libexec/polkit-gnome-autentication-agent-1 &
-#/usr/lib/xfce4/notifyd/xfce4-notifyd &
-feh --bg-scale ~/.config/qtile/assets/redcore.png &
+main