qshutdown doesn't do anything after countdown is over - any alternatives?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
qshutdown doesn't do anything after countdown is over - any alternatives?
Hi everyone,
I'm using Mint KDE and I'm searching for a super simple timer/scheduler (like SwitchOff for Windows, that was perfect) to hibernate my laptop every night because I have a habit of falling asleep while using it and there's no point in leaving it switched on all night. I've been trying to get qshutdown work for months, but no matter what I do, the countdown just reaches zero and then the program window stays open on top, not doing anything (same when I set it to suspend the machine). Manual hibernation has always worked, and I've tried uninstalling and reinstalling qshutdown quite a few times. There's only one user (*tree voice on*I am root) in the system, so there shouldn't be an authorization issue.
I don't even mind if this thing will never work, as long as you can recommend another timer that actually gets the job done.
I'm using Mint KDE and I'm searching for a super simple timer/scheduler (like SwitchOff for Windows, that was perfect) to hibernate my laptop every night because I have a habit of falling asleep while using it and there's no point in leaving it switched on all night. I've been trying to get qshutdown work for months, but no matter what I do, the countdown just reaches zero and then the program window stays open on top, not doing anything (same when I set it to suspend the machine). Manual hibernation has always worked, and I've tried uninstalling and reinstalling qshutdown quite a few times. There's only one user (*tree voice on*I am root) in the system, so there shouldn't be an authorization issue.
I don't even mind if this thing will never work, as long as you can recommend another timer that actually gets the job done.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
HI,
I do not understand.
Why do you have to use a timer?
Are not sufficient the standard linux settings that allow hibernation after a period of inactivity?
I do not understand.
Why do you have to use a timer?
Are not sufficient the standard linux settings that allow hibernation after a period of inactivity?
Ogni storia è vera, semplicemente alcune non sono mai accadute. [SandMan]
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
I have this habit toozzora wrote: ⤴Sun May 12, 2019 1:33 am Hi everyone,
I'm using Mint KDE and I'm searching for a super simple timer/scheduler (like SwitchOff for Windows, that was perfect) to hibernate my laptop every night because I have a habit of falling asleep while using it and there's no point in leaving it switched on all night. I've been trying to get qshutdown work for months, but no matter what I do, the countdown just reaches zero and then the program window stays open on top, not doing anything (same when I set it to suspend the machine). Manual hibernation has always worked, and I've tried uninstalling and reinstalling qshutdown quite a few times. There's only one user (*tree voice on*I am root) in the system, so there shouldn't be an authorization issue.
I don't even mind if this thing will never work, as long as you can recommend another timer that actually gets the job done.
Before many years I searched for this kind of programs, but because I wanted to have a snooze timer future I didn't find any at that time. So I created one myself in java and I was using it for many years. I stopped using it before 2 years because I ported it to python and use that version instead. Unfortunately only the java version is in english. If you want I can upload it for you. You can also use a bash script for this job. I also have one which I used for some time:
Code: Select all
#!/bin/bash
function insertTime()
{
frmdata=$(yad --center --width="260" --height="50" --title="Set timer" \
--text='<span foreground="green" font="16">Enter time until shutdown:</span>' \
--button="OK" --button="Cancel" --form \
--field=" Hours:":NUM "0" \
--field=" Minutes:":NUM "0")
hours=$(echo $frmdata | awk 'BEGIN {FS="|" } { print $1 }')
minutes=$(echo $frmdata | awk 'BEGIN {FS="|" } { print $2 }')
time=$(($hours*3600 + $minutes*60))
msg=$(date --date="now +$time seconds")
/usr/bin/notify-send -t 0 "WARNING!!" "The computer will shutdown at $msg"
date --date="now + $time seconds"
if [ $time -ge 0 ]; then
echo $minutes
sleep $time
doShutdown
else
echo "Canceled"
fi
}
function doShutdown()
{
info=$(yad --center --width="260" --height="260" --image "dialog-question" --undecorated \
--timeout="60" --timeout-indicator="top" --button="Snooze" --button="Cancel" \
--title="WARNING!!" --text-align="center" --sticky --on-top --buttons-layout="center" \
--text='<span foreground="red" font="24">SHUTDOWN COMPUTER
ΣΕ</span>
<span foreground="green" font="42">1</span><span foreground="red" font="24">
ΛΕΠΤΟ!!</span>')
case $? in
70)
echo "timeout!!!"
systemctl poweroff
;;
1)
yad --timeout="3" --timeout-indicator="top" --center --width="240" --height="50" \
--undecorated --text-align="center" --buttons-layout="edge" \
--text='\n<span foreground="red" font="32">The action canceled!</span>' --button="Ok"
echo "canceled"
;;
0)
echo "snooze"
snooze
;;
252)
yad --timeout="3" --timeout-indicator="top" --center --width="240" --height="50" \
--undecorated --text-align="center" --buttons-layout="edge" \
--text='\n<span foreground="red" font="32">The action canceled!</span>' --button="Ok"
echo "escape pressed"
;;
esac
}
function snooze()
{
snz=$(yad --center --width="120" --height="260" --list --radiolist --no-click \
--button="Snooze" --button="Cancel" \
--column "Select" --column "Minutes" TRUE "5" FALSE "15" FALSE "30" FALSE "45" FALSE \
"60" FALSE "75" FALSE "90" FALSE "120")
answer=$(echo $snz | awk 'BEGIN {FS="|" } { print $2 }')
case $answer in
5)
t1=$((5 * 60))
sleep $t1
doShutdown
;;
15)
t2=$((15 * 60))
sleep $t2
doShutdown
;;
30)
t3=$((30 * 60))
sleep $t3
doShutdown
;;
45)
t4=$((45 * 60))
sleep $t4
doShutdown
;;
60)
t5=$((60 * 60))
sleep $t5
doShutdown
;;
75)
t6=$((75 * 60))
sleep $t6
doShutdown
;;
90)
t7=$((90 * 60))
sleep $t7
doShutdown
;;
120)
;;
1)
yad --timeout="3" --timeout-indicator="top" --center --width="240" --height="50" \
--undecorated --text-align="center" --buttons-layout="edge" \
--text='\n<span foreground="red" font="32">Snooze canceled!</span>' --button="Ok"
echo "snooze canceled"
doShutdown
;;
252)
yad --timeout="3" --timeout-indicator="top" --center --width="240" --height="50" \
--undecorated --text-align="center" --buttons-layout="edge" \
--text='\n<span foreground="red" font="32">Snooze canceled!</span>' --button="Ok"
echo "escape pressed, canceled"
;;
esac
}
insertTime
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
Thanks, but no, because I only want to hibernate it at night, but there are inactive periods throughout the day too when it should stay switched on.
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
Wow, thanks. I have to admit, I don't understand much of this code since I have no experience in coding Can it be modified to hibernate the laptop instead of shutting the system down?dancer_69 wrote: ⤴Fri May 17, 2019 4:53 am
I have this habit too
Before many years I searched for this kind of programs, but because I wanted to have a snooze timer future I didn't find any at that time. So I created one myself in java and I was using it for many years. I stopped using it before 2 years because I ported it to python and use that version instead. Unfortunately only the java version is in english. If you want I can upload it for you. You can also use a bash script for this job. I also have one which I used for some time:
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
Yes, you must change the "systemctl poweroff" with "systemctl suspend", or "systemctl hybrid-sleep".
You can also try the python application I mentioned above, which have the option to choose. Extract the zip file where you want and then open a terminal inside this directory and run it with:
python3 /path/to/snoozeshutdown/main.py
There is also a .desktop file there which you can open it with any text editor, change the paths and use it to launch it .
https://www.dropbox.com/s/i090fq4l8pr3n ... n.zip?dl=0
You can also try the python application I mentioned above, which have the option to choose. Extract the zip file where you want and then open a terminal inside this directory and run it with:
python3 /path/to/snoozeshutdown/main.py
There is also a .desktop file there which you can open it with any text editor, change the paths and use it to launch it .
https://www.dropbox.com/s/i090fq4l8pr3n ... n.zip?dl=0
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
Hmm, no luck here, I've only been a Linux user for a half year and I still have trouble from time to time. When I try to open yad, there's only an empty dialog box with "Cancel" and "OK", console says "Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged."dancer_69 wrote: ⤴Mon May 20, 2019 8:20 am Yes, you must change the "systemctl poweroff" with "systemctl suspend", or "systemctl hybrid-sleep".
You can also try the python application I mentioned above, which have the option to choose. Extract the zip file where you want and then open a terminal inside this directory and run it with:
python3 /path/to/snoozeshutdown/main.py
There is also a .desktop file there which you can open it with any text editor, change the paths and use it to launch it .
https://www.dropbox.com/s/i090fq4l8pr3n ... n.zip?dl=0
And I couldn't open the .zip file, Ark claims the format is not supported but I regularly open .zips with no problem, so what the hell. ¯\_(ツ)_/¯ Thanks for your time anyway
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
I just copy and paste the code I posted here(in case something was wrong) to a new file and tested it. I don't get any error and the dialog appears correct. The console message you get I don't think is critical(I get that message too when I run this script or others with yad, when I was running them on arch linux).zzora wrote: ⤴Thu May 23, 2019 4:02 pm
Hmm, no luck here, I've only been a Linux user for a half year and I still have trouble from time to time. When I try to open yad, there's only an empty dialog box with "Cancel" and "OK", console says "Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged."
And I couldn't open the .zip file, Ark claims the format is not supported but I regularly open .zips with no problem, so what the hell. ¯\_(ツ)_/¯ Thanks for your time anyway
This is how it looks, but it depends which theme your system use:
About the zip, I didn't do anything special, but I reuploaded it to another hoster and now I used tar.gz instead of zip. you can try it:
https://megashare.megahd.com.br/alb
Probably you will need to install some packages which maybe aren't installed by default.
You' ll need python3-qt5 and python3-pyqt5multimedia. If something else missing post the error and will see.
EDIT:
Here is e deb install file, for easier installation:
https://megashare.megahd.com.br/ale
Hopefully you don't need to do anything else, just install it and run it from applications menu. It will be in Tools category.
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
Hi, thanks again for wasting so much time on my stupid headdancer_69 wrote: ⤴Fri May 24, 2019 3:45 pmI just copy and paste the code I posted here(in case something was wrong) to a new file and tested it. I don't get any error and the dialog appears correct. The console message you get I don't think is critical(I get that message too when I run this script or others with yad, when I was running them on arch linux).zzora wrote: ⤴Thu May 23, 2019 4:02 pm
Hmm, no luck here, I've only been a Linux user for a half year and I still have trouble from time to time. When I try to open yad, there's only an empty dialog box with "Cancel" and "OK", console says "Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged."
And I couldn't open the .zip file, Ark claims the format is not supported but I regularly open .zips with no problem, so what the hell. ¯\_(ツ)_/¯ Thanks for your time anyway
This is how it looks, but it depends which theme your system use:
About the zip, I didn't do anything special, but I reuploaded it to another hoster and now I used tar.gz instead of zip. you can try it:
https://megashare.megahd.com.br/alb
Probably you will need to install some packages which maybe aren't installed by default.
You' ll need python3-qt5 and python3-pyqt5multimedia. If something else missing post the error and will see.
EDIT:
Here is e deb install file, for easier installation:
https://megashare.megahd.com.br/ale
Hopefully you don't need to do anything else, just install it and run it from applications menu. It will be in Tools category.
The problem with yad is that it doesn't open at all. Synaptic claims I have it installed (I even tried reinstalling), but it doesn't appear in the applications menu, and when I open it from terminal, all it shows is an empty dialog box with no menus or anything. Kind of a broken installation, I guess. Are there any other applications I could use to open the code?
The installer worked, though the whole thing is in Greek (I figured it out though, it's not a big deal ), and every time I try to set it to hibernation, the checkmark jumps back to shutdown. And the python packages you listed are not found according to terminal. This just keeps getting weirder and weirder. I almost miss Windows right now Joking.
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
Yad is a tool to display graphical windows and menus in bash scripts, isn't supposed to running directly but from inside scripts. So it's normal that you cannot find it in applications menu and also normal to get a window with OK/Cancel buttons only if you run it from terminal.
You need to run the script not yad itself. The code I posted must be copied to a new file, you can do it from file manager by right click in empty space and choose "create new file -> plain text", or by open any text editor, paste the code and save the file anywhere you want with any name you want. Then go to where you saved it, open a terminal in that folder and run the command:
Then run it with the command:
Then it should run.
About the installer, since it's installed don't worry about the python packages. It should be in english though. I don't have much experience in coding and python and seems that I didn't implement the transaltion stuff correct. Don't worry for checkmark(I haven't included the code to save the checkmark state), if the title's text have change in the main window then it should work.
I will try to fix the translation issue but you can do this to prevent the transaltion load:
Open a terminal and run the command:
scroll down to the end of the text. Then with arrow keys navigate to the line:
and type a "#" in front, to be like this:
Press ctrl+X
You will see this message:
press "y" to save the change to the file and to close the editor.
Then when you run the application next time it should be in english.
EDIT:
I uploaded a newer version in which i fixed(hopefully) the translation and checkbox issues:
https://megashare.megahd.com.br/aoo
You need to run the script not yad itself. The code I posted must be copied to a new file, you can do it from file manager by right click in empty space and choose "create new file -> plain text", or by open any text editor, paste the code and save the file anywhere you want with any name you want. Then go to where you saved it, open a terminal in that folder and run the command:
Code: Select all
chmod +x filename.sh
Then run it with the command:
Code: Select all
./filename.sh
About the installer, since it's installed don't worry about the python packages. It should be in english though. I don't have much experience in coding and python and seems that I didn't implement the transaltion stuff correct. Don't worry for checkmark(I haven't included the code to save the checkmark state), if the title's text have change in the main window then it should work.
I will try to fix the translation issue but you can do this to prevent the transaltion load:
Open a terminal and run the command:
Code: Select all
sudo nano /usr/share/pysnoozeshutdown/ui/mainwindow.py
Code: Select all
translator.load(":ui/resources/translations/el_GR.qm")
Code: Select all
#translator.load(":ui/resources/translations/el_GR.qm")
You will see this message:
Code: Select all
Save modified buffer? (Answering "No" will DISCARD changes.)
Then when you run the application next time it should be in english.
EDIT:
I uploaded a newer version in which i fixed(hopefully) the translation and checkbox issues:
https://megashare.megahd.com.br/aoo
Re: qshutdown doesn't do anything after countdown is over - any alternatives?
About the installer, since it's installed don't worry about the python packages. It should be in english though. I don't have much experience in coding and python and seems that I didn't implement the transaltion stuff correct. Don't worry for checkmark(I haven't included the code to save the checkmark state), if the title's text have change in the main window then it should work.
I will try to fix the translation issue but you can do this to prevent the transaltion load:
Open a terminal and run the command:
scroll down to the end of the text. Then with arrow keys navigate to the line:
and type a "#" in front, to be like this:
Press ctrl+X
You will see this message:
press "y" to save the change to the file and to close the editor.
Then when you run the application next time it should be in english.
EDIT:
I uploaded a newer version in which i fixed(hopefully) the translation and checkbox issues:
https://megashare.megahd.com.br/aoo
[/quote]
Hi, thank you I-don't-know-how-many-times by now, the updated version of your app is working (and it's in English), though instead of hibernation it suspended the laptop, but whatever, that's fine too Haven't tried the other method yet, but I'll try that too for fun.
I will try to fix the translation issue but you can do this to prevent the transaltion load:
Open a terminal and run the command:
Code: Select all
sudo nano /usr/share/pysnoozeshutdown/ui/mainwindow.py
Code: Select all
translator.load(":ui/resources/translations/el_GR.qm")
Code: Select all
#translator.load(":ui/resources/translations/el_GR.qm")
You will see this message:
Code: Select all
Save modified buffer? (Answering "No" will DISCARD changes.)
Then when you run the application next time it should be in english.
EDIT:
I uploaded a newer version in which i fixed(hopefully) the translation and checkbox issues:
https://megashare.megahd.com.br/aoo
[/quote]
Hi, thank you I-don't-know-how-many-times by now, the updated version of your app is working (and it's in English), though instead of hibernation it suspended the laptop, but whatever, that's fine too Haven't tried the other method yet, but I'll try that too for fun.