How to suspend with a keyboard shortcut?
I would like to suspend my xubuntu (14.04) system from a keyboard shortcut without entering my superuser password (sudo). I'm looking a command line which I can convert to a shortcut.
So far, I tried two solutions:
Xfce command:
xfce4-session-logout --suspend
Problem: The system doesn't lock the session. I don't need to enter my password for the wake-up and I want to do it.
Dbus:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
Problem: After wake-up, the Internet connection is down and I have to reboot the system to get it back.
Is there a third solution which 1. ask the password during the wake-up process, and 2. doesn't mess up with Internet connection?
In fact, the graphical default shortcut (from the menu) works fine. I just don't know which command line is called.
xfce suspend xubuntu
add a comment |
I would like to suspend my xubuntu (14.04) system from a keyboard shortcut without entering my superuser password (sudo). I'm looking a command line which I can convert to a shortcut.
So far, I tried two solutions:
Xfce command:
xfce4-session-logout --suspend
Problem: The system doesn't lock the session. I don't need to enter my password for the wake-up and I want to do it.
Dbus:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
Problem: After wake-up, the Internet connection is down and I have to reboot the system to get it back.
Is there a third solution which 1. ask the password during the wake-up process, and 2. doesn't mess up with Internet connection?
In fact, the graphical default shortcut (from the menu) works fine. I just don't know which command line is called.
xfce suspend xubuntu
add a comment |
I would like to suspend my xubuntu (14.04) system from a keyboard shortcut without entering my superuser password (sudo). I'm looking a command line which I can convert to a shortcut.
So far, I tried two solutions:
Xfce command:
xfce4-session-logout --suspend
Problem: The system doesn't lock the session. I don't need to enter my password for the wake-up and I want to do it.
Dbus:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
Problem: After wake-up, the Internet connection is down and I have to reboot the system to get it back.
Is there a third solution which 1. ask the password during the wake-up process, and 2. doesn't mess up with Internet connection?
In fact, the graphical default shortcut (from the menu) works fine. I just don't know which command line is called.
xfce suspend xubuntu
I would like to suspend my xubuntu (14.04) system from a keyboard shortcut without entering my superuser password (sudo). I'm looking a command line which I can convert to a shortcut.
So far, I tried two solutions:
Xfce command:
xfce4-session-logout --suspend
Problem: The system doesn't lock the session. I don't need to enter my password for the wake-up and I want to do it.
Dbus:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
Problem: After wake-up, the Internet connection is down and I have to reboot the system to get it back.
Is there a third solution which 1. ask the password during the wake-up process, and 2. doesn't mess up with Internet connection?
In fact, the graphical default shortcut (from the menu) works fine. I just don't know which command line is called.
xfce suspend xubuntu
xfce suspend xubuntu
edited Dec 12 '15 at 23:51
ppr
asked Jul 30 '14 at 16:03
pprppr
71061434
71061434
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
I wrote a script. It seems to do what you ask for:
#!/usr/bin/env zsh
# Custom suspend
#
# (That 'zsh' up there can be switched to 'bash', or
# pretty much any shell - this doesn't do anything too fancy.)
#
# Dependencies are mostly xfce stuff:
#
# xbacklight
# xflock4
# xfce4-session-logout
# Set how dim we want the screen to go (percentage, out of 100)
dim=5
# Pack up your toys
previous_dimness=$(xbacklight -get)
# Turn down the lights
xbacklight -set $dim
# Lock the door (this requires a password to get back in)
xflock4
# And go to sleep
xfce4-session-logout --suspend
# When we wake up, turn the lights back on
xbacklight -set $previous_dimness
1
+1 for the wonderful comments. I think I will use this script when I install Ubuntu.
– Wildcard
Dec 12 '15 at 3:21
Im sorry but where should I place this script? how should I connect it with a keyboard shortcut (for example ctrl+alt+s)? I am using Lubuntu
– hipoglucido
Aug 12 '17 at 15:29
You can technically put the script anywhere. I have a bin/ directory under my home directory just for personal scripts like this that I want to use. In this case, the path to the script is: /home/<username>/bin/custom-suspend You'll want to make sure the script is executable. One way to do that is to run the following command: $ chmod +x /home/<username>/bin/custom-suspend To give it a shortcut under LXDE (which Lubuntu) uses, you should be able to search for something like 'keyboard' from the start menu, which should show you the keyboard config app.
– Jon Carter
Aug 14 '17 at 3:53
add a comment |
You can very simply send the command for it to lock screen first, and then have it suspend:
xscreensaver-command -lock ; xfce4-session-logout --suspend
For usage of xscreensaver-command
, run xscreensaver-command --help
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04). By the way, the Xfce app for locking the screen is xflock4 (no args), which by default is bound to control-alt-delete.
– BobDoolittle
Oct 22 '15 at 18:21
xscreensaver-command
seems to be gone in 15.10.
– Jesse Glick
Jan 14 '16 at 23:54
@JesseGlick - just install thexscreensaver
package
– Wilf
Jan 15 '16 at 17:28
add a comment |
Oddly enough xfce4-session-logout --suspend
works just fine, and my system is xubuntu 14.04.
It also does lock the session, although I have switched on the option "lock screen before sleep", go to Settings->Session and Startup-> Advanced, and check if it switched on there.
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04).
– BobDoolittle
Oct 22 '15 at 18:21
well, it is supposed to work in xubuntu, not ubuntu. I am not sure why do you even have thexfce4-session-logout
command.
– Ufos
Oct 23 '15 at 14:41
We are talking Xfce, which can be added to any ubuntu distribution. Xubuntu is simply a convenience distro that happens to have added Xfce packages and configured them as a desktop. You can start with ubuntu and add/configure it yourself. The xubuntu/ubuntu distinction is a red herring here.
– BobDoolittle
Oct 23 '15 at 18:21
Working fine for me, with screen lock, in Xubuntu 15.10.
– Jesse Glick
Jan 15 '16 at 0:25
add a comment |
This command works for me:
I just make a launcher for desktop and set the Shutdown Icon for that. put this command in command filed:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
fist time ask me to make Executable and after that working very well.
I'm using wicd for Internet connection and It's working well too after waking up!
Xubuntu 15.10:Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
– Jesse Glick
Jan 14 '16 at 23:53
add a comment |
If you're on a laptop and just want a key to press. You can use the power button.
The behavior can be set from the Power settings:
- Open Settings Manager (or by command : xfce4-settings-manager )
- Open Power Manager settings
- In General : set When power button is pressed to Ask
- Close Power Manager settings
If you have ACPI scripts installed, deactivate or update the
power-button script from
/etc/acpi/events/, and change the action field to /bin/true:
# EXAMPLE
event=button/power.*
#action=/usr/lib/acpid/power_button
action=/bin/true
Ref: https://wiki.xfce.org/tips#solution_2
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f147465%2fhow-to-suspend-with-a-keyboard-shortcut%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
I wrote a script. It seems to do what you ask for:
#!/usr/bin/env zsh
# Custom suspend
#
# (That 'zsh' up there can be switched to 'bash', or
# pretty much any shell - this doesn't do anything too fancy.)
#
# Dependencies are mostly xfce stuff:
#
# xbacklight
# xflock4
# xfce4-session-logout
# Set how dim we want the screen to go (percentage, out of 100)
dim=5
# Pack up your toys
previous_dimness=$(xbacklight -get)
# Turn down the lights
xbacklight -set $dim
# Lock the door (this requires a password to get back in)
xflock4
# And go to sleep
xfce4-session-logout --suspend
# When we wake up, turn the lights back on
xbacklight -set $previous_dimness
1
+1 for the wonderful comments. I think I will use this script when I install Ubuntu.
– Wildcard
Dec 12 '15 at 3:21
Im sorry but where should I place this script? how should I connect it with a keyboard shortcut (for example ctrl+alt+s)? I am using Lubuntu
– hipoglucido
Aug 12 '17 at 15:29
You can technically put the script anywhere. I have a bin/ directory under my home directory just for personal scripts like this that I want to use. In this case, the path to the script is: /home/<username>/bin/custom-suspend You'll want to make sure the script is executable. One way to do that is to run the following command: $ chmod +x /home/<username>/bin/custom-suspend To give it a shortcut under LXDE (which Lubuntu) uses, you should be able to search for something like 'keyboard' from the start menu, which should show you the keyboard config app.
– Jon Carter
Aug 14 '17 at 3:53
add a comment |
I wrote a script. It seems to do what you ask for:
#!/usr/bin/env zsh
# Custom suspend
#
# (That 'zsh' up there can be switched to 'bash', or
# pretty much any shell - this doesn't do anything too fancy.)
#
# Dependencies are mostly xfce stuff:
#
# xbacklight
# xflock4
# xfce4-session-logout
# Set how dim we want the screen to go (percentage, out of 100)
dim=5
# Pack up your toys
previous_dimness=$(xbacklight -get)
# Turn down the lights
xbacklight -set $dim
# Lock the door (this requires a password to get back in)
xflock4
# And go to sleep
xfce4-session-logout --suspend
# When we wake up, turn the lights back on
xbacklight -set $previous_dimness
1
+1 for the wonderful comments. I think I will use this script when I install Ubuntu.
– Wildcard
Dec 12 '15 at 3:21
Im sorry but where should I place this script? how should I connect it with a keyboard shortcut (for example ctrl+alt+s)? I am using Lubuntu
– hipoglucido
Aug 12 '17 at 15:29
You can technically put the script anywhere. I have a bin/ directory under my home directory just for personal scripts like this that I want to use. In this case, the path to the script is: /home/<username>/bin/custom-suspend You'll want to make sure the script is executable. One way to do that is to run the following command: $ chmod +x /home/<username>/bin/custom-suspend To give it a shortcut under LXDE (which Lubuntu) uses, you should be able to search for something like 'keyboard' from the start menu, which should show you the keyboard config app.
– Jon Carter
Aug 14 '17 at 3:53
add a comment |
I wrote a script. It seems to do what you ask for:
#!/usr/bin/env zsh
# Custom suspend
#
# (That 'zsh' up there can be switched to 'bash', or
# pretty much any shell - this doesn't do anything too fancy.)
#
# Dependencies are mostly xfce stuff:
#
# xbacklight
# xflock4
# xfce4-session-logout
# Set how dim we want the screen to go (percentage, out of 100)
dim=5
# Pack up your toys
previous_dimness=$(xbacklight -get)
# Turn down the lights
xbacklight -set $dim
# Lock the door (this requires a password to get back in)
xflock4
# And go to sleep
xfce4-session-logout --suspend
# When we wake up, turn the lights back on
xbacklight -set $previous_dimness
I wrote a script. It seems to do what you ask for:
#!/usr/bin/env zsh
# Custom suspend
#
# (That 'zsh' up there can be switched to 'bash', or
# pretty much any shell - this doesn't do anything too fancy.)
#
# Dependencies are mostly xfce stuff:
#
# xbacklight
# xflock4
# xfce4-session-logout
# Set how dim we want the screen to go (percentage, out of 100)
dim=5
# Pack up your toys
previous_dimness=$(xbacklight -get)
# Turn down the lights
xbacklight -set $dim
# Lock the door (this requires a password to get back in)
xflock4
# And go to sleep
xfce4-session-logout --suspend
# When we wake up, turn the lights back on
xbacklight -set $previous_dimness
answered Dec 12 '15 at 2:01
Jon CarterJon Carter
20826
20826
1
+1 for the wonderful comments. I think I will use this script when I install Ubuntu.
– Wildcard
Dec 12 '15 at 3:21
Im sorry but where should I place this script? how should I connect it with a keyboard shortcut (for example ctrl+alt+s)? I am using Lubuntu
– hipoglucido
Aug 12 '17 at 15:29
You can technically put the script anywhere. I have a bin/ directory under my home directory just for personal scripts like this that I want to use. In this case, the path to the script is: /home/<username>/bin/custom-suspend You'll want to make sure the script is executable. One way to do that is to run the following command: $ chmod +x /home/<username>/bin/custom-suspend To give it a shortcut under LXDE (which Lubuntu) uses, you should be able to search for something like 'keyboard' from the start menu, which should show you the keyboard config app.
– Jon Carter
Aug 14 '17 at 3:53
add a comment |
1
+1 for the wonderful comments. I think I will use this script when I install Ubuntu.
– Wildcard
Dec 12 '15 at 3:21
Im sorry but where should I place this script? how should I connect it with a keyboard shortcut (for example ctrl+alt+s)? I am using Lubuntu
– hipoglucido
Aug 12 '17 at 15:29
You can technically put the script anywhere. I have a bin/ directory under my home directory just for personal scripts like this that I want to use. In this case, the path to the script is: /home/<username>/bin/custom-suspend You'll want to make sure the script is executable. One way to do that is to run the following command: $ chmod +x /home/<username>/bin/custom-suspend To give it a shortcut under LXDE (which Lubuntu) uses, you should be able to search for something like 'keyboard' from the start menu, which should show you the keyboard config app.
– Jon Carter
Aug 14 '17 at 3:53
1
1
+1 for the wonderful comments. I think I will use this script when I install Ubuntu.
– Wildcard
Dec 12 '15 at 3:21
+1 for the wonderful comments. I think I will use this script when I install Ubuntu.
– Wildcard
Dec 12 '15 at 3:21
Im sorry but where should I place this script? how should I connect it with a keyboard shortcut (for example ctrl+alt+s)? I am using Lubuntu
– hipoglucido
Aug 12 '17 at 15:29
Im sorry but where should I place this script? how should I connect it with a keyboard shortcut (for example ctrl+alt+s)? I am using Lubuntu
– hipoglucido
Aug 12 '17 at 15:29
You can technically put the script anywhere. I have a bin/ directory under my home directory just for personal scripts like this that I want to use. In this case, the path to the script is: /home/<username>/bin/custom-suspend You'll want to make sure the script is executable. One way to do that is to run the following command: $ chmod +x /home/<username>/bin/custom-suspend To give it a shortcut under LXDE (which Lubuntu) uses, you should be able to search for something like 'keyboard' from the start menu, which should show you the keyboard config app.
– Jon Carter
Aug 14 '17 at 3:53
You can technically put the script anywhere. I have a bin/ directory under my home directory just for personal scripts like this that I want to use. In this case, the path to the script is: /home/<username>/bin/custom-suspend You'll want to make sure the script is executable. One way to do that is to run the following command: $ chmod +x /home/<username>/bin/custom-suspend To give it a shortcut under LXDE (which Lubuntu) uses, you should be able to search for something like 'keyboard' from the start menu, which should show you the keyboard config app.
– Jon Carter
Aug 14 '17 at 3:53
add a comment |
You can very simply send the command for it to lock screen first, and then have it suspend:
xscreensaver-command -lock ; xfce4-session-logout --suspend
For usage of xscreensaver-command
, run xscreensaver-command --help
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04). By the way, the Xfce app for locking the screen is xflock4 (no args), which by default is bound to control-alt-delete.
– BobDoolittle
Oct 22 '15 at 18:21
xscreensaver-command
seems to be gone in 15.10.
– Jesse Glick
Jan 14 '16 at 23:54
@JesseGlick - just install thexscreensaver
package
– Wilf
Jan 15 '16 at 17:28
add a comment |
You can very simply send the command for it to lock screen first, and then have it suspend:
xscreensaver-command -lock ; xfce4-session-logout --suspend
For usage of xscreensaver-command
, run xscreensaver-command --help
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04). By the way, the Xfce app for locking the screen is xflock4 (no args), which by default is bound to control-alt-delete.
– BobDoolittle
Oct 22 '15 at 18:21
xscreensaver-command
seems to be gone in 15.10.
– Jesse Glick
Jan 14 '16 at 23:54
@JesseGlick - just install thexscreensaver
package
– Wilf
Jan 15 '16 at 17:28
add a comment |
You can very simply send the command for it to lock screen first, and then have it suspend:
xscreensaver-command -lock ; xfce4-session-logout --suspend
For usage of xscreensaver-command
, run xscreensaver-command --help
You can very simply send the command for it to lock screen first, and then have it suspend:
xscreensaver-command -lock ; xfce4-session-logout --suspend
For usage of xscreensaver-command
, run xscreensaver-command --help
answered Jul 30 '14 at 16:25
WilfWilf
1,77421535
1,77421535
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04). By the way, the Xfce app for locking the screen is xflock4 (no args), which by default is bound to control-alt-delete.
– BobDoolittle
Oct 22 '15 at 18:21
xscreensaver-command
seems to be gone in 15.10.
– Jesse Glick
Jan 14 '16 at 23:54
@JesseGlick - just install thexscreensaver
package
– Wilf
Jan 15 '16 at 17:28
add a comment |
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04). By the way, the Xfce app for locking the screen is xflock4 (no args), which by default is bound to control-alt-delete.
– BobDoolittle
Oct 22 '15 at 18:21
xscreensaver-command
seems to be gone in 15.10.
– Jesse Glick
Jan 14 '16 at 23:54
@JesseGlick - just install thexscreensaver
package
– Wilf
Jan 15 '16 at 17:28
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04). By the way, the Xfce app for locking the screen is xflock4 (no args), which by default is bound to control-alt-delete.
– BobDoolittle
Oct 22 '15 at 18:21
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04). By the way, the Xfce app for locking the screen is xflock4 (no args), which by default is bound to control-alt-delete.
– BobDoolittle
Oct 22 '15 at 18:21
xscreensaver-command
seems to be gone in 15.10.– Jesse Glick
Jan 14 '16 at 23:54
xscreensaver-command
seems to be gone in 15.10.– Jesse Glick
Jan 14 '16 at 23:54
@JesseGlick - just install the
xscreensaver
package– Wilf
Jan 15 '16 at 17:28
@JesseGlick - just install the
xscreensaver
package– Wilf
Jan 15 '16 at 17:28
add a comment |
Oddly enough xfce4-session-logout --suspend
works just fine, and my system is xubuntu 14.04.
It also does lock the session, although I have switched on the option "lock screen before sleep", go to Settings->Session and Startup-> Advanced, and check if it switched on there.
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04).
– BobDoolittle
Oct 22 '15 at 18:21
well, it is supposed to work in xubuntu, not ubuntu. I am not sure why do you even have thexfce4-session-logout
command.
– Ufos
Oct 23 '15 at 14:41
We are talking Xfce, which can be added to any ubuntu distribution. Xubuntu is simply a convenience distro that happens to have added Xfce packages and configured them as a desktop. You can start with ubuntu and add/configure it yourself. The xubuntu/ubuntu distinction is a red herring here.
– BobDoolittle
Oct 23 '15 at 18:21
Working fine for me, with screen lock, in Xubuntu 15.10.
– Jesse Glick
Jan 15 '16 at 0:25
add a comment |
Oddly enough xfce4-session-logout --suspend
works just fine, and my system is xubuntu 14.04.
It also does lock the session, although I have switched on the option "lock screen before sleep", go to Settings->Session and Startup-> Advanced, and check if it switched on there.
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04).
– BobDoolittle
Oct 22 '15 at 18:21
well, it is supposed to work in xubuntu, not ubuntu. I am not sure why do you even have thexfce4-session-logout
command.
– Ufos
Oct 23 '15 at 14:41
We are talking Xfce, which can be added to any ubuntu distribution. Xubuntu is simply a convenience distro that happens to have added Xfce packages and configured them as a desktop. You can start with ubuntu and add/configure it yourself. The xubuntu/ubuntu distinction is a red herring here.
– BobDoolittle
Oct 23 '15 at 18:21
Working fine for me, with screen lock, in Xubuntu 15.10.
– Jesse Glick
Jan 15 '16 at 0:25
add a comment |
Oddly enough xfce4-session-logout --suspend
works just fine, and my system is xubuntu 14.04.
It also does lock the session, although I have switched on the option "lock screen before sleep", go to Settings->Session and Startup-> Advanced, and check if it switched on there.
Oddly enough xfce4-session-logout --suspend
works just fine, and my system is xubuntu 14.04.
It also does lock the session, although I have switched on the option "lock screen before sleep", go to Settings->Session and Startup-> Advanced, and check if it switched on there.
answered Aug 3 '15 at 20:01
UfosUfos
1587
1587
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04).
– BobDoolittle
Oct 22 '15 at 18:21
well, it is supposed to work in xubuntu, not ubuntu. I am not sure why do you even have thexfce4-session-logout
command.
– Ufos
Oct 23 '15 at 14:41
We are talking Xfce, which can be added to any ubuntu distribution. Xubuntu is simply a convenience distro that happens to have added Xfce packages and configured them as a desktop. You can start with ubuntu and add/configure it yourself. The xubuntu/ubuntu distinction is a red herring here.
– BobDoolittle
Oct 23 '15 at 18:21
Working fine for me, with screen lock, in Xubuntu 15.10.
– Jesse Glick
Jan 15 '16 at 0:25
add a comment |
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04).
– BobDoolittle
Oct 22 '15 at 18:21
well, it is supposed to work in xubuntu, not ubuntu. I am not sure why do you even have thexfce4-session-logout
command.
– Ufos
Oct 23 '15 at 14:41
We are talking Xfce, which can be added to any ubuntu distribution. Xubuntu is simply a convenience distro that happens to have added Xfce packages and configured them as a desktop. You can start with ubuntu and add/configure it yourself. The xubuntu/ubuntu distinction is a red herring here.
– BobDoolittle
Oct 23 '15 at 18:21
Working fine for me, with screen lock, in Xubuntu 15.10.
– Jesse Glick
Jan 15 '16 at 0:25
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04).
– BobDoolittle
Oct 22 '15 at 18:21
That works from command line (although the lock screen is unnecessary since that's automatic with suspend), but not as a keyboard application shortcut (at least with Ubuntu 12.04).
– BobDoolittle
Oct 22 '15 at 18:21
well, it is supposed to work in xubuntu, not ubuntu. I am not sure why do you even have the
xfce4-session-logout
command.– Ufos
Oct 23 '15 at 14:41
well, it is supposed to work in xubuntu, not ubuntu. I am not sure why do you even have the
xfce4-session-logout
command.– Ufos
Oct 23 '15 at 14:41
We are talking Xfce, which can be added to any ubuntu distribution. Xubuntu is simply a convenience distro that happens to have added Xfce packages and configured them as a desktop. You can start with ubuntu and add/configure it yourself. The xubuntu/ubuntu distinction is a red herring here.
– BobDoolittle
Oct 23 '15 at 18:21
We are talking Xfce, which can be added to any ubuntu distribution. Xubuntu is simply a convenience distro that happens to have added Xfce packages and configured them as a desktop. You can start with ubuntu and add/configure it yourself. The xubuntu/ubuntu distinction is a red herring here.
– BobDoolittle
Oct 23 '15 at 18:21
Working fine for me, with screen lock, in Xubuntu 15.10.
– Jesse Glick
Jan 15 '16 at 0:25
Working fine for me, with screen lock, in Xubuntu 15.10.
– Jesse Glick
Jan 15 '16 at 0:25
add a comment |
This command works for me:
I just make a launcher for desktop and set the Shutdown Icon for that. put this command in command filed:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
fist time ask me to make Executable and after that working very well.
I'm using wicd for Internet connection and It's working well too after waking up!
Xubuntu 15.10:Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
– Jesse Glick
Jan 14 '16 at 23:53
add a comment |
This command works for me:
I just make a launcher for desktop and set the Shutdown Icon for that. put this command in command filed:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
fist time ask me to make Executable and after that working very well.
I'm using wicd for Internet connection and It's working well too after waking up!
Xubuntu 15.10:Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
– Jesse Glick
Jan 14 '16 at 23:53
add a comment |
This command works for me:
I just make a launcher for desktop and set the Shutdown Icon for that. put this command in command filed:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
fist time ask me to make Executable and after that working very well.
I'm using wicd for Internet connection and It's working well too after waking up!
This command works for me:
I just make a launcher for desktop and set the Shutdown Icon for that. put this command in command filed:
dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
fist time ask me to make Executable and after that working very well.
I'm using wicd for Internet connection and It's working well too after waking up!
answered Jan 2 '15 at 9:50
VahidVahid
1011
1011
Xubuntu 15.10:Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
– Jesse Glick
Jan 14 '16 at 23:53
add a comment |
Xubuntu 15.10:Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
– Jesse Glick
Jan 14 '16 at 23:53
Xubuntu 15.10:
Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
– Jesse Glick
Jan 14 '16 at 23:53
Xubuntu 15.10:
Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist
– Jesse Glick
Jan 14 '16 at 23:53
add a comment |
If you're on a laptop and just want a key to press. You can use the power button.
The behavior can be set from the Power settings:
- Open Settings Manager (or by command : xfce4-settings-manager )
- Open Power Manager settings
- In General : set When power button is pressed to Ask
- Close Power Manager settings
If you have ACPI scripts installed, deactivate or update the
power-button script from
/etc/acpi/events/, and change the action field to /bin/true:
# EXAMPLE
event=button/power.*
#action=/usr/lib/acpid/power_button
action=/bin/true
Ref: https://wiki.xfce.org/tips#solution_2
add a comment |
If you're on a laptop and just want a key to press. You can use the power button.
The behavior can be set from the Power settings:
- Open Settings Manager (or by command : xfce4-settings-manager )
- Open Power Manager settings
- In General : set When power button is pressed to Ask
- Close Power Manager settings
If you have ACPI scripts installed, deactivate or update the
power-button script from
/etc/acpi/events/, and change the action field to /bin/true:
# EXAMPLE
event=button/power.*
#action=/usr/lib/acpid/power_button
action=/bin/true
Ref: https://wiki.xfce.org/tips#solution_2
add a comment |
If you're on a laptop and just want a key to press. You can use the power button.
The behavior can be set from the Power settings:
- Open Settings Manager (or by command : xfce4-settings-manager )
- Open Power Manager settings
- In General : set When power button is pressed to Ask
- Close Power Manager settings
If you have ACPI scripts installed, deactivate or update the
power-button script from
/etc/acpi/events/, and change the action field to /bin/true:
# EXAMPLE
event=button/power.*
#action=/usr/lib/acpid/power_button
action=/bin/true
Ref: https://wiki.xfce.org/tips#solution_2
If you're on a laptop and just want a key to press. You can use the power button.
The behavior can be set from the Power settings:
- Open Settings Manager (or by command : xfce4-settings-manager )
- Open Power Manager settings
- In General : set When power button is pressed to Ask
- Close Power Manager settings
If you have ACPI scripts installed, deactivate or update the
power-button script from
/etc/acpi/events/, and change the action field to /bin/true:
# EXAMPLE
event=button/power.*
#action=/usr/lib/acpid/power_button
action=/bin/true
Ref: https://wiki.xfce.org/tips#solution_2
answered Mar 7 at 9:17
Mads HansenMads Hansen
13
13
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f147465%2fhow-to-suspend-with-a-keyboard-shortcut%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown