Francesco149 / sharenix

A ShareX clone for Linux and FreeBSD.
GNU General Public License v3.0
588 stars 35 forks source link

Full screen capture doesn't work on ubuntu 17.10 #24

Closed duncte123 closed 6 years ago

duncte123 commented 6 years ago

my console:

duncte123@duncte123:~$ sharenix -m="fs" -n

(sharenix:2383): GModule-CRITICAL **: g_module_symbol: assertion 'module != NULL' failed

(sharenix:2383): GModule-CRITICAL **: g_module_close: assertion 'module != NULL' failed

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

(sharenix:2383): GModule-CRITICAL **: g_module_symbol: assertion 'module != NULL' failed

(sharenix:2383): GModule-CRITICAL **: g_module_close: assertion 'module != NULL' failed
Gtk-Message: Failed to load module "canberra-gtk-module"
Taking screenshot...
BadMatch {NiceName: Match, Sequence: 3, BadValue: 668, MinorOpcode: 0, MajorOpcode: 73}
duncte123@duncte123:~$ 

Even though it says taking screenshot nothing happens

window and section capture work fine (picture was made via section capture) yo3c6b 1

Francesco149 commented 6 years ago

the built in screenshot function relies on X, cloud it be that your ubuntu is running wayland?

I'll look into it, for now you can work around with by making a script like sharenix-section but for fullscreen, like so (call it sharenix-full or something):

#!/bin/bash

sleep 0.2s

if command -v xfce4-screenshooter > /dev/null 2>&1; then
    xfce4-screenshooter -f -o "sharenix -n"
    exit $?
fi

# some implementations of mktemp (such as busybox's) don't allow
# extensions at the end of the template so we rename the file

sharenixtmp=$(mktemp /tmp/nicememe.XXXXXXXXXXXXXXXXXXX)
mv "$sharenixtmp" "$sharenixtmp.png"
sharenixtmp="$sharenixtmp.png"

if command -v gnome-screenshot > /dev/null 2>&1; then
    gnome-screenshot -f $sharenixtmp || exit $?
elif command -v scrot > /dev/null 2>&1; then
    scrot $sharenixtmp || exit $?
else
    echo "Couldn't find scrot, gnome-screenshot or " \
         "xfce4-screenshooter."
    echo "Please install either of them and try again"
    exit 1
fi

# check file size (0b means that gnome-screenshot was cancelled)
sharenixtmpsize=$(wc -c <"$sharenixtmp")

if [ $sharenixtmpsize != 0 ]; then
    sharenix -n $sharenixtmp
    exit $?
fi

echo "Screenshot canceled"
exit 1
duncte123 commented 6 years ago

this works perfectly, thanks

and yes I was on wayland, even though switching caused an error to pop up