ShareX / ShareX

ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
https://getsharex.com
GNU General Public License v3.0
27.78k stars 3.08k forks source link

[Guide] Get ShareX up and running on Linux #6531

Open demirdegerli opened 1 year ago

demirdegerli commented 1 year ago

You can follow the steps below until ShareX team releases a native Linux version.

Finally run ShareX from your applications menu.

Troubleshooting & Protips

Tested environments

P.S: Wayland works if you don't use the screenshot functionality.

demirdegerli commented 1 year ago

Dear maintainers, can you pin this issue and keep it open so this guide can help other Linux users until a native Linux version comes out. @Jaex

L1Q commented 1 year ago

What kind of functionality and stability are you experiencing with those steps? In my testing some time ago, even doing some basic UI interactions would crash the app, Screenshots would not work outright and annotations were rendering very slow or incorrect.

demirdegerli commented 1 year ago

What kind of functionality and stability are you experiencing with those steps? In my testing some time ago, even doing some basic UI interactions would crash the app, Screenshots would not work outright and annotations were rendering very slow or incorrect.

When you installed ShareX on Linux? In my testing, all UI interactions works, app doesn't crashing and I'm using ShareX on Linux for 3 weeks. Also I'm not tested the annotations. I'll test and inform you very soon.

demirdegerli commented 1 year ago

What kind of functionality and stability are you experiencing with those steps? In my testing some time ago, even doing some basic UI interactions would crash the app, Screenshots would not work outright and annotations were rendering very slow or incorrect.

When you installed ShareX on Linux? In my testing, all UI interactions works, app doesn't crashing and I'm using ShareX on Linux for 3 weeks. Also I'm not tested the annotations. I'll test and inform you very soon.

Works like a charm. Here are the screenshots:

screenshot

sharextest1

sharextest2

Fedora 36, GNOME, Xorg

L1Q commented 1 year ago

Amazing! Installing dotnet48 did the trick.

Performance is great, image effects and annotation work just fine.

What is still a bit wonky is region capture

Tested ShareX 14.1 Portable with wine-staging 7.17-1 on Manjaro Linux 22.0.0 (KDE 5.25.5 on Xorg)

Thank you for sharing!

Luke-6723 commented 1 year ago

@Jaex reckon you could potentially add this to the guides? I know a lot of linux users who would happily use linux in any shape of form as long as it works

demirdegerli commented 1 year ago

Amazing! Installing dotnet48 did the trick.

Performance is great, image effects and annotation work just fine.

What is still a bit wonky is region capture

* only works on one of my monitors

* only seems to open when I have the debug log opened?

* still allows annotation and even detects window regions correctly!

Tested ShareX 14.1 Portable with wine-staging 7.17-1 on Manjaro Linux 22.0.0 (KDE 5.25.5 on Xorg)

Thank you for sharing!

@L1Q Can you provide the Xorg version by running sudo Xorg -version? I'll add that to tested environments.

L1Q commented 1 year ago
$ sudo Xorg -version
[sudo] password for l1q: 

X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
Current Operating System: Linux l1q-mj 5.19.11-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Sep 23 14:31:33 UTC 2022 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.19-x86_64 root=UUID=ffef6ab0-47f6-4139-b182-fea9e230cf86 rw quiet amdgpu.ppfeaturemask=0xffffffff

Current version of pixman: 0.40.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
SzczurekYT commented 1 year ago

Hello Huge thanks for the guide. I was able to install sharex but there is one issue. I can't get the ctlr + prtscreen shortcut to work. I tried using this script: xdotool key --clearmodifiers --window $( xdotool search --limit 1 --all --pid $( pgrep ShareX ) --name ShareX) "ctrl+Print" Basing on this article. But it's not working. I was able to run this succesfully few times, but no more.

demirdegerli commented 1 year ago

Hello Huge thanks for the guide. I was able to install sharex but there is one issue. I can't get the ctlr + prtscreen shortcut to work. I tried using this script: xdotool key --clearmodifiers --window $( xdotool search --limit 1 --all --pid $( pgrep ShareX ) --name ShareX) "ctrl+Print" Basing on this article. But it's not working. I was able to run this succesfully few times, but no more.

