Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
apps:xfce4-screenshooter:custom-actions [2024/02/04 22:46] – created andreldm | apps:xfce4-screenshooter:custom-actions [2025/02/15 12:52] (current) – [Hosting on Imgur™] Update about client id andreldm | ||
---|---|---|---|
Line 1: | Line 1: | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
- | {{ :xfce:xfce.screenshooter.png? | + | {{ :apps:xfce4-screenshooter.png? |
====== xfce4-screenshooter - Custom Actions ====== | ====== xfce4-screenshooter - Custom Actions ====== | ||
+ | |||
+ | * **[[#Adding custom actions|Adding custom actions]]** | ||
+ | * **[[# | ||
+ | * **[[# | ||
+ | * **[[#Read QR Code|Read QR Code]]** | ||
+ | * **[[# | ||
===== Adding custom actions ===== | ===== Adding custom actions ===== | ||
- | TODO | + | <figure " |
+ | {{: | ||
+ | </ | ||
+ | |||
+ | Custom actions can be added, removed and editing in the Preferences dialog. | ||
+ | |||
+ | * Add: click on the plus(+) button and a new blank custom action is added at the bottom of the list. | ||
+ | * Remove: click on the minus(-) button and the selected custom action will be removed. | ||
+ | * Edit: add a new custom action or select an existing one, changes made to the name and command entries are saved as soon as the preferences dialog is closed. | ||
+ | |||
+ | Custom actions are composed of: | ||
+ | * Name: a friendly name that will be shown in the Actions dialog. | ||
+ | * Command: command to be executed, it can be an inline command or a call to script. The screenshot file can be referenced by passing '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | The following examples assume the necessary dependencies are already installed. | ||
+ | |||
+ | ==== Extract text with OCR ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Read QR Code ==== | ||
+ | |||
+ | Save the following script somewhere and set as command: ''< | ||
+ | |||
+ | < | ||
+ | # | ||
+ | |||
+ | RES=$(zbarimg --raw " | ||
+ | if [ $? -ne 0 ]; then | ||
+ | notify-send -e "No QR Code detected" | ||
+ | exit 0 | ||
+ | fi | ||
+ | |||
+ | ANSWER=$(notify-send -e -A 1=" | ||
+ | if [ " | ||
+ | echo " | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | [[|Back to Top]] | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Hosting on Imgur™ ==== | ||
+ | |||
+ | ! This custom action allows you to host your screenshot on this free online hosting service, so that you can share it easily with other people. Imgur automatically generates a tiny, medium, and full-size image of your screenshot, which can be used to create thumbnails pointing to the full size screenshot. | ||
+ | |||
+ | |||
+ | <note important> | ||
+ | |||
+ | |||
+ | Save the following script somewhere and set as command: ''< | ||
+ | |||
+ | < | ||
+ | # | ||
+ | |||
+ | URL=' | ||
+ | SCREENSHOT_PATH=$1 | ||
+ | CLIENT_ID=$2 | ||
+ | |||
+ | if [ -z " | ||
+ | zenity --error --text=" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | if ! command -v jq >&2; then | ||
+ | zenity --error --text=" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | # | ||
+ | # | ||
+ | RESPONSE=$(curl --silent --location " | ||
+ | --header " | ||
+ | --form " | ||
+ | tee >(zenity --progress --pulsate --no-cancel --auto-close --text=" | ||
+ | STATUS=$(echo " | ||
+ | |||
+ | if [ -z " | ||
+ | ERROR=$(echo " | ||
+ | zenity --error --text=" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | LINK=" | ||
+ | DELETE=" | ||
+ | LOG_DIRECTORY=" | ||
+ | LOG=" | ||
+ | |||
+ | # Add link to clipboard | ||
+ | echo " | ||
+ | |||
+ | # Add links to log | ||
+ | mkdir -p " | ||
+ | echo "--- | ||
+ | $(date '+%x %X') | ||
+ | Link: $LINK | ||
+ | Delete: $DELETE" | ||
+ | |||
+ | # Show dialog with links | ||
+ | zenity --info --title=" | ||
+ | Delete: <a href=' | ||
+ | |||
+ | Link copied to clipboard. Links stored in: | ||
+ | $LOG" | ||
+ | </ | ||
+ | |||
+ | The dialog below will give you the links to delete the image off of the Imgur website. The link will only be shown once. Make sure to save it if you think you might be deleting this image: | ||
+ | |||
+ | <figure "Imgur Deletion Dialog Window"> | ||
+ | {{: | ||
+ | </ | ||
+ | |||
+ | |||
+ | [[|Back to Top]] | ||
+ | |||
+ | ---- | ||
+ | [[: |