From c60488a70caca3df618c1001f60fb863fd1c512c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 26 Sep 2024 12:37:59 +0100 Subject: fine tune qtile skel, more work needed...probably --- skel/.config/qtile/scripts/autostart.sh | 76 ++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 11 deletions(-) (limited to 'skel/.config/qtile/scripts/autostart.sh') 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 -- cgit v1.2.3