1

I recently moved to Elementary OS Luna. I especially use the Synapse Indicator launcher, because I like to work with my keyboard for everything.

In Synapse and in the Synapse Indicator (and I believe, generally, in the Gnome dekstop and I'll dare saying in all Linux DEs) there are "actions". Among actions there is Shut Down, Restart, Lock Screen etc. which can be run with Synapse and probably too from the command line.

I would like to create an action for Turn Off Screen (which is different from Lock Screen).

How can I create this action and be able to launch it from Synapse?

daveloyall
  • 228
  • 1
  • 12
neydroydrec
  • 3,777
  • 8
  • 32
  • 42
  • `xset dpms off` can turn off the screen. But how to achieve it with Synapse is out of my scope – SHW Oct 03 '13 at 08:32
  • It's a start. I suspect there must be somewhere some "action" launcher? Much like there are application launchers? – neydroydrec Oct 03 '13 at 08:34
  • Never used Luna, so cant say about that. Not sure, but have a look in `/etc/xdg/menus` – SHW Oct 03 '13 at 08:43
  • I did a little reading about Luna and my guess is you can't do it via synapse, but there seem to be other options for mounting a launcher on the desktop. What about a panel or the dock? – goldilocks Oct 03 '13 at 09:59
  • Ideally I want to do that with my keyboard. – neydroydrec Oct 03 '13 at 10:43
  • It seems the command line to turn off screen is `xset dpms force off`. See [this link.](http://askubuntu.com/questions/7295/how-to-turn-off-the-display-via-the-command-line) – neydroydrec Oct 03 '13 at 11:18
  • For now I made a small executable bash script using the command line above, called screen-off which I moved to my /usr/bin. It shows now as an application rather as an action. I would still like to know where those "actions" are defined and fix this properly. – neydroydrec Oct 03 '13 at 13:17

2 Answers2

1

Maybe there's a detail I'm missing here, but you can create a .desktop file for whatever shell script you like and Synapse will launch it for you no problem.

HansBKK
  • 111
  • 1
0

create a bash script file (.sh) then put this inside:

#!/bin/bash
sleep 0; xset dpms force off

sleep 0 determine how fast it will turn off

put the file in home folder then set the executable properties (chmod +755)

i think any launcher app will recognize it as an action/runable.

to lock the screen while it turned off, you can add command to the script depend on your DE.