Re: Post your handy self made command line utilities

Re: Post your handy self made command line utilities

I just have one static wallpaper "file" with no name extention. It's just called "wallpaper" and is a symlink to whatever wallpaper I currently use. This link is used by the background setter, the screensaver and i3-lock. The moment you add another program, that calls this file, the less complicated it gets with a symlink. In your case, however, the only reason to prefer a symlink is, that anything, that changes a "critical" file like .xinitrc might corrupt that file in some edge cases.

But I think Trilby meant, that all that sed and awk is not very elegant here and that the symlink approach could solve this in half the lines. :-)

Re: Post your handy self made command line utilities

Kaustic wrote:

display -window root -size 0000x000 ~/.local/share/wall

I'm actually rather interested in using this option to display my wallpaper instead of `feh` as I, also, am trying to switch over to sxiv. However, I'm having some trouble with that -size argument. It doesn't seem to be correctly sizing the image. Instead, the image is scaled so that the height fits which then repeats the image as tiles. The argument to size is meant to be the pixel counts (width and height) for which the image should be displayed, right?

All the best,

-HG

"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby\ldots

Those statistics are far from true or accurate or even up to date. They're fun though

HalosGhost wrote:

The argument to size is meant to be the pixel counts (width and height) for which the image should be displayed, right?

The -size parameter is usually given when the size of an image isn't known (RAW) or to override the information in the image header. It's mostly unnecessary in this case as display automatically scales the image to fit the root window's dimensions.

Re: Post your handy self made command line utilities

Kaustic wrote:

The -size parameter is usually given when the size of an image isn't known or to override the information in the image header. It's mostly unnecessary in this case as display automatically scales the image to fit the root window's dimensions.

But, it appears to fit the image to the height of the window, not the width, correct? Is there a way to reverse this?

All the best,

-HG

"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby\ldots

Re: Post your handy self made command line utilities

I've never used `display`, but most other imagemagick tools will preserve the aspect ratio while scaling (by default), so the smaller scale axis is used for both. Usually a '!' after the size will scale to the exact size ignoring aspect ratio. Otherwise, if you don't mind the top/bottom being cut off, you can just put a very large height and set the width to your screen width. Then the image will be scaled (vertically and horizontally) with a scale factor to fit the width to the screen.

Re: Post your handy self made command line utilities

I'm not sure, try asking on ##imagemagick on freenode or reading the documentation. I would be surprised if it couldn't.Edit: Ahh, Trilby has already provided an idea. -gravity center may work but I haven't tested.

Re: Post your handy self made command line utilities

If you use PowerDNS as your nameserver, then this script provides an easy way to manage dynamic DNS:https://github.com/battlesnake/ddnsIncludes a hacky web interface to manage your dynamic DNS remotely (and of course, for updating the dynamic IP address via a curl command!)

If you access your home PC a lot from work/other external networks, but don't want to run up an energy bill, then turn a Raspberry Pi into a wake-on-lan proxy:https://github.com/battlesnake/macs(note: via cron job, also maintains a list of machines detected on your network, with IP/hostname/MAC address, so you don't have to remember your PC's MAC address)

Last edited by windows_me (2013-08-14 11:34:57)

[10:04:21] Time for weekly full server backup.[10:04:25] Redirecting it to "/dev/null" to make it go faster.[10:04:53] Backup done! Amazing how fast modern technology is!

Re: Post your handy self made command line utilities

If anyone can use this.A couple of scripts that I wrote for Google text to speech, and Google text to text translation.They work from shell and allow you to translate until you quit.The text to speech script concatenates to $FILE.mp3 so you can make a single file out of 100 char max. segments. The text to text dumps the output to sdout, redirect to $FILE if you want.You might want to take it easy on how many times a minute you hit their server.