Post a New Reply
Reply to thread: How things are done, using bash to run simple command(s)?
Post Subject:
Post Icon:
Your Message:
Smile Wink Cool Big Grin
Tongue Rolleyes Shy Sad
At Angel Angry Blush
Confused Dodgy Exclamation Heart
Huh Idea Sleepy Undecided
[get more]
Post Options:
Thread Subscription:
Specify the type of notification and thread subscription you'd like to have to this thread. (Registered users only)

Human Verification
Please tick the checkbox that you see below. This process is used to prevent automated spam bots.

Thread Review (Newest First)
Posted by ross - 2023-09-04, 09:03 AM
Good morning fine people of the Linux world.

Please, forgive me if I have posted this in the wrong section.  Was not sure where to post.
This is just query. After a bit of searching about, I found a solution to something I was looking to achieve, which was to switch my monitor off by clicking on a shortcut/icon,  so that at 3am when Im done watching whatever and Im half asleep, I dont have to reach over and switch the monitor off as one would usually do. 

My solution, a fairly simple one.  A bash script consisting of the following two lines.

sleep 1 && xset dpms force off

Well my primitive understanding is that bash is a simple programming language, which seems rather overkill simply to run a terminal command from a shortcut.  So my question is just about the way in which things are done.......have I reached the typical solution for such a desired result, or are there easier, more basic methods, to run terminal commands on demand/from shortcut, than to use bash

In Win, the typical solution would be a batch file, that is simply a list of commands to be ran.......and whilst my bash script is essentially the same thing, you are STILL having to elicit the use of programming language to do so.  I just cant imagine theres not a lower level way of getting such a simple job done?

Hope you dont mind me asking such a dumb question.  Thank you