-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable screensaver when playing video #7
Comments
Hello @AntouanK. Are you using Linux? If so, which screensaver are you using? 👍 |
I'm using Antergos, an Arch distro. |
Hello @AntouanK I have put in power management and screensaver disablement while the program runs. 👍 |
@lettier You're the man! I'll try it later today. Many thanks. |
@lettier
Does it make any sense? |
Hello @AntouanK What version of stack do you have? I have verision 1.3.2. Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0 I tried with a fresh clone and ran the following. stack setup
stack build The compilation was successful. Try removing the stack work directory. cd movie-monad
rm -rf .stack-work/
stack clean
stack setup
stack build Alternatively you can try the AppImage. wget https://github.com/lettier/movie-monad/releases/download/0.0.2.0/movie-monad-0.0.2.0-x86_64.AppImage
chmod a+x movie-monad-0.0.2.0-x86_64.AppImage
./movie-monad-0.0.2.0-x86_64.AppImage 👍 |
I tried |
Hello @AntouanK I tried building Movie Monad on a fresh VM using Antergos. After looking around I discovered this obscure fix. Open the following file.
Edit the following (key, value) entries to look like the following.
Once edited, you should be able to build Movie Monad. Here is the complete file.
👍 |
Amazing work, thanks. Instead of
|
Hello @AntouanK Yes I ran across this as well. For earlier versions of GTK+ < 3.22.24, the GObject introspection file incorrectly describes a function's parameter. In 3.22.24 at least, this has been fixed but now breaks backwards compatibility. I will have to open a PR with the bindings Movie Monad uses. In the meantime, you can either
Note that you only have to do one of the following procedures. To downgrade: # Use https://archive.archlinux.org/packages/g/gtk3/gtk3-3.22.16-1-x86_64.pkg.tar.xz if you have 64bit
# Use https://archive.archlinux.org/packages/g/gtk3/gtk3-3.22.16-1-i686.pkg.tar.xz if you have 32bit
sudo pacman -U https://archive.archlinux.org/packages/g/gtk3/gtk3-3.22.16-1-x86_64.pkg.tar.xz
cd movie-monad
stack exec -- ghc-pkg unregister --force haskell-gi
stack clean
stack build To edit the GIR file: sudo cp /usr/share/gir-1.0/Gtk-3.0.gir /usr/share/gir-1.0/Gtk-3.0.gir.bkup
# Replace Vim with your preferred editor
sudo vim /usr/share/gir-1.0/Gtk-3.0.gir Swap out lines 13930 to 13953 <method name="set_image"
c:identifier="gtk_button_set_image"
version="2.6">
<doc xml:space="preserve">Set the image of @button to the given widget. The image will be
displayed if the label text is %NULL or if
#GtkButton:always-show-image is %TRUE. You don’t have to call
gtk_widget_show() on @image yourself.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="button" transfer-ownership="none">
<doc xml:space="preserve">a #GtkButton</doc>
<type name="Button" c:type="GtkButton*"/>
</instance-parameter>
<parameter name="image"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">a widget to set as the image for the button, or %NULL to unset</doc>
<type name="Widget" c:type="GtkWidget*"/>
</parameter>
</parameters>
</method> with <method name="set_image"
c:identifier="gtk_button_set_image"
version="2.6">
<doc xml:space="preserve">Set the image of @button to the given widget. The image will be
displayed if the label text is %NULL or if
#GtkButton:always-show-image is %TRUE. You don’t have to call
gtk_widget_show() on @image yourself.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="button" transfer-ownership="none">
<doc xml:space="preserve">a #GtkButton</doc>
<type name="Button" c:type="GtkButton*"/>
</instance-parameter>
<parameter name="image" transfer-ownership="none">
<doc xml:space="preserve">a widget to set as the image for the button</doc>
<type name="Widget" c:type="GtkWidget*"/>
</parameter>
</parameters>
</method> and run cd movie-monad
stack exec -- ghc-pkg unregister --force haskell-gi
stack clean
stack build To modify Movie Monad's source: cd movie-monad/
# Replace Vim with your preferred editor
vim src/PlayPause.hs Edit line https://github.com/lettier/movie-monad/blob/master/src/PlayPause.hs#L47 to look like setPlayPauseButton playPauseButton playImage (Just pauseImage) False and edit line https://github.com/lettier/movie-monad/blob/master/src/PlayPause.hs#L50 to look like setPlayPauseButton playPauseButton playImage (Just pauseImage) True 👍 |
In order to not break anything else that uses GTK, I'll change the 2 lines in the source code for now. So once it's fixed, I can just |
Hmm, that didn't work. Or I messed something up.
|
Hello @AntouanK I apologize. I had the wrong line numbers. The correct ones are 61 and 64. Here are the correct changes. diff --git a/src/PlayPause.hs b/src/PlayPause.hs
index 5c164fd..af59384 100644
--- a/src/PlayPause.hs
+++ b/src/PlayPause.hs
@@ -58,10 +58,10 @@ setPlayPauseButton ::
Bool ->
IO ()
setPlayPauseButton playPauseButton _ pauseImage True = do
- GI.Gtk.buttonSetImage playPauseButton pauseImage
+ GI.Gtk.buttonSetImage playPauseButton (Just pauseImage)
GI.Gtk.widgetSetTooltipText playPauseButton (Just "Click to pause")
setPlayPauseButton playPauseButton playImage _ False = do
- GI.Gtk.buttonSetImage playPauseButton playImage
+ GI.Gtk.buttonSetImage playPauseButton (Just playImage)
GI.Gtk.widgetSetTooltipText playPauseButton (Just "Click to play") 👍 |
No need to apologise, you gave me probably the best issue answer I've seen in github so far :) So, changed those lines, and all work perfectly. Build done. |
I've noticed that other video players, like vlc, disable somehow the screensaver when playing a video.
Can you do the same on movie-monad?
The text was updated successfully, but these errors were encountered: