Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 01 Oct 2014, 16:57
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
how to automate terminal command at start up or icon click?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message

Joined: 09 Jan 2014
Posts: 16

PostPosted: Wed 04 Jun 2014, 17:13    Post_subject:  how to automate terminal command at start up or icon click?  

hi i'm sorry the searches I found didn't explain what i'm trying to do.

So I slack 5.7 on a laptop that i hook up to my flatscreen.

when I use this setup I normally turn off the laptop screen with the following terminal command

xrandr --output LVDS1 --off

couple questions:

1) how do i automate this to happen when it detects external screen OR even how do i make an icon that activates this command instead of having to type it in each time?

2) let's say I want to turn the laptop screen back on...I tried that command with an --on cue but that doesn't work. Is there a way to turn the laptop screen back on with a command?

thank you very much for the help!
Back to top
View user's profile Send_private_message 

Joined: 27 Jun 2013
Posts: 411
Location: London

PostPosted: Wed 04 Jun 2014, 18:17    Post_subject: desktop button
Sub_title: script or install zarfy!

make a script: use a text editor, first line should be #!/bin/sh
then then write your command on the next line. Make sure you press enter so that cursor goes too the next line. Then save you script /root/my-applications/bin/lds1-off.sh, next you wil need to make that script executable by right clicking on it and selecting 'properties', then select Exec Owner. Now you can type in a terminal lvds1-off.sh nd it will execute. You can then drag your script from /root/my-applications/bin to the desktop and a menu will open, choose make a symlink. Then right click on that symlink and choose set-icon. Drag an icon into the box and that's all there is to it. I think. There's probably an easier way to do it.

to automate it you'd need to make the script a daemon, ie run in the background monitoring the connection.

o automat at startup copy the scriipt into /root/startup/ and it should fire up each time X Graphical desktop restarts.

EDIT: install Zarfy
Back to top
View user's profile Send_private_message MSNM 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0438s ][ Queries: 11 (0.0082s) ][ GZIP on ]