Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-07-2022, 04:18 PM   #136
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
It still works for me on Arch with Qt5 Sigil 1.9.20.
It also still works for me on Arch with Qt 6.3.1 Sigil 1.9.20.
My DE is XFCE 4.16 and my distro is EndeavourOS.
Doitsu is offline   Reply With Quote
Old 09-09-2023, 05:28 PM   #137
philja
Zealot
philja began at the beginning.
 
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
I've been investigating use of svg images and came across this plugin which I've installed in Sigil 2.0.1 in linux UbuntuStudio 22.04 LTS.

I can't get the COPY function to paste into an existing page. The user guide mentions a procedure for Sigil < 1.0.0 but for higher versions, nothing is said about the copy/paste into an existing page. Looking into this thread, I see this problem has been mentioned before and I found that others have mentioned the workaround that I found - use the plugin to insert a new page, copy and paste the svg code where I wanted it and then delete the unwanted page. But I cannot help but think that is not the way it was intended.

Looking at my OS clipboard, the plugin doesn't write anything there when I use the COPY function. I haven't been able to understand what I need to do to get it working. Help, please.
philja is offline   Reply With Quote
Advert
Old 09-10-2023, 09:24 AM   #138
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
I downloaded the latest version of Sigil (version2) to test the plugin and it is not giving any problems. I clicked the Copy button after selecting an image and then I pasted the resulting code into a Sigil epub where the code appears as expected. I am using Windows 11 for the test.

I don't know why the plugin is not working for others.
CalibUser is offline   Reply With Quote
Old 09-10-2023, 10:24 AM   #139
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Here is the snippet from that plugin that does the work:
Code:
def CopyToClipboard(self, txt):
		"""
		Puts the text in txt on the clipboard
		Based on code from:
		https://www.programcreek.com/python/?CodeExample=copy+to+clipboard
		"""

		if platform.system() == 'Darwin':
			command = ["pbcopy"]
		elif platform.system() == 'Windows':
			command=["clip"]
		elif platform.system() == "Linux":
			command = ["xsel", "-b", "-i"]
Are you by chance using wayland instead of X11 on your linux box? If so, and if there is a wayland equivalent you could use instead, you might need to tweak these lines. From a google search I think wl-copy and or wl-clipboard might do what you want on wayland.

FWIW, wayland is not yet a choice I would make. Everytime I try it things break sometimes in horrible fashion. If I need to get real work done, turning off wayland on boot is the first thing I do. It is normally okay for playing around but not quite there yet.
Worse yet wayland's implementation varies by desktop chosen (kde vs ...) and so is non-standardized.




Quote:
Originally Posted by philja View Post
...
Looking at my OS clipboard, the plugin doesn't write anything there when I use the COPY function. I haven't been able to understand what I need to do to get it working. Help, please.

Last edited by KevinH; 09-10-2023 at 10:35 AM.
KevinH is offline   Reply With Quote
Old 09-10-2023, 12:10 PM   #140
philja
Zealot
philja began at the beginning.
 
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Are you by chance using wayland instead of X11 on your linux box? If so, and if there is a wayland equivalent you could use instead, you might need to tweak these lines. From a google search I think wl-copy and or wl-clipboard might do what you want on wayland.

FWIW, wayland is not yet a choice I would make. Everytime I try it things break sometimes in horrible fashion. If I need to get real work done, turning off wayland on boot is the first thing I do. It is normally okay for playing around but not quite there yet.
Worse yet wayland's implementation varies by desktop chosen (kde vs ...) and so is non-standardized.
When I upgraded to UbuntuStudio 22.04 last year, I found the devs had abandoned XFCE in favour of KDE Plasma. This did cause me a load of problems initially which I found was due to Wayland not playing nicely with my Nvidia graphics card.

My solution was to remove the Nvidia card and resort to the motherboard's onboard graphics chip and this enabled me to use the X server. Since then I haven't had any real problem. I've gotten used to KDE Plasma but don't see any real advantages over XFCE, just some differences that took a little while to get used to.

I've found that bit of code you referred to. It certainly doesn't put anything on my clipboard when I use the plugins 'Copy' button and I lack the competence to work out why or to make a modification.

I do have xsel utility (but not wl-copy or wl-clipboard) and consulting the manpage shows that -b writes to clipboard and -i takes the input. But that doesn't seem to be working.

If I use the plugin's Insert facility, that works and when I do a ctrl-C on the svg code, it goes to my clipboard ok and I can paste it wherever I want it.
philja is offline   Reply With Quote
Advert
Old 09-10-2023, 01:46 PM   #141
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
XServer? Did you disable wayland then?

KDEPlasma will allow you to use X11 or wayland from the login screen. My guess is you are still using Wayland as your display controller not X.
KevinH is offline   Reply With Quote
Old 09-10-2023, 01:56 PM   #142
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The plugin isn't working for me at all on my Archlinux box. The images selected do not get loaded into the widget. So the Copy button code believes there's no internal or external image selected. All I get is a warning that nothing has been selected (even though it has).
DiapDealer is offline   Reply With Quote
Old 09-10-2023, 02:32 PM   #143
philja
Zealot
philja began at the beginning.
 
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
I've run some checks on my W10 box - it was running Sigil 1.9.30 with a version of QT5 and the InsertImageSVG plugin worked in all the modes but Sigil wouldn't display the images. And I tried with jpgs and pngs but every time I just got a generic image icon displayed.

So I moved Sigil up to V2.0.1 and I see it comes with Qt6.5.2. But the behaviour was the same - the plugin copied to clipboard ok or inserted a new file but the images wouldn't display inside the <svg> tags in Sigil.