This script only sends a key combo (Ctrl+Print) to ShareX. Make sure you added this shortcut in ShareX settings so it's also handled by ShareX.

ITotalJustice commented 1 year ago

Hi, was anyone able to get audio recording working? For audiosource, i have built-in, monitor and pulseauido. ffmpeg fails to find the audio device.

SzczurekYT commented 1 year ago

Hello Huge thanks for the guide. I was able to install sharex but there is one issue. I can't get the ctlr + prtscreen shortcut to work. I tried using this script: xdotool key --clearmodifiers --window $( xdotool search --limit 1 --all --pid $( pgrep ShareX ) --name ShareX) "ctrl+Print" Basing on this article. But it's not working. I was able to run this succesfully few times, but no more.

This script only sends a key combo (Ctrl+Print) to ShareX. Make sure you add this shortcut in ShareX settings so it's also handled by ShareX.

Ctrl + PrintScreen is the default shortcut for taking a screenshot in sharex. It was set.

McoreD commented 1 year ago

If this works well, we should publish a guideline on this.

Luke-6723 commented 1 year ago

If this works well, we should publish a guideline on this.

I agree, might be worth opening a PR on the Web Repo to document it, might be an idea for you @demirdegerli

demirdegerli commented 1 year ago

If this works well, we should publish a guideline on this.

I agree, might be worth opening a PR on the Web Repo to document it, might be an idea for you @demirdegerli

I maybe will but maintainers don't much care about Linux. Thanks for the suggestion.

SzczurekYT commented 1 year ago

