You are not logged in.
Feedback on this would be appreciated
################### imgur.sh ###########################################
# Take screenshots and upload them to Imgur.
# This can be to an existing account, or anonymously.
#
# Credentials and access token for an account can be set up.
#
# Settings (settings.conf) and credentials (credentials.conf}) files are created in \
# $HOME/.config/imgur/
#
# The script returns BB-Code for the direct image link, and a linked thumbnail.
# YAD dialogs are used for user interaction.
#
# Kudos to the writer of the script at https://github.com/jomo/imgur-screenshot,
# which has provided most of the OAuth2 and Imgur API functions adapted here.
# ("imgur-screenshot" is featured in https://imgur.com/tools.)
#
# Copyright (C) 2019 damo <damo@bunsenlabs.org>
########################################################################
xfce4-screenshooter has the option to upload a scrot to Imgur, but it is as an anonymous user. This script also allows upload to an existing account and album.
It is BL-specific because it is using yad-includes, but is easily adapted to other yad dialogs.
Last edited by damo (2019-12-23 21:05:40)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Not a fan of imgur. Everytime i click on an imgur link here and elsewhere i never get the full view and when i try it asks me to join up.
Offline
Sorry, but I could need some fuller instructions to be able to evalute the function...
// Regards rbh
Please read before requesting help: "Guide to getting help", "Introduction to the Bunsenlabs Lithium Desktop" and other help topics under "Help & Resources" on the BunsenLabs menu
Offline
Sorry, but I could need some fuller instructions to be able to evalute the function...
Run the script with no args and it will upload a full desktop screenshot, then give you back the BBCode for a linked thumbnail, or a direct image link.
Get the options with
imgur.sh -h
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
An option to allow upload of a random image file via a Thunar custom action?
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Not a fan of imgur. Everytime i click on an imgur link here and elsewhere i never get the full view and when i try it asks me to join up.
Hmm wonder what that is? I never get that problem.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
clusterF wrote:Not a fan of imgur. Everytime i click on an imgur link here and elsewhere i never get the full view and when i try it asks me to join up.
Hmm wonder what that is? I never get that problem.
I probably should have worded that better, sometimes not everytime. Maybe its changed since as it was a few months ago i was trying to browse imgur without an account and some images failed to render in full size and i would get popups asking to join imgur to see more. Might depend on how the uploader links images as well.
Offline
An option to allow upload of a random image file via a Thunar custom action?
That sounds like a good idea. Think you can also create a similar custom action in PCManFM as well. Maybe a simple command line script would also be useful for those who use the command line the most.
Last edited by DeepDayze (2019-12-15 15:29:43)
Real Men Use Linux
Offline
Hmm I should have actually looked at damo's code before posting my suggestion. He's already provided an image upload option:
--file <filepath/filename> Upload specified image. Overrides scrot options
Sorry damo. m(._.)m
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
You said a random image, and I thought....someone else can hack that
BTW it is proving tricky to add progress bars, but I'm getting close; and many popular free image hosts don't have public APIs, although anonymous uploads should be possible for most.
With a bit more code the script could do away with xfce4-screenshooter altogether.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
clusterF wrote:Not a fan of imgur. Everytime i click on an imgur link here and elsewhere i never get the full view and when i try it asks me to join up.
Hmm wonder what that is? I never get that problem.
My version https://github.com/brontosaurusrex/buce … /bin/imgur attempts to solve that with free proxy prefix, also tries to handle transparent thumbnails and probably some more. However it definately needs a smart rewrite and I asked myself and I said no.
Online
With a bit more code the script could do away with xfce4-screenshooter altogether.
Did you look at
maim
?
Offline
With a bit more code the script could do away with xfce4-screenshooter altogether.
A bit more... That's already quite a monumental creation, but I never imagined stuff like OAUTH for a job like this. I guess if you want proper access to a user account it's needed.
But anyway, I couldn't find any reference to xfce4-screenshooter in there.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
damo wrote:With a bit more code the script could do away with xfce4-screenshooter altogether.
Did you look at
maim
?
That is my personal favourite - it is very versatile and a lot better than scrot IMO. I have a submenu with various maim options.
ATM I am trying to hack something together that uses BL stuff OOTB, so maim will be next on the list to be included as an an option
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
...
But anyway, I couldn't find any reference to xfce4-screenshooter in there.
I meant that BL may not need it as a gui screenshooter. It should be fairly trivial to have an xfce4-screenshooter-like interface for options, including editing, using YAD,. Maybe even upload options for various image hosts.
Also, @ohnonot also points out, maim is a good option instead of scrot. This is a script I'm using for shooting to the clipboard:
#!/bin/bash
##
## scrotclip by damo Feb 2019
# Requires maim, xclip, xdotool
# USAGE: scrotclip [clipwin|clipall|clipsel|clipclean]
arg="$1"
case "$arg" in
clipwin ) maim -i $(xdotool getactivewindow) | xclip -selection clipboard -target image/png
notify-send -t 6000 "Active window screenshot saved to clipboard"
;;
clipall ) maim | xclip -selection clipboard -target image/png
notify-send -t 6000 "Desktop screenshot saved to clipboard"
;;
clipsel ) maim -s | xclip -selection clipboard -target image/png
notify-send -t 6000 "Selected area screenshot saved to clipboard"
;;
clipclean) maim -d 3 -u | xclip -selection clipboard -target image/png # wait 3 secs (close menu, hide cursor)
notify-send -t 6000 "Screenshot saved to clipboard"
;;
*) notify-send -t 6000 "Nothing saved to clipboard..."
;;
esac
exit
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
^ nice.
the clipwin action isn't strictly necessary - 'maim -s' will select the clicked window when you just click insteadof click-dragging.
Offline
Original post and link updated for improved imgur upload script.
It now includes progress bars while uploading or deletion is in progress'
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
This is looking good...nice work!
Real Men Use Linux
Offline