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 Sat 26 Jul 2014, 15:35
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 [2 Posts]  
Author Message
puppylinuxuser

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 
stemsee


Joined: 27 Jun 2013
Posts: 268
Location: London

PostPosted: Wed 04 Jun 2014, 18:17    Post subject: desktop button
Subject description: 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 MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


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