Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a script to start the startup programs like other DE #1749

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Configs/.config/hypr/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exec-once = wl-paste --type text --watch cliphist store # clipboard store text d
exec-once = wl-paste --type image --watch cliphist store # clipboard store image data
exec-once = $scrPath/swwwallpaper.sh # start wallpaper daemon
exec-once = $scrPath/batterynotify.sh # battery notification

exec-once = $scrPath/autostart.sh # run the startups
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ALEX5402,

This is good, but as I read through the discussion, both parties have good thoughts about this.

You can move this line to ./userprefs.t2 (

) so we can make this optional.

I encourage you to make this optional as honestly this will become a burden for maintaining the repo, as by default we don't know what packages/services are run on startup.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default it gonna run those packages only which you enabled on startup from inside the app

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run those packages only which you enabled on startup from inside the app

Can you explain more about the script? What I understand of the script is it will extract the "Exec=" part, which is the command to launch an app, nothing fancy.

What you are saying is the script can pinpoint which users enabled the startup "from inside the app" ?
Or you are saying that $AUTOSTART_DIR is respected by most apps, and enabling it to run at the startup "from inside the app". Which I assumed that the application adds the .desktop file entry to the $AUTOSTART_DIR?

Copy link
Author

@ALEX5402 ALEX5402 Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

then should i change that with $AUTOSTART_DIR ?


# █▀▀ █▄░█ █░█
# ██▄ █░▀█ ▀▄▀
Expand Down
12 changes: 12 additions & 0 deletions Configs/.local/share/bin/autostart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# Directory containing the .desktop files
AUTOSTART_DIR="$HOME/.config/autostart/"
for desktop_file in "$AUTOSTART_DIR"*.desktop; do
if [ -f "$desktop_file" ]; then
exec_command=$(grep -E '^Exec=' "$desktop_file" | sed 's/^Exec=//')
if [ -n "$exec_command" ]; then
$exec_command &
fi
fi
done