• General Linux Chat and Small Questions v. I broke my Arch Install
    6,886 replies, posted
[QUOTE=PredGD;46010853]is it possible to use scrot to upload to a server over SFTP after capture, then giving me the link in my clipboard?[/QUOTE] Create shell script with something like this: 1. Create and save random string in var 2. scrot and save file with randomstring as name in a temp folder 3. use sftp command to push file to remote server 4. xclip baseurl + filename into clipboard. 5. remove temp file
[QUOTE=PredGD;46010853]is it possible to use scrot to upload to a server over SFTP after capture, then giving me the link in my clipboard?[/QUOTE] [URL]http://github.com/Darkwater124/dotfiles/blob/master/screentool[/URL] [editline]18th September 2014[/editline] You could replace slop/maim with scrot but slop/maim is cool and it's made by fellow Facepuncher Naelstrom
[QUOTE=kaukassus;46010903]Create shell script with something like this: 1. Create and save random string in var 2. scrot and save file with randomstring as name in a temp folder 3. use sftp command to push file to remote server 4. xclip baseurl + filename into clipboard. 5. remove temp file[/QUOTE] I'm not very familiar with shell scripting, but I suppose it's fairly easy? I'll have to delve deeper into it at a later time when I'm feeling up for the task I decided to give it a go using scrot's -e flag, but it seems to ignore the actual part where the file is uploaded. I suppose this is a limitation of scrots implementation of it or am I doing something wrong? [code]scrot -q 100 '%Y-%m-%d-%T.png' -e 'mv $f /home/vlad/scrots/; scp -P 12345 /home/vlad/scrots/%f apache@pred.me:~/public_html/pics'[/code] [QUOTE=Darkwater124;46010904][URL]http://github.com/Darkwater124/dotfiles/blob/master/screentool[/URL] [editline]18th September 2014[/editline] You could replace slop/maim with scrot but slop/maim is cool and it's made by fellow Facepuncher Naelstrom[/QUOTE] I'll take a look through your script, but as said I wrote above, I'm not very handy when it comes to shell scripts and scripting in general. I'll poke around with it though and see if I can adjust it to my liking, thanks!
[QUOTE=Darkwater124;46010904][URL]http://github.com/Darkwater124/dotfiles/blob/master/screentool[/URL] [editline]18th September 2014[/editline] You could replace slop/maim with scrot but slop/maim is cool and it's made by fellow Facepuncher Naelstrom[/QUOTE] <3 [editline]asdf[/editline] [QUOTE=PredGD;46011019]I suppose this is a limitation of scrots implementation of it or am I doing something wrong.[/QUOTE] Scrot is simply trying to do too much, things that your shell can take care of. It would be easier for you to write a couple of easy-to-understand shell lines rather than fiddle with the single omni-scrot-line. [code] #!/bin/bash _date=`date` _file="/home/vlad/scrots/${_date}.png" scrot "${_file}" scp -P 12345 "${_file}" apache@pred.me:~/public_html/pics [/code] This shell script should mostly function the same as the scrot line you had. [editline]asdf[/editline] From there you can spice up the script by using slop to get a selection rectangle, then use imagemagick's import to crop the image based on the selection, then use ffmpeg to add desktop recording support, then use xclip to automatically copy URLs to your clipboard, then continue adding features to the script until it looks like [url=http://github.com/Darkwater124/dotfiles/blob/master/screentool]this lovely abomination.[/url] :)
[QUOTE=Naelstrom;46014215]Scrot is simply trying to do too much, things that your shell can take care of. It would be easier for you to write a couple of easy-to-understand shell lines rather than fiddle with the single omni-scrot-line. [code] #!/bin/bash _date=`date` _file="/home/vlad/scrots/$_date.png" scrot "$_file" scp -P 12345 "$_file" apache@pred.me:~/public_html/pics [/code] This shell script should mostly function the same as the scrot line you had. [editline]asdf[/editline] From there you can spice up the script by using slop to get a selection rectangle, then use imagemagick's import to crop the image based on the selection, then use ffmpeg to add desktop recording support, then use xclip to automatically copy URLs to your clipboard, then continue adding features to the script until it looks like [url=http://github.com/Darkwater124/dotfiles/blob/master/screentool]this lovely abomination.[/url] :)[/QUOTE] thanks for the help! the script doesn't work as intended though. every file outputs as "date.png". I tried changing the _date to the time specifiers from scrot, but bash doesn't know what that means.
[QUOTE=PredGD;46016955]thanks for the help! the script doesn't work as intended though. every file outputs as "date.png". I tried changing the _date to the time specifiers from scrot, but bash doesn't know what that means.[/QUOTE] Oopsies you may have to put it in brackets like so: [code]_file="/home/vlad/scrots/${_date}.png"[/code] Sorry I thought I could remember how to use bash without using it for about a year.
You guys know of a better minimal graphical browser but still with userscript and/or adblocking support? Tried [url=https://pwmt.org/projects/jumanji/]Jumanji[/url] earlier and I can easily say to avoid it. It uses more memory on four tabs than Firefox could with fifteen.
[QUOTE=Naelstrom;46017177]Oopsies you may have to put it in brackets like so: [code]_file="/home/vlad/scrots/${_date}.png"[/code] Sorry I thought I could remember how to use bash without using it for about a year.[/QUOTE] same result unfortunately. I did some googling and by the looks of it, putting date in it will only output "date" and the proper way is to put the tags directly into the _date variable. working line [code]_date='%d-%m-%Y-%H:%M'[/code] so now it works! only issue now is that scp doesn't see the file [code]/home/vlad/scrots/test/%d-%m-%Y-%H:%M.png: No such file or directory[/code]
Oh lol. Pay attention to the `'s. They're grave accents, not single quotes. Grave accents are used to execute code. [code]_date=`date`[/code] Would execute the command "date" and set the variable $_date to its output. The date command is used to output the date, and has switches/options to specify formatting, but the default should work fine. [code]_date='date'[/code] This would simply set $_date to 'date', and that's why it wasn't working earlier. Hey hit me up on steam I can help out a little better.
[QUOTE=Naelstrom;46018080]Oh lol. Pay attention to the `'s. They're grave accents, not single quotes. Grave accents are used to execute code. [code]_date=`date`[/code] Would execute the command "date" and set the variable $_date to its output. The date command is used to output the date, and has switches/options to specify formatting, but the default should work fine. [code]_date='date'[/code] This would simply set $_date to 'date', and that's why it wasn't working earlier. Hey hit me up on steam I can help out a little better.[/QUOTE] ohh, alright, that makes sense. was fairly sure those were single quotes, and now that's sorted out, scp is working too! I went on and finished the script, thanks for the help! it's pretty much what you wrote with the addition of xclip, but might end up expanding on it later now that I feel slightly more confident with this [code]#!/bin/bash _date=`date +%d-%m-%Y-%H:%M` _file="/home/vlad/scrots/$_date.png" scrot -q 100 "$_file" scp -P 12345 "$_file" apache@pred.me:~/public_html/pics echo http://pred.me/pics/$_date.png | xclip -selection clipboard[/code]
The quality flag in scrot is kinda odd when outputing PNGs, lower numbers give better compression with 100 being uncompressed. Probably best just to leave it out. [code]% scrot -q 100 a.png && scrot -q 90 b.png && scrot -q 1 c.png && scrot -q 0 d.png && scrot e.png && scrot f.bmp && ll *.png *.bmp -rw-r--r-- 1 mitch mitch 6.0M Sep 18 23:17 a.png -rw-r--r-- 1 mitch mitch 6.0M Sep 18 23:17 b.png -rw-r--r-- 1 mitch mitch 223K Sep 18 23:17 c.png -rw-r--r-- 1 mitch mitch 223K Sep 18 23:17 d.png -rw-r--r-- 1 mitch mitch 258K Sep 18 23:17 e.png -rw-r--r-- 1 mitch mitch 6.0M Sep 18 23:17 f.bmp[/code]
And definitely look into [url=https://github.com/naelstrof/slop]slop[/url], [url=https://github.com/naelstrof/maim]maim[/url], nfs, and ffmpeg. They can add crop-shots, video recording, and streaming functionality.
[QUOTE=Naelstrom;46018080]Oh lol. Pay attention to the `'s. They're grave accents, not single quotes. Grave accents are used to execute code.[/QUOTE] [url=http://mywiki.wooledge.org/BashFAQ/082]And is a very highy unrecommended practice[/url]. One reason is because of exactly what you had to correct him with. Backticks can be confused for single quotes pretty easily. [code] # Use this instead. _date=$(date) [/code] [editline]e[/editline] Man I've really gone pants-on-head insane if I'm correcting people over matters like [I]this[/I].
Didn't even know you could do that. Thanks.
Also, assuming you don't want to keep a local copy around, mktemp is the proper way to get a temporary filename.
[QUOTE=Larikang;46019719]Also, assuming you don't want to keep a local copy around, mktemp is the proper way to get a temporary filename.[/QUOTE] I mainly store temp files in /tmp, which is always using tmpfs, and then remove it once I'm done.
[QUOTE=Naelstrom;46019122]And definitely look into [url=https://github.com/naelstrof/slop]slop[/url], [url=https://github.com/naelstrof/maim]maim[/url], nfs, and ffmpeg. They can add crop-shots, video recording, and streaming functionality.[/QUOTE] yet again, another issue. I checked out maim, but I'm not able to get slop to work. I tried removing slop and reinstalling it from the aur (had it installed, not sure from when) but was unable to download it from the aur. md5 didn't match the source, tried a few times. built it manually from github, but it gives me the same error I got in the first place [code]X Error of failed request: BadAccess (attempt to access private resource denied) Major opcode of failed request: 33 (X_GrabKey) Serial number of failed request: 25 Current serial number in output stream: 26[/code] gave scrot -s a chance as I didn't get this to work, but that isn't working as it should either. running the bash script from the terminal gives me the expected result. select area, capture, upload to server. when bound to a hotkey, it skips taking a picture completely, yet it tells me it was captured and uploaded.
I was browsing the Google Play Store yesterday, and stumbled upon something. And I'm just thinking that this just might be cool, and it turns out that it really is. Have none of you noticed it either? [url]http://syncthing.net/[/url] [QUOTE=Stonecycle;46017209]You guys know of a better minimal graphical browser but still with userscript and/or adblocking support? Tried [url=https://pwmt.org/projects/jumanji/]Jumanji[/url] earlier and I can easily say to avoid it. It uses more memory on four tabs than Firefox could with fifteen.[/QUOTE] Have you tried Midori yet? It's pretty neat, and comes with userscript and userstyles support, as well as with adblocking support and various other features. It isn't fat though.
[QUOTE=mastersrp;46020216]I was browsing the Google Play Store yesterday, and stumbled upon something. And I'm just thinking that this just might be cool, and it turns out that it really is. Have none of you noticed it either? [url]http://syncthing.net/[/url] Have you tried Midori yet? It's pretty neat, and comes with userscript and userstyles support, as well as with adblocking support and various other features. It isn't fat though.[/QUOTE] What's the difference between syncthing and BTSync? I love how BTSync can sync in the background on my android devices.
[QUOTE=FPtje;46020388]What's the difference between syncthing and BTSync? I love how BTSync can sync in the background on my android devices.[/QUOTE] It is completely open source ([url]https://github.com/syncthing/syncthing/blob/master/LICENSE[/url]), it uses an open protocol ([url=https://github.com/syncthing/syncthing/blob/master/protocol/PROTOCOL.md]BEP[/url]), and unlike BTSync, is continously developed for all platforms, including FreeBSD and on Linux for ARMv{5,6,7}.
Syncthing + OwnCloud = epicness? Or Syncthing can be used alone?
[QUOTE=PredGD;46020076]yet again, another issue. I checked out maim, but I'm not able to get slop to work. I tried removing slop and reinstalling it from the aur (had it installed, not sure from when) but was unable to download it from the aur. md5 didn't match the source, tried a few times. built it manually from github, but it gives me the same error I got in the first place [code]X Error of failed request: BadAccess (attempt to access private resource denied) Major opcode of failed request: 33 (X_GrabKey) Serial number of failed request: 25 Current serial number in output stream: 26[/code] gave scrot -s a chance as I didn't get this to work, but that isn't working as it should either. running the bash script from the terminal gives me the expected result. select area, capture, upload to server. when bound to a hotkey, it skips taking a picture completely, yet it tells me it was captured and uploaded.[/QUOTE] Guess it's hard to find, but in the help section of slop tells you to use the --nokeyboard option to get by that particular error. X11 is a piece of shit and some window managers eat all keyboard input in a way that causes anything trying to bind to the keyboard to instantly receive a fatal error... I never get the error myself so it's really difficult to debug.
[QUOTE=Naelstrom;46022630]Guess it's hard to find, but in the help section of slop tells you to use the --nokeyboard option to get by that particular error. X11 is a piece of shit and some window managers eat all keyboard input in a way that causes anything trying to bind to the keyboard to instantly receive a fatal error... I never get the error myself so it's really difficult to debug.[/QUOTE] There must be some work around for this though. While X11 IS a piece of shit, it isn't a completely retarded piece of shit, considering how games in Window mode in those same games manage to grab both keyboard and mouse input. I believe I got the same error on SliTaz in Awesome WM though, but I'm not sure why.
I've tried two different methods of grabbing the keyboard and both are unreliable. I have yet to see how sfml grabs the keyboard so well. I might just end up writing a way to catch the exception and continue since it's not fatal. (you can still use right-click to cancel selections) I believe the problem mainly comes from slop being ran in a non-graphical manner. Eg running it through a keybinding utility rather than an actual terminal emulator, but really I have no idea since it works fine on my system regardless. (Yay GNOME)
[QUOTE=Abaddon-ext4;46022540]Syncthing + OwnCloud = epicness? Or Syncthing can be used alone?[/QUOTE] Just Use owncloud. How on earth would they even be usefull together
[QUOTE=Abaddon-ext4;46022540]Syncthing + OwnCloud = epicness? Or Syncthing can be used alone?[/QUOTE] I don't think there'd be a use for that. You COULD of course just have a central server running Syncthing, and it would replace OwnCloud.
[QUOTE=Naelstrom;46022630]Guess it's hard to find, but in the help section of slop tells you to use the --nokeyboard option to get by that particular error. X11 is a piece of shit and some window managers eat all keyboard input in a way that causes anything trying to bind to the keyboard to instantly receive a fatal error... I never get the error myself so it's really difficult to debug.[/QUOTE] oh, alright. it's sorted out now, thanks! I was feeling safe that I wasn't one of those who would experience problems, so I disregarded the help message on the -nkb flag. probably should have tried that :v: if it's of any help, I'm running Xfce
[QUOTE=mastersrp;46020216] Have you tried Midori yet? It's pretty neat, and comes with userscript and userstyles support, as well as with adblocking support and various other features. It isn't fat though. [/QUOTE] Remember trying it out when trying elementary OS a long time ago. Back then it felt a little too minimal and had a dislike of WebKit for some reason. Now it actually feels a little better. Fonts still feel wonky even when set to the same ones Firefox is using. Disappointed in the lack of VimFX-like commands to navigate with after finding out you can scroll with hjkl. Haven't really gotten the number of tabs up to what I normally have, but it feels a lot less like a memory hog than Firefox and especially Jumanji. The latter would use a whole gigabyte (including system) for four tabs.
[QUOTE=Stonecycle;46031646]Remember trying it out when trying elementary OS a long time ago. Back then it felt a little too minimal and had a dislike of WebKit for some reason. Now it actually feels a little better. Fonts still feel wonky even when set to the same ones Firefox is using. Disappointed in the lack of VimFX-like commands to navigate with after finding out you can scroll with hjkl. Haven't really gotten the number of tabs up to what I normally have, but it feels a lot less like a memory hog than Firefox and especially Jumanji. The latter would use a whole gigabyte (including system) for four tabs.[/QUOTE] Which version of Midori are you using? I'm not asking to help you out with anything really, I'm just asking because I want to try Midori out myself again now :v:
[QUOTE=mastersrp;46031678]Which version of Midori are you using? I'm not asking to help you out with anything really, I'm just asking because I want to try Midori out myself again now :v:[/QUOTE] Midori 0.5.8. I'd advise getting a package from [url=http://midori-browser.org/download/]the site[/url]. It uses less resources than the ones in the Ubuntu repositories, as far as I can tell. Don't bother with compiling from sources. Abandon all hope, ye who enter, for here be dragons and CMake. [editline]cmake -DCMAKE_INSTALL_PREFIX=/usr ..[/editline] Sensible people would use a sensible makefile where all one would need to do is $(make) and/or $(sudo make install) and be done with it.
Sorry, you need to Log In to post a reply to this thread.