Sample Header Ad - 728x90

Is it possible to use a command with an argument to trigger a bash alias?

0 votes
2 answers
144 views
I have a program that tries to trigger a screenlock using the following commands:
xdg-screensaver lock
    xscreensaver -lock
    cinnamon-screensaver-command --lock
The problem is that I'm using Arch and I'm not using any of the screenlock programs listed above. I need one of the above commands to trigger my swaylock script. Is it possible to use a command with an argument to trigger a bash alias? For example:
xscreensaver -lock="cd ~/.config/hypr/scripts && ./lockscreen"
There are a lot of posts about using functions to pass arguments, but I haven't been able to find any info on how to use an argument in the command that triggers the alias. I'm guessing this isn't possible, but maybe someone has some alternative suggestions to get the same effect.
Asked by guttermonk (113 rep)
May 5, 2024, 04:18 PM
Last activity: May 6, 2024, 04:43 PM