<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=1654&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / *SOLVED* Need some advice on a script i'm making]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=1654</link>
		<description><![CDATA[The most recent posts in *SOLVED* Need some advice on a script i'm making.]]></description>
		<lastBuildDate>Sat, 14 Oct 2017 18:21:46 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: *SOLVED* Need some advice on a script i'm making]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=5550#p5550</link>
			<description><![CDATA[<p>Thanks guys, got a good link from another awesome Devuanista on IRC and found the way, had to use another double .desktop command, added a cd first to tell the shell where to execute the shrink script, so the exec line in shrink.desktop now is:</p><div class="codebox"><pre><code>Exec=sh -c &#039;cd %d &amp;&amp; shrink2 %f&#039;</code></pre></div><p>And it works great now, cool little extension for Pcmanfm I think, quick too, I just wanted something so you don&#039;t have to open gimp just to do a quick re-size.</p><p>I&#039;ll edit first post and mark solved.</p><p>But now i&#039;m doing a similar extension just to rotate images, works but for some reason Pcmanfm isn&#039;t replacing the thumbnail preview with the correct rotated one, but that&#039;s for another post I guess. <img src="http://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Sat, 14 Oct 2017 18:21:46 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=5550#p5550</guid>
		</item>
		<item>
			<title><![CDATA[Re: *SOLVED* Need some advice on a script i'm making]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=5515#p5515</link>
			<description><![CDATA[<p>I&#160; must have missed this the first time. </p><div class="codebox"><pre><code>convert $1 </code></pre></div><p> This makes my previous advice unnecessary. (Or did you edit that?)</p><p>add </p><div class="codebox"><pre><code>set -x</code></pre></div><p> to the beginning of the script, and it will tell you everything it does. Maybe the error will be obvious.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Fri, 13 Oct 2017 12:33:51 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=5515#p5515</guid>
		</item>
		<item>
			<title><![CDATA[Re: *SOLVED* Need some advice on a script i'm making]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=5514#p5514</link>
			<description><![CDATA[<p>Maybe it needs the &#039;here&#039; . to tell it where to make the copy(?), (like when you want to cp stuff to a directory) - just guessing, but should be quick to try.</p><div class="codebox"><pre><code>convert $1 -resize &quot;$size&quot; -set filename:copy &#039;%t-%wx%h&#039; &#039;%[filename:copy].jpg&#039; .</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (FOSSuser)]]></author>
			<pubDate>Fri, 13 Oct 2017 11:41:15 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=5514#p5514</guid>
		</item>
		<item>
			<title><![CDATA[Re: *SOLVED* Need some advice on a script i'm making]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=5506#p5506</link>
			<description><![CDATA[<p>I think the desktop file replaces %f with the filename, so that filename is the first argument of the command.<br />Therefore, you should be able to put&#160; </p><div class="codebox"><pre><code>filename=&quot;$1&quot;</code></pre></div><p>at the beginning of your script and then use &quot;$filename&quot; wherever you need it in the script.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Fri, 13 Oct 2017 00:21:57 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=5506#p5506</guid>
		</item>
		<item>
			<title><![CDATA[*SOLVED* Need some advice on a script i'm making]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=5505#p5505</link>
			<description><![CDATA[<p><strong>*EDIT* Solved, below code boxes have been updated to the code that works, thanks!</strong></p><p>So I am working on a small script to use for a right-click option in Pcmanfm, it uses Imagemagick and Yad and is simply an image re-sizer, when you hover over an image in Pcmanfm it offers you the option &quot;Resize Image For Web&quot;.&#160; Clicking it causes a small yad dialog to open and prompts you to enter a size, then the Imagmagick Convert script resizes it and converts it to a jpg, and adds the new size in the new copy&#039;s filename. (i.e. image.png becomes image-800x600.jpg).</p><p>It all works fine with one exception, currently when called with the .desktop action file, <strong>it drops the copy into the users Home folder instead of the current directory.</strong></p><p>However it works perfectly if you open a terminal in the folder where the image is, and use </p><div class="codebox"><pre><code>shrink2  name-of-image.whatever (target image file name)</code></pre></div><p>&#160; it will spit out the copy right where you are at.</p><p>Any help would be greatly appreciated, no combination of output specifiers works so far in the convert command, no amount of $PWD or %f seem to work.</p><p>Here&#039;s the .desktop that calls it (*this is what I had to fix*)</p><div class="codebox"><pre><code>[Desktop Entry]
Type=Action
Name=Resize Image For Web
Tooltip=Shrink image and convert to jpg
Icon=gprename
Profiles=resize;

[X-Action-Profile resize]
Exec=sh -c &#039;cd %d &amp;&amp; shrink2 %f&#039;
MimeTypes=image/bmp;image/gif;image/jpeg;image/png;</code></pre></div><p>And here&#039;s the script which for some reason pluma (my text editor) thinks is a perl script, but that&#039;s another issue for another day, lol:</p><div class="codebox"><pre><code>#!/bin/sh

sizebox=$(yad --form --title=&quot;Resize Image&quot; --field=&quot;Resize to:&quot; --width=400 --text=&quot;Enter new size (W x H in pixels, i.e. 800x600, 1024x768 etc.)&quot;)

size=$(echo $sizebox | awk &#039;BEGIN {FS=&quot;|&quot; } { print $1 }&#039;)

convert $1 -resize &quot;$size&quot; -set filename:copy &#039;%t-%wx%h&#039; &#039;%[filename:copy].jpg&#039;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Thu, 12 Oct 2017 22:07:03 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=5505#p5505</guid>
		</item>
	</channel>
</rss>
