Skip to main content
Topic: Any application in opposite function but still similar to screen shot (Read 746 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

Any application in opposite function but still similar to screen shot

Any application in opposite function but still similar to screen shot ?

i.e. one that can draw nearly anything on top of screen at any point of time for a while in order user can set its layout before doing the its real snapshot

Re: Any application in opposite function but still similar to screen shot

Reply #1
Any application in opposite function but still similar to screen shot ?
I think you're looking for screengrab.
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: Any application in opposite function but still similar to screen shot

Reply #2
If I'm understanding you correctly this is something I've wanted in the past but didn't find a simple solution to.

I've just had another look and there is a an image viewer program call pqiv https://github.com/phillipberndt/pqiv/

Someone made a pull request to allow new options --keep-above & --click-through
https://github.com/phillipberndt/pqiv/pull/131

This diff did not apply cleanly to the current version of pqiv but I've fixed that.

So I modified the pqiv PKGBUILD to apply the new patch
With the patched pqiv you can use the --keep-above option to keep the image above all windows
Clicking the image removes the decorations. Another click return them and you can use the titlebar to move the image.
The i key remove the 'info' within the image.

I'm not sure this is what you need but I just made it for myself so I might as well share it.

If you want it download both attachments into the same directory and remove the '.txt' from both.
Review the PKGBUILD and patch to check I'm not doing anything nefarious. (I'm not but I'm just some random on the internet).

run
Code: [Select]
makepkg -si

Edit: Wait as I've just tested the downloaded attachments and makepkg didn't like them

Re: Any application in opposite function but still similar to screen shot

Reply #3
Ok No idea what going on with the attachments other than
Quote
==> ERROR: PKGBUILD contains CRLF characters and cannot be sourced.

PKGBUILD
Code: [Select]
# Maintainer: Bruno Pagani <[email protected]>
# Maintainer: Caleb Maclennan <[email protected]>

pkgname=pqiv
pkgver=2.12
pkgrel=5
pkgdesc='Powerful image viewer with minimal UI'
arch=(x86_64)
url="https://github.com/phillipberndt/pqiv"
license=(GPL3)
depends=(gtk3 gdk-pixbuf2 glib2 cairo)
optdepends=(
    'ffmpeg: rudimentary video support'
    'libarchive: archives and cbX comic book support'
    'libspectre: PS/EPS support'
    'libwebp: WebP support'
    'imagemagick: support for various images formats like PSD'
    'poppler-glib: rudimentary PDF support'
)
makedepends=(ffmpeg libarchive libspectre libwebp imagemagick poppler-glib)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
        keep-above.patch)
sha256sums=('1538128c88a70bbad2b83fbde327d83e4df9512a2fb560eaf5eaf1d8df99dbe5'
            '614b0851f36c9365b5e68bbda8138cdd584c7ef4e6e664991631087af1ff1d11')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 < ../keep-above.patch
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --backends-build=shared
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}

keep-above.patch
Code: [Select]
Common subdirectories: a/backends and b/backends
Common subdirectories: a/.github and b/.github
diff '--color=auto' -u a/GNUmakefile b/GNUmakefile
--- a/GNUmakefile 2020-11-29 11:51:17.000000000 +0000
+++ b/GNUmakefile 2022-09-14 14:47:18.675484079 +0100
@@ -96,7 +96,7 @@
 
 # We need X11 to workaround a bug, see http://stackoverflow.com/questions/18647475
 ifeq ($(filter x11, $(shell $(PKG_CONFIG) --errors-to-stdout --variable=target gtk+-$(GTK_VERSION).0; $(PKG_CONFIG) --errors-to-stdout --variable=targets gtk+-$(GTK_VERSION).0)), x11)
- LIBS+=x11
+ LIBS+=x11 xext
 endif
 
 # Add backend-specific libraries and objects
Common subdirectories: a/lib and b/lib
diff '--color=auto' -u a/pqiv.c b/pqiv.c
--- a/pqiv.c 2020-11-29 11:51:17.000000000 +0000
+++ b/pqiv.c 2022-09-14 14:47:54.108817635 +0100
@@ -57,6 +57,7 @@
 #ifdef GDK_WINDOWING_X11
  #include <gdk/gdkx.h>
  #include <X11/Xlib.h>
+ #include <X11/extensions/shape.h>
  #include <X11/Xutil.h>
  #include <cairo/cairo-xlib.h>
 
@@ -293,10 +294,12 @@
 gboolean option_start_fullscreen = FALSE;
 gdouble option_initial_scale = 1.0;
 gboolean option_start_with_slideshow_mode = FALSE;
+gboolean option_click_through = FALSE;
 gboolean option_sort = FALSE;
 enum { NAME, MTIME } option_sort_key = NAME;
 gboolean option_shuffle = FALSE;
 gboolean option_transparent_background = FALSE;
+gboolean option_keep_above = FALSE;
 gboolean option_watch_directories = FALSE;
 gboolean option_wait_for_images_to_appear = FALSE;
 gboolean option_fading = FALSE;
