"Programs" (as in "not scripts") usually don't parse users' RC files. So if your "program" is not a script that can be easily modifiable, most likely, it will inspect PATH
to find the path to those executables, or it will check for the presence of those executables in specific paths.
If your program reads PATH
to find the path to those executables, one way to go about this would be:
- Creating a symlink to the script named as one of the executables, placing it into the same directory as the script's (or for that matter simply renaming the script as one of the executables)
- Modifying the way the program is invoked, to provide it with a custom environment with a
PATH
that includes /home/<your_username>/config/hypr/scripts
- No matter the options passed to the script, your script will just drop them and do whatever it wants.
As to how go about point #2 specifically: that depends on how your program is currently invoked. I can make this more specific depending on your case, but the general way to do this would be, instead of running program
, running
env PATH="${PATH}:/home/<your_username>/config/hypr/scripts/" program
But this may or may not be applicable to your case, depending on how your program is invoked, and, again, depending on whether your program reads PATH
to find the path to those executables.
This other way is rather a hack, and should be used only if the solution above isn't applicable, or if your program doesn't read PATH
to find the path to those executables. See the caveat below.
Another way go about this, since you shouldn't have any of those executables installed on your system, would be:
- Picking one of the unused executables, let's say
xdg-screensaver
;
- Moving the script to the executable's path. On my system that would be
/usr/bin/
;
- Taking care of owner and permissions, mirroring the default permissions of the executables. On my system, those would be
root:root
/ 0755
;
The obvious caveat is: this is ok as long as some other program doesn't try to rely on xdg-screensaver
for something. Essentially, this may break other stuff, cause suddenly an already installed program (or a program you'll install in the future for that matter) might find an xdg-screensaver
executable available for use and run it. Since I guess your script isn't a full drop-in replacement for xdg-screensaver
, this may break the program trying to use it.
So, again, this is rather a hack, and should be used with care.
function xscreensaver() { cd ~/.config/hypr/scripts && ./lockscreen; }
alias xscreensaver='cd ~/.config/hypr/scripts && ./lockscreen; :'