From 00035b1309ec930d6877c064f67aa7e8a71cadf8 Mon Sep 17 00:00:00 2001 From: Mehrad Mahmoudian Date: Sat, 11 Dec 2021 01:42:16 +0200 Subject: [PATCH 1/5] Adds links to sponsors in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a12d4ab9d..a01f81f2b5 100644 --- a/README.md +++ b/README.md @@ -497,6 +497,6 @@ Thanks to those who have shown interest in the early development process: - ismatori Thanks to sponsors: -- Namecheap -- JetBrains -- SignPath +- [Namecheap](https://www.namecheap.com/) +- [JetBrains](https://www.jetbrains.com/) +- [SignPath](https://signpath.io/) From 045dea0236c9ec1eee8866be39aa3f685d7c1180 Mon Sep 17 00:00:00 2001 From: Mehrad Mahmoudian Date: Sat, 11 Dec 2021 01:42:47 +0200 Subject: [PATCH 2/5] Adds AnonAddy to the sponsor list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a01f81f2b5..dbac9b3b24 100644 --- a/README.md +++ b/README.md @@ -500,3 +500,4 @@ Thanks to sponsors: - [Namecheap](https://www.namecheap.com/) - [JetBrains](https://www.jetbrains.com/) - [SignPath](https://signpath.io/) +- [AnonAddy](https://anonaddy.com) From a1586613442c15e15dd81ae3ee9788ef5b259d35 Mon Sep 17 00:00:00 2001 From: Mehrad Mahmoudian Date: Sun, 6 Feb 2022 21:26:16 +0200 Subject: [PATCH 3/5] adds a more comprehensive zsh completion --- .../{flameshot.bash_zsh => flameshot.bash} | 0 data/shell-completion/flameshot.zsh | 156 ++++++++++++++++++ 2 files changed, 156 insertions(+) rename data/shell-completion/{flameshot.bash_zsh => flameshot.bash} (100%) create mode 100644 data/shell-completion/flameshot.zsh diff --git a/data/shell-completion/flameshot.bash_zsh b/data/shell-completion/flameshot.bash similarity index 100% rename from data/shell-completion/flameshot.bash_zsh rename to data/shell-completion/flameshot.bash diff --git a/data/shell-completion/flameshot.zsh b/data/shell-completion/flameshot.zsh new file mode 100644 index 0000000000..a9ce3f3a5b --- /dev/null +++ b/data/shell-completion/flameshot.zsh @@ -0,0 +1,156 @@ +#compdef flameshot +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for the flameshot command line interface +# (https://github.com/flameshot-org/flameshot). +# +# ------------------------------------------------------------------------------ +# How to use +# ------- +# +# Copy this file to /usr/share/zsh/site-functions/_flameshot +# + + +# gui + +_flameshot_gui_opts=( + {-p,--path}'[Existing directory or new file to save to]':dir:_files + {-c,--clipboard}'[Save the capture to the clipboard]]' + {-d,--delay}'[Delay time in milliseconds]]' + "--region[Screenshot region to select ]" + {-r,--raw}'[Print raw PNG capture]]' + {-g,--geometry}'[Print geometry of the selection in the format W H X Y. Does nothing if raw is specified]' + {-u,--upload}'[Upload screenshot]' + "--pin[Pin the capture to the screen]" + {-s,--accept-on-select}'[Accept capture as soon as a selection is made]' +) + +_flameshot_gui() { + _arguments -s : \ + "$_flameshot_gui_opts[@]" +} + + +# screen + +_flameshot_screen_opts=( + {-n,--number}'[Define the screen to capture (starting from 0). Default: screen containing the cursor]' + {-p,--path}'[Existing directory or new file to save to]':dir:_files + {-c,--clipboard}'[Save the capture to the clipboard]' + {-d,--delay}'[Delay time in milliseconds]' + "--region[Screenshot region to select ]" + {-r,--raw}'[Print raw PNG capture]' + {-u,--upload}'[Upload screenshot]' + "--pin[Pin the capture to the screen]" +) + +_flameshot_screen() { + _arguments -s : \ + "$_flameshot_screen_opts[@]" +} + + +# full + +_flameshot_full_opts=( + {-p,--path}'[Existing directory or new file to save to]':dir:_files + {-c,--clipboard}'[Save the capture to the clipboard]' + {-d,--delay}'[Delay time in milliseconds]' + "--region[Screenshot region to select ]" + {-r,--raw}'[Print raw PNG capture]' + {-u,--upload}'[Upload screenshot]' +) + +_flameshot_full() { + _arguments -s : \ + "$_flameshot_full_opts[@]" +} + + +# config + +_flameshot_config_opts=( + {-a,--autostart}'[Enable or disable run at startup]' + {-f,--filename}'[Set the filename pattern]' + {-t,--trayicon}'[Enable or disable the tray icon]' + {-s,--showhelp}'[Define the main UI color]' + {-m,--maincolor}'[Show the help message in the capture mode]' + {-k,--contrastcolor}'[Define the contrast UI color]' + "--check[Check the configuration for errors]" +) + +_flameshot_config() { + _arguments -s : \ + "$_flameshot_config_opts[@]" +} + + +# Main handle +_flameshot() { + local curcontext="$curcontext" ret=1 + local -a state line commands + + commands=( + "gui:Start a manual capture in GUI mode" + "screen:Capture a single screen (one monitor)" + "full:Capture the entire desktop (all monitors)" + "launcher:Open the capture launcher" + "config:Configure Flameshot" + ) + + _arguments -C -s -S -n \ + '(- 1 *)'{-v,--version}"[display version information]: :->full" \ + '(- 1 *)'{-h,--help}'[[display usage information]: :->full' \ + '1:cmd:->cmds' \ + '*:: :->args' && ret=0 + + case "$state" in + (cmds) + _describe -t commands 'commands' commands + ;; + (args) + local cmd + cmd=$words[1] + case "$cmd" in + (gui) + _flameshot_gui && ret=0 + ;; + (screen) + _flameshot_screen && ret=0 + ;; + (full) + _flameshot_full && ret=0 + ;; + (config) + _flameshot_config && ret=0 + ;; + (*) + _default && ret=0 + ;; + esac + ;; + (*) + ;; + esac + + return ret +} + +_flameshot + +# +# Editor modelines - https://www.wireshark.org/tools/modelines.html +# +# Local variables: +# mode: sh +# c-basic-offset: 4 +# tab-width: 4 +# indent-tabs-mode: nil +# End: +# +# vi: set filetype=zsh shiftwidth=4 tabstop=4 expandtab: +# :indentSize=4:tabSize=4:noTabs=true: +# From 371d5deedf78206f7176ed1c886d5ddcc1cd4f1a Mon Sep 17 00:00:00 2001 From: Mehrad Mahmoudian Date: Sun, 6 Feb 2022 22:25:37 +0200 Subject: [PATCH 4/5] fix the extra square brackets --- data/shell-completion/flameshot.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/shell-completion/flameshot.zsh b/data/shell-completion/flameshot.zsh index a9ce3f3a5b..bc8752c6ab 100644 --- a/data/shell-completion/flameshot.zsh +++ b/data/shell-completion/flameshot.zsh @@ -18,10 +18,10 @@ _flameshot_gui_opts=( {-p,--path}'[Existing directory or new file to save to]':dir:_files - {-c,--clipboard}'[Save the capture to the clipboard]]' - {-d,--delay}'[Delay time in milliseconds]]' + {-c,--clipboard}'[Save the capture to the clipboard]' + {-d,--delay}'[Delay time in milliseconds]' "--region[Screenshot region to select ]" - {-r,--raw}'[Print raw PNG capture]]' + {-r,--raw}'[Print raw PNG capture]' {-g,--geometry}'[Print geometry of the selection in the format W H X Y. Does nothing if raw is specified]' {-u,--upload}'[Upload screenshot]' "--pin[Pin the capture to the screen]" From 29b6fc2acb266a2be86387f72f6ae3a730f2d771 Mon Sep 17 00:00:00 2001 From: Mehrad Mahmoudian Date: Sun, 6 Feb 2022 22:31:30 +0200 Subject: [PATCH 5/5] fix the CMakeLists to handle the new paths --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 22deecb3d3..f7168a0a82 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -305,10 +305,10 @@ if (UNIX) configure_file(${CMAKE_SOURCE_DIR}/data/appdata/org.flameshot.Flameshot.metainfo.xml ${CMAKE_CURRENT_BINARY_DIR}/share/metainfo/org.flameshot.Flameshot.metainfo.xml COPYONLY) - configure_file(${CMAKE_SOURCE_DIR}/data/shell-completion/flameshot.bash_zsh + configure_file(${CMAKE_SOURCE_DIR}/data/shell-completion/flameshot.bash ${CMAKE_CURRENT_BINARY_DIR}/share/bash-completion/completions/flameshot COPYONLY) - configure_file(${CMAKE_SOURCE_DIR}/data/shell-completion/flameshot.bash_zsh + configure_file(${CMAKE_SOURCE_DIR}/data/shell-completion/flameshot.zsh ${CMAKE_CURRENT_BINARY_DIR}/share/zsh/site-functions/_flameshot COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/data/shell-completion/flameshot.fish