Back in my linux box, I see Sigil 2.0.1 only has QT 5.15.10. Is that because I have a flatpack version installed in order to keep up with the latest version of Sigil without having to build it myself?

But Sigil in the linux box does display the pngs, jpgs and gifs correctly inside the <svg> tags although nothing seems to get copied to the clipboard.

So the new question is why the images inside the <svg> tags display ok in the linux box but not in the W10 box with the same Sigil version although the Qt is more up to date in the W10 box?
philja is offline   Reply With Quote
Old 09-10-2023, 02:37 PM   #144
philja
Zealot
philja began at the beginning.
 
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally Posted by KevinH View Post
XServer? Did you disable wayland then?

KDEPlasma will allow you to use X11 or wayland from the login screen. My guess is you are still using Wayland as your display controller not X.
Honest answer is I don't know. The troubles were back in mid 2022 and caused repeated lockups. Discussion on a Ubuntu forum got me through that period with the solution I mentioned - removing the Nvidia card. I never see any boot-time option to select wayland or X11 and I boot up fresh every day.

I just checked how to differentiate: I ran xdpyinfo and got lots of stuff which I wouldn't get with wayland (so it seems) and then I ran :

echo $XDG_SESSION_TYPE

which returned x11.

So it does look like I'm using x11 and not wayland.

Last edited by philja; 09-10-2023 at 03:57 PM. Reason: to eliminate a surplus post
philja is offline   Reply With Quote
Old 09-10-2023, 02:58 PM   #145
philja
Zealot
philja began at the beginning.
 
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
I ran :

echo $XDG_SESSION_TYPE

which returned x11.

So it does look like I'm using x11 and not wayland.

Last edited by philja; 09-10-2023 at 04:04 PM.
philja is offline   Reply With Quote
Old 09-10-2023, 03:18 PM   #146
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Back in my linux box, I see Sigil 2.0.1 only has QT 5.15.10. Is that because I have a flatpack version installed in order to keep up with the latest version of Sigil without having to build it myself?
I have no idea about Flatpak, but even Archlinux is delivering Sigil 2.0.1 with Qt5.15. The choice is theirs. We've given them the ability/instructions to build their Sigil package with Qt6, but they've chosen not to. Perhaps the Flathub maintainers have chosen to do the same. I've frankly given up trying to influence repo maintainers. They're going to do what they're going to do.
DiapDealer is offline   Reply With Quote
Old 09-10-2023, 03:56 PM   #147
philja
Zealot
philja began at the beginning.
 
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
I have no idea about Flatpak, but even Archlinux is delivering Sigil 2.0.1 with Qt5.15. The choice is theirs. We've given them the ability/instructions to build their Sigil package with Qt6, but they've chosen not to. Perhaps the Flathub maintainers have chosen to do the same. I've frankly given up trying to influence repo maintainers. They're going to do what they're going to do.
Well that seems to be good news. Either Qt5.15 or Qt6 will work ok.
philja is offline   Reply With Quote
Old 09-10-2023, 04:06 PM   #148
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
So it seems xsel and xclip are not even installed by default anymore for some strange reason.

Here is what I did to test, after opening a terminal:

which xsel

# nothing found

#installed xclip and xsel tools
sudo pacman -S xclip xsel

# made sure xsel worked now
echo "hello" | xsel -ib

Then opened my favourite editor and hit paste:

emacs junk.txt

And sure enough "hello" appeared.

So it appears you can get this to work but you just need to install xclip and xsel if you are running X11 and not wayland at least on a recent Linux like Arch or Manjaro
KevinH is offline   Reply With Quote
Old 09-10-2023, 04:32 PM   #149
philja
Zealot
philja began at the beginning.
 
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally Posted by KevinH View Post
So it seems xsel and xclip are not even installed by default anymore for some strange reason.

Here is what I did to test, after opening a terminal:

which xsel

# nothing found

#installed xclip and xsel tools
sudo pacman -S xclip xsel

# made sure xsel worked now
echo "hello" | xsel -ib

Then opened my favourite editor and hit paste:

emacs junk.txt

And sure enough "hello" appeared.

So it appears you can get this to work but you just need to install xclip and xsel if you are running X11 and not wayland at least on a recent Linux like Arch or Manjaro
I had already checked xsel and it was installed. But xclip wasn't. I've installed it and tried your little 'hello' test and sure enough it goes to the clipboard for pasting.

But that hasn't made any difference to the InsertImageSVG plugin in my linux. Its 'Copy' function does nothing. 'Insert' works fine and I can copy with Ctrl-C from the page inserted by the plugin and then paste it anywhere in any page I wish - and see it ok in the clipboard.
philja is offline   Reply With Quote
Old 09-10-2023, 04:40 PM   #150
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
I think "xclip" is the X clipboard and xsel copy selections to it (or in this case pipes things to it).

You got me then. Not sure what is going on. I will fire up my Manjaro box and see if I can recreate what you are seeing with this plugin.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrap in SVG plugin? gezginrocker Plugins 18 07-05-2015 12:20 AM
svg image on top of a background png image roger64 ePub 25 04-24-2015 11:00 AM
Display of a png image linked to a svg image roger64 Editor 6 03-13-2015 06:21 AM
Image wrap test Jellby ePub 15 05-04-2011 02:30 PM
Combining blockquote with image wrap WRB Sigil 1 02-12-2011 07:46 PM


All times are GMT -4. The time now is 02:42 AM.


MobileRead.com is a privately owned, operated and funded community.