same as $1 but enables you to put special bash syntax
${1#pattern}
the # after a variable name is "Parameter expansion: remove shortest matching prefix pattern" so
${1#/*}
just means "remove first letter in the variable if it is a forward slash". This to me doesn't make much sense because it would just remove the initial (root) slash, perhaps the author meant ${1%pattern} which is "remove shortest suffix pattern" (which is after), the "/*" expands to a forward slash and ANY string following it, so in the case of suffix it would remove everything after, in the case of shortest prefix it would only remove the slash
${1:-word}
means "Parameter expansion: Use default value", which just means that if the $1 variable is unset it will default to the word following it
edit: just so you know, this has nothing to do with what you're asking for, the answer is that you need to open a terminal to use terminal programs.
xfce4-power-manager has this feature, it wont start unless you start it from an X server, so if you need to have it running in a terminal (as in tty, not terminal emulator), it won't work though.
I don't know... Personally I think bash looks way cleaner and simpler for this kind of job, I replicated OP's script in bash for comparison
https://pastebin.com/4v1d8cY9
works but not even linux-lts "conflicts" with linux.
I can try breaking it down:
same as $1 but enables you to put special bash syntax
the # after a variable name is "Parameter expansion: remove shortest matching prefix pattern" so
just means "remove first letter in the variable if it is a forward slash". This to me doesn't make much sense because it would just remove the initial (root) slash, perhaps the author meant ${1%pattern} which is "remove shortest suffix pattern" (which is after), the "/*" expands to a forward slash and ANY string following it, so in the case of suffix it would remove everything after, in the case of shortest prefix it would only remove the slash
means "Parameter expansion: Use default value", which just means that if the $1 variable is unset it will default to the word following it
edit: just so you know, this has nothing to do with what you're asking for, the answer is that you need to open a terminal to use terminal programs.
xfce4-power-manager has this feature, it wont start unless you start it from an X server, so if you need to have it running in a terminal (as in tty, not terminal emulator), it won't work though.
I'm sorry, I don't know how to help you with most of this, but
That's normal, xset commands generally only last until reboot, so you would usually put them in some files that are automatically run at startup.