<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Do Know Evil - A Blog by Tyler Mulligan &#187; Window Management</title> <atom:link href="http://www.doknowevil.net/category/computers/software/window-management/feed/" rel="self" type="application/rss+xml" /><link>http://www.doknowevil.net</link> <description>Tips and Tricks About Computers, Web Development, Linux, the Internet and the Like</description> <lastBuildDate>Sat, 16 Jul 2011 01:25:35 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.5</generator> <item><title>Random gnome-terminal profiles (themes) in Ubuntu</title><link>http://www.doknowevil.net/2010/09/30/random-gnome-terminal-profiles-themes-in-ubuntu/</link> <comments>http://www.doknowevil.net/2010/09/30/random-gnome-terminal-profiles-themes-in-ubuntu/#comments</comments> <pubDate>Thu, 30 Sep 2010 23:20:02 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Application Management]]></category> <category><![CDATA[Bash]]></category> <category><![CDATA[Command Line]]></category> <category><![CDATA[Computers]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Window Management]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=794</guid> <description><![CDATA[Introduction Does it ever confuse you if you have too many terminals open at once that look alike? Perhaps you&#8217;re just looking to express your personality or tickle your brain. In any case, if you&#8217;re using the terminal in ubuntu a lot, you may be interested in having random profiles (colors / settings). The concept]]></description> <content:encoded><![CDATA[<h2>Introduction</h2><p>Does it ever confuse you if you have too many terminals open at once that look alike?  Perhaps you&#8217;re just looking to express your personality or tickle your brain.  In any case, if you&#8217;re using the terminal in ubuntu a lot, you may be interested in having random profiles (colors / settings).</p><p>The concept of the method is pretty simple, define a hotkey that launches a script that picks a random profile you&#8217;ve created and then open the terminal with that profile as a parameter.</p><h2>Prerequisites</h2><p>- Compiz or other hotkey script that will allow you to link to a .sh file<br /> - gnome-terminal<br /> - bash</p><h2>Getting Started</h2><p>You can figure out what Profiles you have by going to <strong>Edit > Profiles</strong> in gnome-terminal.  You likely only have one, &#8220;Default&#8221;, unless you&#8217;re already actively using terminal profiles.  If you only have one, you should create a few, maybe 3 or 4 right now and play with the colors a bit. <strong>Important, don&#8217;t include spaces in the names of the profiles</strong></p><h2>The Script</h2><p>Create a file in your scripts folder (or create a directory if you don&#8217;t have one):</p><pre class="brush:bash">
mkdir ~/scripts
touch ~/scripts/gnome-terminal.sh &amp;&amp; chmod +x ~/scripts/gnome-terminal.sh
gedit ~/scripts/gnome-terminal.sh
</pre><p>Paste the following replacing the Profile names with those of your own (delimited by spaces) and change the number 4 to that of the :</p><pre class="brush:bash">
#!/bin/bash
p=( Default Delta Psi Sigma )
gnome-terminal --window-with-profile ${p[$((RANDOM%${#p[@]}))]}
</pre><p>That ugly looking bit right here is a calculation between a random number (<strong>echo RANDOM</strong>) and the size of the array (<strong>${#p[@]}</strong>), &#8220;random&#8221; % &#8220;length of array&#8221;.  Where % means mod, or remainder of the division. (examples: 7%4 = 3; 6%4 = 2; 5%4 = 1; 4 % 4 = 0; 4 % 3 = 1; 321%321= 0).</p><p>To illustrate more, play with this code:</p><pre class="brush:bash">r=$RANDOM; echo $r; echo $((r % 4))</pre><p>This is how we get a random index value for the array. This value is nested inside the array ${p[r]}, where r is the random, within bounds, array index.  That array then corresponds with a name of our profile and we pass it as a paramater to gnome-terminal with &#8220;&#8211;window-with-profile&#8221;.  So using my define array above, if the random index were &#8220;1&#8243;, &#8220;Delta&#8221; would be echoed.  If the index were &#8220;0&#8243;, Default would be.</p><h2>The Setup</h2><p>Now, I use compiz with the commands plugin, setting my &#8220;command line 0&#8243; to <strong>~/scripts/./gnome-terminal.sh</strong> and my &#8220;run command 0&#8243; under my key bindings tab to <strong>ctrl+alt+t</strong>, but you can associate this script with anything you&#8217;d like to kick it off.  A shortcut icon for example.</p><p>May this inspire you to understand, extend and share.</p> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/09/30/random-gnome-terminal-profiles-themes-in-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Some Issues I found with Dual Monitors in KDE</title><link>http://www.doknowevil.net/2010/05/13/some-issues-i-found-with-dual-monitors-in-kde/</link> <comments>http://www.doknowevil.net/2010/05/13/some-issues-i-found-with-dual-monitors-in-kde/#comments</comments> <pubDate>Thu, 13 May 2010 15:49:09 +0000</pubDate> <dc:creator>Tyler Mulligan</dc:creator> <category><![CDATA[Computers]]></category> <category><![CDATA[KDE]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Window Management]]></category> <category><![CDATA[open source]]></category> <category><![CDATA[dual monitors]]></category> <category><![CDATA[kde 4.4]]></category><guid isPermaLink="false">http://www.doknowevil.net/?p=613</guid> <description><![CDATA[I had originally made a thread on ubuntu forums essentially asking how to change the way kde or more specifically kwin treats dual monitors. When trying out KDE 4.4, I was trying to establish a similar workflow to what I have in my GNOME/compiz setup. I use dual monitors and heavily use the expo compiz]]></description> <content:encoded><![CDATA[<p>I had originally made a <a href="http://ubuntuforums.org/showthread.php?t=1416445" target="_blank">thread on ubuntu forums</a> essentially asking how to change the way kde or more specifically kwin treats dual monitors.</p><p>When trying out KDE 4.4, I was trying to establish a similar workflow to what I have in my GNOME/compiz setup.  I use dual monitors and heavily use the expo compiz plugin (equivalent to kwin&#8217;s &#8216;desktop grid&#8217;).  However, the behavior in KDE is a bit odd to me.</p><p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/JYzBGBy6bE8&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/JYzBGBy6bE8&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br /> (not my video but gives you an idea about the effect, see below for how I lay mine out)</p><p>In compiz, I have 4 virtual desktops with dimensions that spanned both monitors.</p> <pr>[    ] | [    ]<br /> [    ] | [    ]</p><p>In KDE however, each monitor is considered it&#8217;s own &#8220;activity&#8221; and as such, I have 8 virtual desktops</p><pre>[ ][ ] | [ ][ ]
[ ][ ] | [ ][ ]</pre><p>This in and of itself isn&#8217;t all so bad.  What bothers me however, is how they behave.</p><p>Labeling the virtual desktops..</p><pre>[1][2] | [1][2]
[3][4] | [3][4]</pre><p>When I click virtual desktop [1] on the left monitor, [1] on the right monitor zooms with it.  The behavior I&#8217;m used to in compiz would be to have both [1][2] on the left desktop zoom if I were to click [1].</p><p>Sure, this behavior &#8220;makes sense&#8221; knowing how KDE treats multiple monitors as separate activities but even after setting up matching desktop backgrounds on the monitors, I find it confusing to my workflow.</p><p><a href="http://pics.nexuizninjaz.com/viewer.php?file=gu6b56r305xemr7esym.png"><img src="http://pics.nexuizninjaz.com/images/gu6b56r305xemr7esym_thumb.png" /></a></p><p>What&#8217;s more, is that KDE seems to know this is what I want&#8230; but ignores this fact when creating activities:</p><p><img src="http://pics.nexuizninjaz.com/images/t8ds66c2d39fpe93fxl6.png" /></p><p>Has anyone come up with a clever solution to achieve this? I didn&#8217;t see anything about it planned for 4.5.</p><p>If it matters, I&#8217;m using twinview.</pr> ]]></content:encoded> <wfw:commentRss>http://www.doknowevil.net/2010/05/13/some-issues-i-found-with-dual-monitors-in-kde/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Object Caching 446/480 objects using disk

Served from: www.doknowevil.net @ 2012-02-07 09:46:19 -->
