diff options
Diffstat (limited to 'gotrc-examples')
| -rw-r--r-- | gotrc-examples/commands | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gotrc-examples/commands b/gotrc-examples/commands new file mode 100644 index 0000000..f4c6677 --- /dev/null +++ b/gotrc-examples/commands @@ -0,0 +1,36 @@ +# -*- shell-script -*- + +# The module allows you to launch a few programs without even logging in + + +login_function_commands=$login_function +login_function=_login_commands + +function _login_commands +{ + if [ "${user::1}" = "+" ]; then + if [ "${user}" = "+shutdown" ]; then + shutdown + elif [ "${user}" = "+reboot" ]; then + reboot + elif [ "${user}" = "+backlight" ]; then + if [ "${LANG/UTF-8/}" = "${LANG}" ]; then + export LANG="en_GB.UTF-8" + fi + adjbacklight + else + echo <<EOF +Command is not recognised. +Recognised commands include: + ++shutdown Shutdown the computer ++reboot Reboot the computer ++backlight Adjust the backlight +EOF + read + fi + else + $login_function_commands + fi +} + |
