09-07-2022, 04:18 PM | #136 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
|
09-09-2023, 05:28 PM | #137 |
Zealot
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. |
Advert | |
|
09-10-2023, 09:24 AM | #138 |
Addict
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. |
09-10-2023, 10:24 AM | #139 |
Sigil Developer
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"] 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. Last edited by KevinH; 09-10-2023 at 10:35 AM. |
09-10-2023, 12:10 PM | #140 | |
Zealot
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
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. |
|
Advert | |
|
09-10-2023, 01:46 PM | #141 |
Sigil Developer
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. |
09-10-2023, 01:56 PM | #142 |
Grand Sorcerer
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).
|
09-10-2023, 02:32 PM | #143 |
Zealot
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? |
09-10-2023, 02:37 PM | #144 | |
Zealot
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
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 |
|
09-10-2023, 02:58 PM | #145 |
Zealot
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. |
09-10-2023, 03:18 PM | #146 | |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
09-10-2023, 03:56 PM | #147 | |
Zealot
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
|
|
09-10-2023, 04:06 PM | #148 |
Sigil Developer
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 |
09-10-2023, 04:32 PM | #149 | |
Zealot
Posts: 121
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
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. |
|
09-10-2023, 04:40 PM | #150 |
Sigil Developer
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. |
|
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 |