For me it doesn't work well. The shortcuts didn't work, taking a screenshot is laggy and the editor crashed when I tried to do something. (I think it was adding an arrow but I'm not sure).

Exponential-Workload commented 1 year ago

Hello Huge thanks for the guide. I was able to install sharex but there is one issue. I can't get the ctlr + prtscreen shortcut to work. I tried using this script: xdotool key --clearmodifiers --window $( xdotool search --limit 1 --all --pid $( pgrep ShareX ) --name ShareX) "ctrl+Print" Basing on this article. But it's not working. I was able to run this succesfully few times, but no more.

This script only sends a key combo (Ctrl+Print) to ShareX. Make sure you add this shortcut in ShareX settings so it's also handled by ShareX.

Ctrl + PrintScreen is the default shortcut for taking a screenshot in sharex. It was set.

Removing the --name ShareX from the xdotool search command worked for me; xdotool key --window $( xdotool search --limit 1 --all --pid $( pgrep ShareX )) "ctrl+Print"

If that doesn't work for you, you could try looping over the result from xdotool search --all --pid $( pgrep ShareX ) & sending the input to each window:

xdotool search --all --pid $( pgrep ShareX ) > .proclist
while read ln; do xdotool key --window ${ln} "ctrl+Print"; done < .proclist
rm .proclist

A 3rd option would be to use ShareX Command-Line Arguments - which, as an example, can be done by putting

[Desktop Entry]
Name=ShareX Screenshot
Exec=env WINEPREFIX="/home/arch/.wine" wine C:\\\\ProgramData\\\\Microsoft\\\\Windows\\\\Start\\ Menu\\\\Programs\\\\ShareX\\\\ShareX.lnk -RectangleRegion
Type=Application
StartupNotify=true
Path=/home/arch/.wine/dosdevices/c:/Program Files/ShareX
Icon=3853_ShareX.0
StartupWMClass=sharex.exe

in /usr/share/applications/ShareX-Take-Screenshot.desktop, followed by binding the shortcut to gtk-launch ShareX

make sure to replace /home/arch/.wine with your wineprefix

SzczurekYT commented 1 year ago

Thanks for the info, but I moved to Flameshot as it has a native linux support. It's not as powerfull as ShareX but it gets the job done. ShareX just didn't work well on wine (crashes, jitters). But maybe someone else will benefit from this 👍

brezanac commented 1 year ago

Thanks for the info, but I moved to Flameshot as it has a native linux support. It's not as powerfull as ShareX but it gets the job done. ShareX just didn't work well on wine (crashes, jitters). But maybe someone else will benefit from this +1

As much as I wanted ShareX to work properly on Linux (Wine, Crossover etc.) it was simply not stable enough.

So I settled with Shutter, a good native open-sourve alternative with support for annotations, uploads (supports both public and OAuth Imgur) and many other features.

However, it does not support video capture and some other functions ShareX natively has.

But if you just want a quick way to take screenshots, annotate and upload them - Shutter is a veru good alternative to ShareX on Linux.

orchidcnr commented 10 months ago

Wine installion of dotnet 48 doesn't seem to be working on newer versions. Will an installion of dotnet 40 work just as fine?

demirdegerli commented 10 months ago

It's working for me and ShareX requires at least .NET 4.8 AFAIK. You can try anyway.

mariospicross commented 10 months ago

Update (orchidcnr on new account, I lost my login info LMFAO) executing --force in the terminal for the dotnet installation worked perfectly.

demirdegerli commented 10 months ago

Glad to hear

MohaKh1 commented 9 months ago

Update (orchidcnr on new account, I lost my login info LMFAO) executing --force in the terminal for the dotnet installation worked perfectly.

Have you tested the audio capture feature? Mainly what I want to use ShareX for. I can't seem to find alts for linux.

NoelleTGS commented 7 months ago

Has anyone managed to get clipboard copying to work? I have my settings set to copy the image to the clipboard after taking it but it doesn't seem to work.

I'm also unable to get keyboard shortcuts to work unless the main window is open but I'll do some more troubleshooting on that.

SzczurekYT commented 7 months ago

Overall my experience with wine is that clipboard is just totally isolated from the os, and wine keeps it's own clipboard.

rafalohaki commented 5 months ago

THe only thing that keeps me away from using linux distro is lack of native support of sharex for linux

zaczhuozhang commented 5 months ago

THe only thing that keeps me away from using linux distro is lack of native support of sharex for linux

same, call for official Linux support

jp-x-g commented 4 months ago

Me and the boys used to love ShareX back in the day -- and by back in the day I mean 2015 when we all used Micro$haft WinDOZE -- and at that time, word on the street was that, since it was FOSS, it was going to be getting a Linux port any day now. We were young and we were filled with hope and joy and vigor and optimism for a new world of love, of beauty...

It's December 2023. What the hell happened?

whitepawrolls commented 2 months ago

This is not working for me at all on Linux Mint Edge 21.3 fresh install. When I go to install dotnet 48 I get the following error.

This package (dotnet48) is broken in wine-6.0.3. Broken since 5.18. See https://bugs.winehq.org/show_bug.cgi?id=49897 for more info. Use --force to try anyway.

I then tried 4.7 and lower and kept getting checksum errors. Never was able to get beyond that step. X11 info listed below if it helps.

"X.Org X Server 1.21.1.4 X Protocol Version 11, Revision 0 Current Operating System: Linux Minty-Test 6.2.0-33-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 10:33:52 UTC 2 x86_64 Kernel command line: BOOT_IMAGE=/@/boot/vmlinuz-6.2.0-33-generic root=UUID=327006d1-eba9-4185-a65f-f37f3c8b2a15 ro rootflags=subvol=@ quiet splash xorg-server 2:21.1.4-2ubuntu1.7~22.04.8 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.40.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. "

rafalohaki commented 2 months ago

rip

natapereira commented 1 month ago

No linux suport yet? :cry:

rafalohaki commented 1 month ago

No linux suport yet? 😢

maybe in 5 years, there will be alternative for sharex. what i meant. application to easily bind hotkeys, etc and without using scripts, just gui, like a sharex on windows.

myagizmaktav commented 1 month ago

Download from steam with proton. But problem if minimized mod screen shot not working.

whitepawrolls commented 1 month ago

Download from steam with proton. But problem if minimized mod screen shot not working.

Problem with that is you always have to have steam running too. I may experiment with wine on the standalone version later.

myagizmaktav commented 1 month ago

I added sharex lutris version for easy install. it working for now.

https://lutris.net/games/sharex/

myagizmaktav commented 1 month ago

@Jaex Can you handle it pls?

IntNinja commented 1 week ago

Doesn't work on ZorinOS 17.1 i've installed wine wine64 wine32 winbind winetricks. it just crashes whenever i try to take a screenshot or even click on the sharex icon

Register dump:
 rip:00006ffff83319bd rsp:00007fb8b9d0f130 rbp:00007fb8b9d0f320 eflags:00010206 (  R- --  I   - -P- )
 rax:00006ffff83319a0 rbx:00006ffff9a438d2 rcx:00006ffff9a438d2 rdx:0000000006000000
 rsi:00007fb8baa3e710 rdi:00007fb8c1d71f88  r8:0000000000000000  r9:0000000000000006 r10:00006ffff9a43944
 r11:00006ffff9a444d0 r12:00007fffff1a2a18 r13:00007fb8c04ec400 r14:00007fb8c1d70ac0 r15:0000000000000001
Stack dump:
0x007fb8b9d0f130:  0000000000000000 0000000000000000
0x007fb8b9d0f140:  0000000000000000 0000000000000000
0x007fb8b9d0f150:  0000000000000000 0000000000000000
0x007fb8b9d0f160:  0000000000000000 0000000000000000
0x007fb8b9d0f170:  0000000000000000 0000000000000000
0x007fb8b9d0f180:  0000000000000000 0000000000000000
0x007fb8b9d0f190:  0000000000000000 0000000000000000
0x007fb8b9d0f1a0:  0000000000000000 0000000000000000
0x007fb8b9d0f1b0:  00006ffff9a43944 00006ffff9a431a5
0x007fb8b9d0f1c0:  00006ffff9b23d0a 00007fb8baa46740
0x007fb8b9d0f1d0:  00007fffff1a2a18 00007fb8c04ec400
0x007fb8b9d0f1e0:  00007fb8c1d70ac0 00006ffff9b23d0a
Backtrace:
=>0 0x006ffff83319bd DwmIsCompositionEnabled+0x1d(enabled=00006FFFF9A438D2) [./dlls/dwmapi/dwmapi_main.c:48] in dwmapi (0x007fb8b9d0f320)
0x006ffff83319bd DwmIsCompositionEnabled+0x1d [./dlls/dwmapi/dwmapi_main.c:48] in dwmapi: movl $0x00, (%rbx)
Unable to access file './dlls/dwmapi/dwmapi_main.c'
Modules:
Module  Address                                 Debug info      Name (31 modules, 95 for wow64 not listed)
PE                400000-          62e000       Deferred        sharex
PE              10000000-        1012e000       Deferred        sharex.helperslib
PE          7fb87eb10000-    7fb87ed1c000       Deferred        system.data
PE          7fb87ed20000-    7fb87ee0c000       Deferred        system.runtime.serialization
PE          7fb890250000-    7fb890274000       Deferred        system.numerics
PE          7fb891a80000-    7fb891ac0000       Deferred        mono.security
PE          7fb891ad0000-    7fb891af4000       Deferred        system.net.http
PE          7fb891c90000-    7fb891cb8000       Deferred        system.xml.linq
PE          7fb891cc0000-    7fb891d96000       Deferred        renci.sshnet
PE          7fb891da0000-    7fb891e10000       Deferred        fluentftp
PE          7fb891e20000-    7fb891e42000       Deferred        megaapiclient
PE          7fb8b8b90000-    7fb8b8e9e000       Deferred        system.xml
PE          7fb8b90f0000-    7fb8b910a000       Deferred        i18n.west
PE          7fb8b9120000-    7fb8b9130000       Deferred        i18n
PE          7fb8b9410000-    7fb8b945a000       Deferred        system.design
PE          7fb8b9510000-    7fb8b9518000       Deferred        system.componentmodel.typeconverter
PE          7fb8b9540000-    7fb8b9582000       Deferred        sharex.medialib
PE          7fb8b9590000-    7fb8b95a2000       Deferred        sharex.indexerlib
PE          7fb8b95b0000-    7fb8b9652000       Deferred        sharex.screencapturelib
PE          7fb8b9660000-    7fb8b968a000       Deferred        sharex.imageeffectslib
PE          7fb8b9690000-    7fb8b9742000       Deferred        newtonsoft.json
PE          7fb8b9750000-    7fb8b9772000       Deferred        system.io.compression
PE          7fb8ba490000-    7fb8ba5a0000       Deferred        system.core
PE          7fb8bb590000-    7fb8bb854000       Deferred        system
PE          7fb8bb860000-    7fb8bbffa000       Deferred        system.windows.forms
PE          7fb8c0020000-    7fb8c0050000       Deferred        sharex.historylib
PE          7fb8c00a0000-    7fb8c00c6000       Deferred        system.configuration
PE          7fb8c00d0000-    7fb8c00d8000       Deferred        accessibility
PE          7fb8c00e0000-    7fb8c0160000       Deferred        system.drawing
PE          7fb8c0170000-    7fb8c036e000       Deferred        sharex.uploaderslib
PE          7fb8c0510000-    7fb8c098c000       Deferred        mscorlib
Threads:
process  tid      prio    name (all IDs are in hex)
00000038 services.exe
    0000003c    0     
    00000040    0     wine_rpcrt4_server
    0000004c    0     wine_rpcrt4_io
    00000070    0     wine_rpcrt4_io
    000000a0    0     wine_rpcrt4_io
    000000b8    0     wine_rpcrt4_io
    000000cc    0     
    000000e4    0     wine_rpcrt4_io
00000044 winedevice.exe
    00000048    0     
    00000054    0     
    00000058    0     wine_sechost_service
    0000005c    0     
    00000060    0     
    00000064    0     
    000000c4    0     
    000000c8    0     
00000068 winedevice.exe
    0000006c    0     
    00000074    0     
    00000078    0     wine_sechost_service
    0000007c    0     
    00000080    0     
    00000084    0     
    00000098    0     
    0000009c    0     
00000088 plugplay.exe
    0000008c    0     
    000000a4    0     
    000000a8    0     wine_sechost_service
    000000ac    0     wine_rpcrt4_server
00000090 explorer.exe
    00000094    0     
    000000d0    0     
    000000d4    0     wine_rpcrt4_server
000000b0 svchost.exe
    000000b4    0     
    000000bc    0     
    000000c0    0     wine_sechost_service
000000dc rpcss.exe
    000000e0    0     
    000000ec    0     
    000000f0    0     wine_sechost_service
    000000f4    0     wine_rpcrt4_server
    000000f8    0     wine_rpcrt4_server
    000000fc    0     wine_rpcrt4_io
00000104 (D) C:\Program Files\ShareX\ShareX.exe
    00000108    0     
    0000010c    0     SGen worker
    00000110    0     Finalizer
    00000114    0     
    00000118    0     Thread Pool Worker
    0000011c    0     Thread Pool Worker
    00000120    0     Thread Pool Worker
    00000124    0     Thread Pool Worker
    00000128    0     Thread Pool Worker
    0000012c    0     Thread Pool Worker
    00000130    0 <== Thread Pool Worker
    00000134    0     Thread Pool Worker
    00000138    0     Thread Pool Worker
    0000013c    0     wine_threadpool_worker
    00000140    0     wine_threadpool_ioqueue
    00000144    0     wine_rpcrt4_server
    00000148    0     Timer-Scheduler
    0000014c    0     Thread Pool Worker
    00000150    0     Thread Pool I/O Selector
    00000164    0     
0000015c conhost.exe
    00000160    0     
System information:
    Wine build: wine-9.0 (Ubuntu 9.0~repack-4+zorin1)
    Platform: x86_64 (guest: i386)
    Version: Windows 10
    Host system: Linux
    Host version: 6.5.0-21-generic
rafalohaki commented 1 week ago

thats why native version in deb package would be better

Fastball2880 commented 4 days ago

Works with Arch Linux, kernel version 6.8.7. Used the development version of Wine 9.7. I always use the bindings in Windows but in Linux, you can't use them when ShareX windows is closed. You can only use them when you're within ShareX, which is annoying when you're screenshotting games outside the ShareX window.

Used winetricks to install necessary components such as .NET 4.8, and that was it. Expect to break in the future. Hope that ShareX team or any other people will actually port this to Linux.

Update:

After recording a GIF, the ShareX icon will dissapear and ShareX will crash.

Recording is not working, it spits an error while recording. 8rlDMOei01

xPQPmjvyBn

Fastball2880 commented 3 days ago

Another, final, update:

I used the dev build of ShareX (.372) and the recording is fixed! (except that doing it in a full screen will spit out an error)

The binding is now working using the xdotool package, and creating an script then making it as an executable, then binding it with the XFCE keyboard tool. This makes ShareX useful for me. However, I still hope that ShareX will still have a port to Linux in the future.