diff --git a/README.md b/README.md
index 1e058470..6a9896ec 100644
--- a/README.md
+++ b/README.md
@@ -153,6 +153,14 @@ A systray icon will be in your system's panel while Flameshot is running.
Do a right click on the tray icon and you'll see some menu items to open the configuration window and the information window.
Check out the About window to see all available shortcuts in the graphical capture mode.
+### Usage on Windows
+
+On Windows, `flameshot.exe` will behave as expected for all supported command-line arguments,
+but it will not output any text to the console. This is problematic if, for example, you are
+running `flameshot.exe -h`.
+
+If you require console output, run `flameshot-cli.exe` instead. `flameshot-cli.exe` is a minimal wrapper around `flameshot.exe` that ensures all stdout is captured and output to the console.
+
### CLI configuration
You can use the graphical menu to configure Flameshot, but alternatively you can use your terminal or scripts to do so.
diff --git a/data/translations/Internationalization_it_IT.ts b/data/translations/Internationalization_it_IT.ts
index 8f3de6ea..7cd14502 100644
--- a/data/translations/Internationalization_it_IT.ts
+++ b/data/translations/Internationalization_it_IT.ts
@@ -233,17 +233,17 @@
Quit Capture
-
+ Esci da CatturaAre you sure you want to quit capture?
-
+ Vuoi davvero uscire dall'acquisizione?Do not show this again
-
+ Non mostrare più questo messaggio
@@ -979,12 +979,12 @@ Si prega di risolverli manualmente nel file di configurazione.
Use last region for GUI mode
- Usa l'ultima regione
+ Utilizza l'ultima regione per la modalità GUIUse the last region as the default selection for the next screenshot in GUI mode
- Utilizza l'ultima regione come selezione predefinita per lo screenshot successivo
+ Utilizza l'ultima regione come selezione predefinita per lo screenshot successivo in modalità GUI
@@ -999,12 +999,12 @@ Si prega di risolverli manualmente nel file di configurazione.
Show abort notifications
-
+ Mostra notifiche di interruzioneEnable abort notifications
-
+ Abilita notifiche di interruzione
@@ -1014,12 +1014,12 @@ Si prega di risolverli manualmente nel file di configurazione.
Use grim to capture screenshots
-
+ Usa Grim per catturare screenshotGrim is a wayland only utility to capture screens based on the screencopy protocol. Generally only enable on minimal wayland window managers like sway, hyprland, etc.
-
+ Grim è un'utilità esclusiva di Wayland per catturare schermate basata sul protocollo Screencopy. Generalmente è abilitata solo su window manager Wayland minimali come Sway, Hyprland, ecc.
@@ -1066,42 +1066,42 @@ Si prega di risolverli manualmente nel file di configurazione.
Automatically unload from memory when it is not needed
-
+ Scarica automaticamente dalla memoria quando non è necessarioAutomatically close daemon (background process) when it is not needed
-
+ Chiudere automaticamente il demone (processo in background) quando non è necessarioLaunch in background at startup
-
+ Avvia in background all'avvioLaunch Flameshot daemon (background process) when computer is booted
-
+ Avvia il demone di Flameshot (processo in background) all'avvio del computerAsk before quit capture
-
+ Chiedi prima di uscire dall'acquisizioneShow the confirmation prompt before ESC quit
-
+ Mostra la richiesta di conferma prima di uscire da ESCEnable Copy to clipboard on Double Click
-
+ Abilita Copia negli appunti con doppio clicCopy URL after uploading was successful
-
+ Copia l'URL dopo che il caricamento è riuscito
@@ -1151,7 +1151,7 @@ Si prega di risolverli manualmente nel file di configurazione.
Use lossy JPG format for clipboard (lossless PNG default)
-
+ Utilizza il formato JPG con perdita di dati per gli appunti (il formato predefinito è PNG senza perdita di dati)
@@ -1212,72 +1212,72 @@ Si prega di risolverli manualmente nel file di configurazione.
Milliseconds before geometry display hides; 0 means do not hide
-
+ Millisecondi prima che la visualizzazione della geometria venga nascosta; 0 significa non nascondereSet geometry display timeout (ms)
-
+ Imposta il timeout di visualizzazione della geometria (ms)Selection Geometry Display
-
+ Visualizzazione della geometria di selezioneDisplay Location
-
+ Posizione di visualizzazioneNone
-
+ NessunaTop Left
-
+ In alto a sinistraTop Right
-
+ In alto a destraBottom Left
-
+ In basso a sinistraBottom Right
-
+ In basso a destraCenter
-
+ CentroQuality range of 0-100; Higher number is better quality and larger file size
-
+ Gamma di qualità da 0 a 100; un numero più alto indica una qualità migliore e una dimensione del file maggioreJPEG Quality
-
+ Qualità JPEGReverse arrow
-
+ Freccia inversaDraw the arrow head first
-
+ Disegna prima la punta della freccia
@@ -1656,27 +1656,27 @@ Si prega di risolverli manualmente nel file di configurazione.
Rotate Right
-
+ Ruota a destraRotate Left
-
+ Ruota a sinistraIncrease Opacity
-
+ Aumenta l'opacitàDecrease Opacity
-
+ Diminuisci l'opacitàClose
- Chiudi
+ Chiudi
@@ -1689,7 +1689,7 @@ Si prega di risolverli manualmente nel file di configurazione.
Set Pixelate as the paint tool.
-
+ Imposta Pixelate come strumento di disegno.Set Pixelate as the paint tool
@@ -1725,7 +1725,7 @@ Si prega di risolverli manualmente nel file di configurazione.
Subcommands
-
+ Sottocomandi
@@ -1792,12 +1792,12 @@ Si prega di risolverli manualmente nel file di configurazione.
Capture screenshot of all monitors at the same time.
-
+ Cattura screenshot di tutti i monitor contemporaneamente.Capture a screenshot of the specified monitor.
-
+ Cattura uno screenshot del monitor specificato.
@@ -1857,7 +1857,7 @@ Si prega di risolverli manualmente nel file di configurazione.
Enable or disable the notifications
-
+ Abilitare o disabilitare le notifiche
@@ -2171,22 +2171,22 @@ You may need to escape the '#' sign as in '\#FFF'
The universal wayland screen capture adapter requires Grim as the screen capture component of wayland. If the screen capture component is missing, please install it!
-
+ L'adattatore universale per la cattura dello schermo Wayland richiede Grim come componente di cattura dello schermo di Wayland. Se il componente di cattura dello schermo è mancante, installalo!If the useGrimAdapter setting is not enabled, the dbus protocol will be used. It should be noted that using the dbus protocol under wayland is not recommended. It is recommended to enable the useGrimAdapter setting in flameshot.ini to activate the grim-based general wayland screenshot adapter
-
+ Se l'impostazione useGrimAdapter non è abilitata, verrà utilizzato il protocollo dbus. Si prega di notare che l'utilizzo del protocollo dbus in Wayland non è raccomandato. Si consiglia di abilitare l'impostazione useGrimAdapter in flameshot.ini per attivare l'adattatore generico per screenshot Wayland basato su Grimgrim's screenshot component is implemented based on wlroots, it may not be used in GNOME or similar desktop environments
-
+ Il componente screenshot di grim è implementato in base a wlroots, non può essere utilizzato in GNOME o ambienti desktop similiUnable to detect desktop environment (GNOME? KDE? Qile? Sway? ...)
-
+ Impossibile rilevare l'ambiente desktop (GNOME? KDE? Qile? Sway? ...)
@@ -2295,22 +2295,22 @@ You may need to escape the '#' sign as in '\#FFF'
Symmetrically decrease width by 2px
-
+ Ridurre simmetricamente la larghezza di 2pxSymmetrically increase width by 2px
-
+ Aumentare simmetricamente la larghezza di 2pxSymmetrically increase height by 2px
-
+ Aumentare simmetricamente l'altezza di 2pxSymmetrically decrease height by 2px
-
+ Ridurre simmetricamente l'altezza di 2px
@@ -2345,12 +2345,12 @@ You may need to escape the '#' sign as in '\#FFF'
Delete selected drawn object
-
+ Elimina l'oggetto disegnato selezionatoCancel current selection
-
+ Annulla la selezione correnteDelete current tool
@@ -2399,7 +2399,7 @@ You may need to escape the '#' sign as in '\#FFF'
Display grid
-
+ Griglia di visualizzazione
@@ -2655,7 +2655,7 @@ You may need to escape the '#' sign as in '\#FFF'
&Open Save Path
-
+ &Apri percorso di salvataggio
diff --git a/data/translations/Internationalization_th.ts b/data/translations/Internationalization_th.ts
index 59b13fb1..b1b9df72 100644
--- a/data/translations/Internationalization_th.ts
+++ b/data/translations/Internationalization_th.ts
@@ -6,22 +6,22 @@
Add New
-
+ เพิ่มใหม่Move Up
-
+ เลื่อนขึ้นMove Down
-
+ เลื่อนลงRemove
-
+ ลบ
@@ -29,12 +29,12 @@
Accept
-
+ ยอมรับAccept the capture
-
+ ยอมรับการจับภาพ
@@ -42,12 +42,12 @@
App Launcher
-
+ ตัวเปิดแอปChoose an app to open the capture
-
+ เลือกแอปเพื่อเปิดการจับภาพ
@@ -55,33 +55,33 @@
Open With
-
+ เปิดด้วยLaunch in terminal
-
+ เปิดในเทอร์มินัลKeep open after selection
-
+ เปิดต่อไปหลังจากเลือกแล้วError
-
+ ผิดพลาดUnable to launch in terminal.
-
+ ไม่สามารถเปิดในเทอร์มินัลได้Unable to write in
-
+ ไม่สามารถเขียนได้
@@ -89,12 +89,12 @@
Arrow
-
+ ลูกศรSet the Arrow as the paint tool
-
+ ตั้งค่าลูกศรเป็นเครื่องมือระบายสี
@@ -117,27 +117,27 @@
Rectangular Region
-
+ บริเวณสี่เหลี่ยมผืนผ้าFull Screen (Current Display)
-
+ เต็มจอ (จอแสดงผลปัจจุบัน)Full Screen (All Monitors)
-
+ เต็มจอ (ทุกจอ)No Delay
-
+ หน่วงเวลา second
-
+ วินาที
@@ -146,7 +146,7 @@
seconds
-
+ วินาที
@@ -154,7 +154,7 @@
Take new screenshot
-
+ ถ่ายภาพหน้าจอใหม่
@@ -162,7 +162,7 @@
Area:
-
+ พื้นที่:
@@ -170,7 +170,7 @@
Capture Launcher
-
+ ตัวเรียกใช้การจับภาพ
@@ -178,7 +178,7 @@
TextLabel
-
+ ป้ายข้อความ
@@ -186,7 +186,7 @@
Capture Mode
-
+ โหมดจับภาพ
@@ -194,7 +194,7 @@
Delay:
-
+ หน่วงเวลา:
@@ -202,7 +202,7 @@
WxH+x+y
-
+ กว้าง×สูง×ลึก×ยาว
@@ -211,62 +211,62 @@
Unable to capture screenImpossible capturar la pantalla
-
+ ไม่สามารถจับภาพหน้าจอได้Mouse
-
+ เม้าส์Select screenshot area
-
+ เลือกพื้นที่จับภาพหน้าจอMouse Wheel
-
+ ล้อเลื่อนของเมาส์Change tool size
-
+ เปลี่ยนขนาดเครื่องมือRight Click
-
+ คลิกขวาShow color picker
-
+ แสดงตัวเลือกสีOpen side panel
-
+ เปิดแผงด้านข้างEsc
-
+ EscExit
-
+ ออกFlameshot has lost focus. Keyboard shortcuts won't work until you click somewhere.
-
+ Flameshot เสียโฟกัส แป้นพิมพ์ลัดจะไม่ทำงานจนกว่าคุณจะคลิกที่ใดที่หนึ่งConfiguration error resolved. Launch `flameshot gui` again to apply it.
-
+ ผิดพลาดในการกำหนดค่าที่แก้ไขแล้ว เปิด `flameshot gui` อีกครั้งเพื่อใช้งานSelect an area with the mouse, or press Esc to exit.
@@ -283,7 +283,7 @@ Premeu Espai per obrir el calaix lateral.
Tool Settings
-
+ ตั้งค่าเครื่องมือ
@@ -296,7 +296,7 @@ Premeu Espai per obrir el calaix lateral.
Add an autoincrementing counter bubble
-
+ เพิ่มตัวนับฟองแบบเพิ่มอัตโนมัติ
@@ -304,12 +304,12 @@ Premeu Espai per obrir el calaix lateral.
Circle
-
+ วงกลมSet the Circle as the paint tool
-
+ ตั้งวงกลมเป็นเครื่องมือระบายสี
@@ -320,7 +320,7 @@ Premeu Espai per obrir el calaix lateral.
Select Color
-
+ เลือกสี
@@ -328,7 +328,7 @@ Premeu Espai per obrir el calaix lateral.
Saturation
-
+ ความอิ่มตัว
@@ -336,7 +336,7 @@ Premeu Espai per obrir el calaix lateral.
Hue
-
+ สีสัน
@@ -344,7 +344,7 @@ Premeu Espai per obrir el calaix lateral.
Hex
-
+ Hex
@@ -352,7 +352,7 @@ Premeu Espai per obrir el calaix lateral.
Blue
-
+ สีฟ้า
@@ -360,7 +360,7 @@ Premeu Espai per obrir el calaix lateral.
Value
-
+ ค่า
@@ -368,7 +368,7 @@ Premeu Espai per obrir el calaix lateral.
Green
-
+ สีเขียว
@@ -376,7 +376,7 @@ Premeu Espai per obrir el calaix lateral.
Alpha
-
+ อัลฟ่า
@@ -384,7 +384,7 @@ Premeu Espai per obrir el calaix lateral.
Red
-
+ สีแดง
@@ -392,7 +392,7 @@ Premeu Espai per obrir el calaix lateral.
Accept color
-
+ ยอมรับสี
@@ -795,17 +795,17 @@ Please solve them manually in the configuration file.
Error
-
+ ผิดพลาดUnable to close active modal widgets
-
+ ไม่สามารถปิดวิดเจ็ตโมดอลที่ใช้งานได้URL copied to clipboard.
-
+ คัดลอก URL ไปยังคลิปบอร์ด
@@ -813,22 +813,22 @@ Please solve them manually in the configuration file.
New version %1 is available
-
+ เวอร์ชันใหม่ %1 พร้อมให้บริการแล้วYou have the latest version
-
+ คุณมีเวอร์ชั่นล่าสุดFailed to get information about the latest version.
-
+ ไม่สามารถรับข้อมูลเกี่ยวกับเวอร์ชั่นล่าสุดได้Unable to connect via DBus
-
+ ไม่สามารถเชื่อมต่อผ่าน DBus ได้
@@ -904,7 +904,7 @@ Please solve them manually in the configuration file.
Import
-
+ นำเข้า
@@ -912,38 +912,38 @@ Please solve them manually in the configuration file.
Error
-
+ ผิดพลาดUnable to read file.
-
+ ไม่สามารถอ่านไฟล์ได้Unable to write file.
-
+ ไม่สามารถเขียนไฟล์ได้Save File
-
+ บันทึกไฟล์Confirm Reset
-
+ ยืนยันการรีเซ็ตAre you sure you want to reset the configuration?
-
+ คุณแน่ใจว่าต้องการรีเซ็ตการกำหนดค่าหรือไม่?Show help message
-
+ แสดงข้อความช่วยเหลือShow the help message at the beginning in the capture mode.
@@ -952,7 +952,7 @@ Please solve them manually in the configuration file.
Show the side panel button
-
+ แสดงแผงปุ่มด้านข้างShow the side panel toggle button in the capture mode.
@@ -961,12 +961,12 @@ Please solve them manually in the configuration file.
Show desktop notifications
-
+ แสดงแจ้งเตือนบนเดสก์ท็อปShow tray icon
-
+ แสดงถาดไอคอนShow the systemtray icon
@@ -975,32 +975,32 @@ Please solve them manually in the configuration file.
Confirmation required to delete screenshot from the latest uploads
-
+ จำเป็นต้องมีการยืนยันลบภาพหน้าจอจากการอัพโหลดล่าสุดConfiguration File
-
+ ไฟล์การกำหนดค่าExport
-
+ ส่งออกReset
-
+ รีเซ็ตAutomatic check for updates
-
+ ตรวจสอบการอัปเดตอัตโนมัติAllow multiple flameshot GUI instances simultaneously
-
+ อนุญาตให้มีอินสแตนซ์ GUI ของ Flameshot หลายรายการพร้อมกันThis allows you to take screenshots of flameshot itself for example.
@@ -1010,12 +1010,12 @@ Please solve them manually in the configuration file.
Automatically close daemon when it is not needed
-
+ ปิด Daemon โดยอัตโนมัติเมื่อไม่จำเป็นLaunch at startup
-
+ เปิดเมื่อเริ่มต้นLaunch Flameshot
@@ -1024,17 +1024,17 @@ Please solve them manually in the configuration file.
Show welcome message on launch
-
+ แสดงข้อความต้อนรับเมื่อเปิดโปรแกรมUse large predefined color palette
-
+ ใช้จานสีที่กำหนดไว้ล่วงหน้าขนาดใหญ่Copy URL after upload
-
+ คัดลอก URL หลังจากอัพโหลดCopy URL and close window after upload
@@ -1043,7 +1043,7 @@ Please solve them manually in the configuration file.
Save image after copy
-
+ บันทึกภาพหลังการคัดลอกSave image file after copying it
@@ -1052,7 +1052,7 @@ Please solve them manually in the configuration file.
Show the help message at the beginning in the capture mode
-
+ แสดงข้อความช่วยเหลือในตอนเริ่มโปรแกรมในโหมดจับภาพ
@@ -1067,92 +1067,92 @@ Please solve them manually in the configuration file.
Show the side panel toggle button in the capture mode
-
+ แสดงปุ่มสลับแผงด้านข้างในโหมดถ่ายภาพEnable desktop notifications
-
+ เปิดใช้งานการแจ้งเตือนบนเดสก์ท็อปShow icon in the system tray
-
+ แสดงไอคอนในถาดระบบAsk for confirmation to delete screenshot from the latest uploads
-
+ ขอคำยืนยันการลบภาพหน้าจอจากการอัพโหลดล่าสุดCheck for updates automatically
-
+ ตรวจสอบการอัปเดตโดยอัตโนมัติThis allows you to take screenshots of Flameshot itself for example
-
+ สิ่งนี้ทำให้คุณสามารถจับภาพหน้าจอของ Flameshot ได้ ตัวอย่างเช่นLaunch Flameshot daemon when computer is booted
-
+ เปิดใช้งาน Daemon Flameshot เมื่อบูตคอมพิวเตอร์แล้วShow the welcome message box in the middle of the screen while taking a screenshot
-
+ แสดงกล่องข้อความต้อนรับตรงกลางหน้าจอขณะทำการจับภาพหน้าจอUse a large predefined color palette
-
+ ใช้สีที่กำหนดไว้ล่วงหน้าขนาดใหญ่Copy on double click
-
+ คัดลอกเมื่อดับเบิลคลิกEnable Copy on Double Click
-
+ เปิดใช้งานการคัดลอกเมื่อดับเบิลคลิกCopy URL and close window after uploading was successful
-
+ คัดลอก URL และปิดหน้าต่างหลังจากการอัพโหลดสำเร็จAfter copying the screenshot, save it to a file as well
-
+ หลังจากคัดลอกภาพหน้าจอแล้ว ให้บันทึกลงในไฟล์ด้วยSave Path
-
+ เส้นทางบันทึกChange...
-
+ เปลี่ยน...Use fixed path for screenshots to save
-
+ ใช้เส้นทางคงที่สำหรับบันทึกภาพหน้าจอPreferred save file extension:
-
+ นามสกุลไฟล์ที่ต้องการบันทึก:Latest Uploads Max Size
-
+ ขนาดสูงสุดของการอัพโหลดล่าสุด
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 200ecb7e..f22795e8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -74,6 +74,13 @@ if(FLAMESHOT_ICON)
endif()
if (WIN32)
+ add_executable(flameshot-cli)
+ target_sources(
+ flameshot-cli
+ PRIVATE
+ windows-cli.cpp)
+ set_target_properties(flameshot-cli PROPERTIES OUTPUT_NAME "flameshot-cli")
+ target_link_options(flameshot-cli PRIVATE /SUBSYSTEM:CONSOLE)
set_property(TARGET flameshot PROPERTY WIN32_EXECUTABLE true)
if (MSVC)
target_compile_options(flameshot PRIVATE /source-charset:utf-8)
@@ -322,6 +329,10 @@ install(TARGETS flameshot
EXPORT flameshot-targets
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+if (WIN32)
+ install(TARGETS flameshot-cli
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif ()
if (UNIX)
# Install desktop files, completion and dbus files
diff --git a/src/main.cpp b/src/main.cpp
index ac58e4b1..b54f64ce 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -148,7 +148,6 @@ int main(int argc, char* argv[])
return qApp->exec();
}
-#if !defined(Q_OS_WIN)
/*--------------|
* CLI parsing |
* ------------*/
@@ -573,6 +572,5 @@ int main(int argc, char* argv[])
}
finish:
-#endif
return 0;
}
diff --git a/src/windows-cli.cpp b/src/windows-cli.cpp
new file mode 100644
index 00000000..60773b63
--- /dev/null
+++ b/src/windows-cli.cpp
@@ -0,0 +1,69 @@
+#include
+#include
+
+std::wstring joinArgs(int argc, wchar_t* argv[])
+{
+ std::wstring result;
+ for (int i = 1; i < argc; ++i) {
+ if (i > 1) {
+ result += L" ";
+ }
+ result += argv[i];
+ }
+ return result;
+}
+
+void CallFlameshot(const std::wstring args, bool wait)
+{
+ // generate full path for flameshot executable
+ wchar_t path[MAX_PATH];
+ int pathLength = GetModuleFileNameW(NULL, path, MAX_PATH);
+ std::wstring pathstring(path);
+
+ // Find the last backslash to isolate the filename
+ size_t lastBackslash = pathstring.find_last_of(L'\\');
+ std::wstring directory = (lastBackslash != std::wstring::npos)
+ ? pathstring.substr(0, lastBackslash + 1)
+ : L"";
+
+ // generate command string
+ // note: binary path placed within quotes in case of spaces in path
+ int cmdSize = 32 + sizeof(directory) + sizeof(args);
+ wchar_t* cmd = (wchar_t*)malloc(sizeof(wchar_t) * cmdSize);
+ swprintf(cmd,
+ cmdSize,
+ L"\"%s\\flameshot.exe\" %s",
+ directory.c_str(),
+ args.c_str());
+ // call subprocess
+ FILE* stream = _wpopen(cmd, L"r");
+ free(cmd);
+ if (wait) {
+ if (stream) {
+ const int MAX_BUFFER = 2048;
+ char buffer[MAX_BUFFER];
+ while (!feof(stream)) {
+ if (fgets(buffer, MAX_BUFFER, stream) != NULL) {
+ std::cout << buffer;
+ }
+ }
+ }
+ _pclose(stream);
+ }
+ return;
+}
+
+// Console 'wrapper' for flameshot on windows
+int wmain(int argc, wchar_t* argv[])
+{
+ // if no args, do not wait for stdout
+ if (argc == 1) {
+ std::cout << "Starting flameshot in daemon mode" << std::endl;
+ CallFlameshot(L"", false);
+ } else {
+ std::wstring argString = joinArgs(argc, argv);
+ CallFlameshot(argString, true);
+ }
+ std::cout.flush();
+ return 0;
+}