Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How things are done, using bash to run simple command(s)?
#1
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.

#!/bin/bash
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
Ross
Reply


[-]
Quick Reply
Message
Type your reply to this message here.

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

Forum Jump:


Users browsing this thread: 2 Guest(s)