@@ -394,6 +397,7 @@
 // implemented for option parsing.
 GOptionEntry options[] = {
  { "transparent-background", 'c', 0, G_OPTION_ARG_NONE, &option_transparent_background, "Borderless transparent window", NULL },
+ { "keep-above", 0,0, G_OPTION_ARG_NONE, &option_keep_above, "Keep window above others", NULL },
  { "slideshow-interval", 'd', 0, G_OPTION_ARG_DOUBLE, &option_slideshow_interval, "Set slideshow interval", "n" },
  { "fullscreen", 'f', 0, G_OPTION_ARG_NONE, &option_start_fullscreen, "Start in fullscreen mode", NULL },
  { "fade", 'F', 0, G_OPTION_ARG_NONE, (gpointer)&option_fading, "Fade between images", NULL },
@@ -408,6 +412,7 @@
  { "scale-images-up", 't', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &option_scale_level_callback, "Scale images up to fill the whole screen", NULL },
  { "window-title", 'T', 0, G_OPTION_ARG_STRING, &option_window_title, "Set the title of the window. See manpage for available variables.", "TITLE" },
  { "zoom-level", 'z', 0, G_OPTION_ARG_DOUBLE, &option_initial_scale, "Set initial zoom level (1.0 is 100%)", "FLOAT" },
+ { "click-through", 0, 0, G_OPTION_ARG_NONE, &option_click_through, "Window does not accept mouse input", NULL },
 
 #ifndef CONFIGURED_WITHOUT_EXTERNAL_COMMANDS
  { "command-1", '1', 0, G_OPTION_ARG_STRING, &external_image_filter_commands[0], "Bind the external COMMAND to key 1. See manpage for extended usage (commands starting with `>' or `|'). Use 2..9 for further commands.", "COMMAND" },
@@ -6746,6 +6751,20 @@
  }
  #endif
 
+ if(option_click_through) {
+ Display *display = GDK_SCREEN_XDISPLAY(gdk_screen_get_default());
+ unsigned long window_xid = gdk_x11_window_get_xid(gtk_widget_get_window(GTK_WIDGET(main_window)));
+ Region region = XCreateRegion();
+ XRectangle rectangle = { 0, 0, 1, 1 };
+ XUnionRectWithRegion(&rectangle, region, region);
+ XShapeCombineRegion(display, window_xid, ShapeInput, 0, 0, region, ShapeSet);
+ XDestroyRegion(region);
+ }
+
+ if(option_keep_above) {
+ gtk_window_set_keep_above(main_window, TRUE);
+ }
+
  return FALSE;
 }/*}}}*/
 void handle_input_event(guint key_binding_value);
@@ -7026,7 +7045,6 @@
  if(option_transparent_background) {
  gtk_window_set_decorated(main_window, !gtk_window_get_decorated(main_window));
  }
-
  // All other bindings are only handled in fullscreen.
  return FALSE;
  }

Copy and save into appropriately named files.
You'll most likely need to run
Code: [Select]
makepkg -g
first and replace the sha256sums part of the PKGBUILD with the output.

If anyone knows of a ready made package, preferably qt based, that can do this (image, always on top, no decorations) please do let me know. I can't find one.

Re: Any application in opposite function but still similar to screen shot

Reply #4
Ok No idea what going on with the attachments other than

==> ERROR: PKGBUILD contains CRLF characters and cannot be sourced.
Presumably it is a feature that is used in a very specific garage that is known all over the world.

https://stackoverflow.com/questions/10418975/how-to-change-line-ending-settings
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: Any application in opposite function but still similar to screen shot

Reply #5
Presumably it is a feature that is used in a very specific garage that is known all over the world.

https://stackoverflow.com/questions/10418975/how-to-change-line-ending-settings
Who in their right mind uses CRLF to terminate newlines on Linux? Did they create the PKGBUILD file on windows?

Re: Any application in opposite function but still similar to screen shot

Reply #6
Who in their right mind uses CRLF to terminate newlines on Linux? Did they create the PKGBUILD file on windows?
What I guess happens is that the forum software is processing the attachments as they are uploaded, and adding the CRLF ?
The original files were fine on my PC. makepkg worked with them.
Almost as an afterthought I downloaded the attachments and ran makepkg. Then got the error as shown.
So pasted instead.

Re: Any application in opposite function but still similar to screen shot

Reply #7
What I guess happens is that the forum software is processing the attachments as they are uploaded, and adding the CRLF ?
I cannot confirm this. Your attachments work perfectly for me.

However, I find it strange that the forum software does not allow archive formats other than *.zip.
In my attachment is keep-above.patch and modified PKGBUILD.
The finished package is called pqiv-gtk3-2.12-5-x86_64.pkg.tar.zst.
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: Any application in opposite function but still similar to screen shot

Reply #8
I cannot confirm this. Your attachments work perfectly for me.
Fair enough. I didn't look into it. Just downloaded, renamed, then got the error.
The forum limit on extensions allowed does seem a bit odd on a linux forum where many config files etc will not have the desired extensions but it is what it is.