[partly SOLVED] Controlling the uswsusp s2both feature with acpid
Hi,
I am currently using uswsusp on my laptop to suspend to both disk and RAM, which works flawlessly by using the
$ s2both
command.
Now, I would like to use acpid to execute that command and also lock my screen using my display manager which is xdm, whenever I close the lid of my laptop and resume once I open it again.
passing
acpi_listen
and then closing and opening the lid gives me:
button/lid LID close
button/lid LID open
Next I created the following file: /etc/acpi/events/lid_close
It contains:
event=button/lid LID close.*
action=/etc/acpi/actions/lid_close.sh "%e"
The problem is, that I have no idea what the corresponding lid_close.sh script would need to look like in order to do what I want it to do.
I'm aware that I would need an additional event file for the opening of the lid and a corresponding script, but for now I would be happy with automating the suspension/lock process and resuming manually using the power button.
Hopefully you can help me with this.
Thanks in advance.
Last edited by Troglodyte (2012-04-05 14:39:02)
Ok.
my /etc/acpi/events/anything file now looks like this:
# Pass all events to our one handler script
event=button/lid LID close.*
action=/etc/acpi/handler.sh %e
My /etc/acpi/handler.sh looks like this
button/lid)
case "$3" in
close)
#echo "LID closed!">/dev/tty5
s2both
open)
#echo "LID opened!">/dev/tty5
esac
and it works!
Didn't think it would be that easy. Thanks for pointing me in the right direction nierro!
Now I just need to figure out how to return to xdm instead of my WM upon resume.
Last edited by Troglodyte (2012-04-05 13:01:33)
Similar Messages
-
I have a late 2011 model MacBook Pro running Mountain Lion. I love the AirPlay mirroring feature with Apple TV...BUT, how do I mirror with TVs that don't have Apple TV? I used to run a cable from my mini display port to the HDMI input of a TV. This feature seems to be lost in the Mountain Lion upgrade. Did Apple feel that once Mountain Lion came out that EVERYONE would have Apple TV? There are no settings in System Preferences/Display like there used to be...only for AirPlay Mirroring.
Running a cable to the HDMI port is still supported. (and still works on mine).
If the Arrangement tab in System Preferences > Displays isn't present then it doesn't recognize the physical connection. Double check all cables. If that doesn't work try a PRAM reset:
http://support.apple.com/kb/ht1379 -
Controlling the TIME or DATES with GP in a workflow
Hi,
It is possible to control the time or dates with GP in a workflow? If is able, with which CO this opcion is implemented, and that way?
Many thanks
Regads
DavidHi Mahesh,
Thanks for the answer, but I have a doubt on "due date" functionality, and is ¿that CO I can utilize in the notificacion?
Thanks.
Regards
David -
What is the HP part number for the power adapter shipped with the dv7-6b32us​?
I would like to know what is the exact HP part number for the 90w power supply that is shipped in the box with the DV7-6B32US?
Hi,
Here is another list:
http://www.amazon.com/s?ie=UTF8&rh=i%3Aaps%2Ck%3AHP%20Pavilion%20dv7%206b32us&page=1
I would buy the 120W charger.
Regards.
BH
**Click the KUDOS thumb up on the left to say 'Thanks'**
Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem. -
Control F Windows- similar feature with Mac?
Hello,
When I wanted to find any word on a Word doc or browser, with Windows I would use Control F. Is there a similar feature with the Mac?
Loving the new Mac Book Pro!
Thank you!You will find that many Windows keyboard shortcuts are copies of the older Mac ones, but substituted the control for our command and Alt for our Option which is now sometimes referred to as Alt as well.
There are exceptions however, usually the Mac ones are more mnemonic such as cmd Q for Quit rather than the Alt F4 of Windows.
Also you will see a recent summary of the easy to remember Mac keyboards for accented non-English characters.
There are summaries of some but not all keyboard shortcuts either under the Help menu or in Help itself, or on Apple's website in Support.
Peter -
Help with Controlling the HP E1411B multimeter with LabView
Hi -
I'm using LabView 7.1, and trying to control the HP E1411B multimeter in a Textronix VX1410 frame, using a VXI-MXI-2 interface. I've read that this is a register based device, which means what? I can't control it using the VISA method in LabView? I've been successful in this with other devices, so I'm guessing it can't be done because it doesn't work. I also downloaded both the drivers for this device from the driver database, and neither work. I can't seem to figure out to nake them work either. Can anyone help? I just want to use the MM to make simple measurements and display them in LabView. If I wanted to create my own driver, what would be the best way to communicate with it? Thanks.
CharlieSir,
I want to make automatic test setup for testing accelerometer. My resources are Test station PC with windows 2000, Agilent E1401B High power mainframe with slot 0 controller, Slot 0 controller is NI VXI-MXI-2 controller, shaker etc. MXI-2 bus begins at PCI at the PC and goes to VXI backplane. Agilent E1401B cage have Agilent E1411B 51/2 Multimeter (in slot 3), Etec Test Head Support Module (slot 2), Etec Digital stimulus response module, ETEC test head I/O panel etc. we have old version labview-2009. using labview i want to control my test whole setup.
Procedure for test setup is that i need to give power supply to shaker. Also i have to give input signal of 1kHz to shaker for vibration. Accelerometer will be mounted on shaker. Accelerometer output voltage has to be measured with agilent DMM E1411B in VXI cage.
I have installed NI-VISA n NI-VXI driver and i was trying to program it using visa VIs in LABVIEW, but couldn't succeed.
First, i am trying to make a simple program which can read resistance and voltage from HP E1411B DMM. There is difficulties in using VISA Out and VISA In VI. to measure DC voltage value from DMM, how should i give command to DMM using VISA out, because input to VISA out is numerial value so how can i give command to DMM. VISA In has only input offset and address space, so how will i know that which offset setting will show voltage value. -
How to control the role in portal with SRM7.0
HI ,My expert :
I work in SRM 7.0 with EP.
I want to control the ROle about the business partner manage .In the portal ,some user can edit the business partner data ,however the other can only display the data .In this case ,I do not how to control ? dispaly the role in SRM or portal ?
BestRegards!
Alex!hello
authorizations are made on SRM; create roles z in SRM and subsequently assigned to a group role-z also. But the authorization in SRM.
Best regards.
José Luis -
Dear all,
I have make some image in Photoshop, and sliced it to html
page, but open it in dreamweaver it show me the table layout that
Photoshop Sliced maked ..
I am wonder, now many web site are integration with CSS, and
I had saw some total using CSS with div maked Web Site, how to
control the sliced image after that Photoshop sliced it?
Any simple example for newbie reference?
And sorry of my poor English.It seems you have exported the html from photoshop into
Dreamweaver.
This is not the best way to build a page. You should slice up
your images
and then export the images only into a folder. You then build
the page
using these exported images in your table or css layout. You
can place the
images directly into table cells or divs or use them as
background images
via css.
Good CSS tutorials can be found here:
http://www.adobe.com/devnet/dreamweaver/css.html
Nadia
Adobe� Community Expert : Dreamweaver
http://www.DreamweaverResources.com
- CSS Templates|Tutorials
http://www.csstemplates.com.au
http://www.adobe.com/devnet/dreamweaver/css.html
CSS Tutorials for Dreamweaver
> Dear all,
>
> I have make some image in Photoshop, and sliced it to
html page, but open
> it
> in dreamweaver it show me the table layout that
Photoshop Sliced maked ..
>
> I am wonder, now many web site are integration with CSS,
and I had saw
> some
> total using CSS with div maked Web Site, how to control
the sliced image
> after
> that Photoshop sliced it?
>
> Any simple example for newbie reference?
>
> And sorry of my poor English.
> -
Af:ConvertDateTime how to control the year to start with 19xx or 20xx
Hi,
I am facing an issue. I have a af:inputDate component with af:convertDateTime with pattern MM/dd/yyyy and secondary pattern= MMddyyyy.
The issue is when the date is entered as 101147 the date gets converted to 10/11/2047 but the user wants it to be converted to 10/11/1947
Th requirement is if the two digits entered for year(yy) is less than the last two digits current year(2011) the year should be 20yy else it should be 19yy
example: if entered date is 052104 it should get converted to 05/21/2004
if entered date is 062198 it should get converted to06/21/1998
if the entered date is 07132009 it should be 07/13/2009 (no conversion here)
if the entered date is 07131986 it should be 07/13/1986 (no conversion here)
Kindly replyThis one is a tricky problem - a side-effect of JSF doing a lot of things automatically is that sometimes it does too much.
I don't have a great solution, but here's a couple of ideas:
(1) Try using multiple <h:form>s on your page (not nested one inside the other, but separate). Data will only get updated in the form that contains the button that got pressed.
(2) Use an intermediate model layer, and discard updates as appropriate.
Neither of these are beautiful solutions - the second is way ugly - but they might help. Long-range, I'd love to see something like "subforms" supported in JSF that can provide finer grained control over what gets processed (validations, model pushes, etc.) and what doesn't without resorting to the blunt hammer of multiple HTML forms.
I'm a little confused about "the model is updated with the value of the components whenever the form is submitted, and regardless of whether the value of the components has changed or not.", because JSF is checking the old value and using ".equals()" to see if its changed. Note, however, that it's not caching the old value across the request, but simply going back to the model on the subsequent request, which may (or may not) explain the behavior you're seeing.
-- Adam Winer (EG member) -
Is anyone having trouble with the "TTY" phone answering feature with the new ios 7 when your phone is in "sleep/lock" mode"? I only have an issue when it is in the "sleep/lock" mode
I am sorry..."TTY" in "Phone Settings" being "on" or "off" has nothing to do with this feature but the issue still remains that it only works when the phone is NOT in "sleep/lock" mode
-
Can I control the plug ins parameters with a single knob?
I have a question for garageband users. I have the iControl from m-audio to control the paramteters of a plug in but most of the times the knobs don't correspond and it takes a lot of times to figure out which knob controls what. So I use iControl mainly for play rec and the scroll wheel is very helpful. I also use metric halo ChannelStrip and it has a lot of parameters. With this plug in and many other when you put the mouse over a knob you can control it by turning the arrow up down, I find this very imprecise and I would like something else. Is it possible to click with the mouse on a parameter knob of a plug in and increase or decrease it with an external knob?
I don't know if my question is clear, may be it's possible to do that with some midi programmation?
Thanks in adavance for all input
Message was edited by: Louis GagnonYou have an overdetermined system. To exactly define one of three states, only two booleans are needed.
Test for too low and too high and if both are false we are automatically in range, right?
Here's what you could do.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
forum nov 14MODCA.vi 10 KB -
How to Control the Valves and Pump with Labview?
I have started a new project where I have to control the valves operation through Labview 2009,using PXI 1031, NI 5105(Digitizer) and NI 6251(M-series DAQ).
The valves I need to control using the labview are:
a) Pressure Reducing Valve (open & close)
b) Remote control Valve(On & Off) with in-built actuator
c) Flow control valve(open, semi open, partially open, semi close, partially close, fully close), 1%, 2%, 3%..etc
d)saftey valve (opening closing depending on increase in pressure from certian limit)
I hav eto control
a) Hydraulic pump operation with in built gear-box
Please let me know, how should l develop the VI for all? How to get started?, any helpful links? If there is any example code?
Its little urgent !If you are not familiar with LV, I would suggest you go through the tutorials. Then take the leap and figure out how to use Action Engines and State Machines (search any of the terms I used that don't understand, there are a zillion threads on them).
Then...
Sit down and write stand-alone testers for each of the widgets you are going to control monitor etc.
These testers will give you an idea if they really work the way you think, their character, and will serve as a "Sanity Check" when you think you are going crazy durring development.
THen integrate the tester so they can all work at the same time. This will become a utility screen that will serve you well when maintaining the critter latter in its life.
Only then...
write out a complete set of state diagrams that describe what you plan to do (don't cheat! ) and walk through them in your head until you are cetain it will all work blah blah blah.
This step is optional but highly recomened...
Compose a detailed set of documemtns describing what you have in mind and post them here (include the images, they will get many mor readers) and let people pick aprat your design.
When you have a final design, use everything you learned along the way to be a kick-ass developer.
Along the way post distinct well defined question on this site and as long as it looks like you are trying someone will probably reply and get you going again.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Controling the MC or animation with the mouse moviment
Hi folks... how are you?
I need some help... I did a cube on the 3DMAX and exported as
SWF and imported on flash... the animation i've made on the 3dmax
is working... my question is... there is a way to control the cube
moviment? like when mouse move to the right the cube moves to the
right and same for left side? i put a picture on each cube's face
and planing to use as a kind of menu.
Tks a lotAny way we can see this cube? Do you have this uploaded
anywhere?
If you are using the imported cube as a symbol, and give it
an instance name, you should be able to add a few lines of code to
move it with the mouse. But it doesn't sound as though this is what
you want. You want to control the full rotation. Maybe you need to
use your imported swf as a template for redrawing the cube in
Illustrator/Flash. -
Can 2 iPhones control the same iTunes Library with Remote?
Hi,
Does anyone know if you can authorize 2 iPhones to control the same iTunes library using the iPhone Remote app? Or can only one iPhone be authorized at any one time?
Thanks!
- JohnHey John,
Yes, you can have multiple iPhones remote controlling iTunes.
Jason -
[Solved] Keep the last button pressed with a custom style
Hello,
I have a VBox with 20 buttons and I have this style applied (menu.css) (only for VBox wrapper):
.button:focused {
-fx-background-color: #0768A9;
-fx-text-fill: #FFFFFF;
But when I pressed other button outside the VBox the style disappears, because the other button get the focus.
I'm afraid I'm taking the wrong way.
How I can do to keep the last button pressed with a custom style? (Only for buttons containing the VBox).
Best regardsI created a simple method to change background colors in buttons:
private void setSelectedBtnStyle(Button bboat) {
// Change style oldSelectedBoat
selectedBoat.setStyle("-fx-background-color: white;-fx-text-fill: black;");
// oldSelectedBoat var change to newSelectedBoat
this.selectedBoat = bboat;
// Change style newSelectedBoat
selectedBoat.setStyle("-fx-background-color: #0768A9;-fx-text-fill: #FFFFFF;");;
Surely not the best solution, but it works for me.
Best regards.
Maybe you are looking for
-
Back To My Mac: why can't I copy files between Macs?
I use Back To My Mac to connect between a Mac Book Pro and Mac Pro. These two machines have the same home directory name, but different passwords. My home network is on an Apple Airport Extreme. A recent, persistent bug is causing havoc when I try to
-
Select option in OM report.
Hello Every One, I have on issue hope someone can help me with it. I wrote report in OM using PCH logical DB using standard selection Screen. it is working fine. Now the user wants to have an option at selection Screen for a custom
-
What happens now, doesn't seem to be an update for ibooks. Are all my books in the cloud so when you ever fix it I can get them that way? Updated to Yosemite on my mac and my iPad is os 8.2
-
Why does my lock screen glow green?
Why does my lock screen glow green? It does it quite often, no affects on the phone.
-
Lost Voice option with new update
I lost the the option to enter text via voice when texting, emailing withe new 9.1.41.XT926/4.1 Jelly Bean updated today. I do not see the microphone icon in the keyboard anymore. Please helpo me restore. Thanks