Moon-0xff / gnome-mpris-label

A music related GNOME extension.
GNU General Public License v3.0
50 stars 10 forks source link

failsafe for install.sh #9

Closed Batwam closed 1 year ago

Batwam commented 1 year ago

fail-safe against being executed outside the repo directory...

Moon-0xff commented 1 year ago

I believe you can "reload" gnome-shell on wayland by quitting the session $ gnome-session-quit edit: sorry, you already mentioned this (but not the command, might be helpful?)

Batwam commented 1 year ago

yeah, $ gnome-session-quit logs you out (technically asks you if you want to log out). I wouldn't include the command from the code as I think that most people probably would probably want to close whatever they have open first.but I could make the text more personalised based on $XDG_SESSION_TYPE

Moon-0xff commented 1 year ago

Well it looks good to me. Let me know if you're done.

Batwam commented 1 year ago

Please run it on your end just in case but it's good to go as far as I'm concerned.

Moon-0xff commented 1 year ago

I've tested it. The only slight issue i have so far is: If you execute it from outside the directory. It cd's you to the repository. I have pushed a "fix" for this. Let me know what you think.

Moon-0xff commented 1 year ago

Don't bother to write a special case, if the script is called from inside. cd "$(dirname "$0")" updates $OLDPWD regardless.

Moon-0xff commented 1 year ago

I've run it from nautilus (Right click -> run as program). The terminal window closes itself. $SHELL also opens a shell inside the current one. The instructions require a terminal already, so we shouldn't worry about this.

Batwam commented 1 year ago

That's strange as it worked for me. Yeah, I don't normally run scripts from the file browser either but I just thought it might be a bit more user friendly. It's fine with me without $SHELL

Moon-0xff commented 1 year ago

Great. I'm going to merge this now. Thanks again @Batwam