{"id":2015,"date":"2010-11-13T02:34:18","date_gmt":"2010-11-12T21:04:18","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=2015"},"modified":"2016-12-19T14:36:43","modified_gmt":"2016-12-19T09:06:43","slug":"startup-script-using-xdotool","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/startup-script-using-xdotool\/","title":{"rendered":"Startup Script Using XdoTool"},"content":{"rendered":"<p>(<a href=\"http:\/\/www.semicomplete.com\/projects\/xdotool\/\">Xdotool<\/a> is a tool that simulates user key movements.)<br \/>\n<\/br><br \/>\nUsually when we start to work , we usually require some apps to be running. In my case I have to run a grails app, sql , subversion  and IDE in different tabs of same terminal.<br \/>\n<\/br><br \/>\nNormally it would take almost 1-2 minutes if I do it manually.So I created a shell script using Xdotool .And it does all my work in almost 2 seconds. And All the tabs are opened in same terminal).Best part with xdotool is since it simulates key all your aliases work.<br \/>\n<\/br><br \/>\nAnd it works perfectly on Ubuntu 10.10. (Tried and Tested)<\/p>\n<p>Here is a snippet of script that I created.<br \/>\n<code><br \/>\nxdotool key alt+t space;<br \/>\nxdotool type \"etc\";<br \/>\nxdotool key Return;<br \/>\nxdotool key ctrl+t alt+t space;<br \/>\nxdotool type \"grails\";<br \/>\nxdotool key Return ;<br \/>\n.<br \/>\n.<br \/>\n.<br \/>\nxdotool key ctrl+t alt+t space;<br \/>\nxdotool type \"sql\";<br \/>\nxdotool key Return;<br \/>\nxdotool type \"mysql\";<br \/>\nxdotool key Return<br \/>\n<\/code><br \/>\nThis opens new tab of same terminal.<\/p>\n<p>1)<em>xdotool key alt+t space;<\/em><br \/>\nThe &#8220;key&#8221; keyword&#8221; tells xdotool that next inputs are treated as keys. So it opens &#8220;set title&#8221; pop up.(As Alt+t and space would do)<br \/>\n<\/br><br \/>\n2)<em>xdotool type &#8220;etc&#8221;;<\/em><br \/>\nxdotool key Return;<\/p>\n<p>The &#8220;type&#8221; keyword tells that the next inputs are treated as text.And then enter key is simulated<br \/>\nHence naming my tab &#8220;etc&#8221;<br \/>\n<\/br><br \/>\n3)<em>xdotool key ctrl+t alt+t space;<\/em><br \/>\nOpens   new tab (I  made ctrl+t  shortcut for opening new tab in same terminal) and opens &#8220;set title&#8221; pop up<br \/>\n<\/br><br \/>\n4)<em>xdotool type &#8220;grails&#8221;;<\/em><br \/>\nAnd the tab is named as grails.  And So on..<br \/>\n<\/br><br \/>\nThis helps me save time. hope it helps you too.<\/p>\n<p>_________________________________<br \/>\n<em>Hitesh Bhatia<\/em><\/p>\n<p><a href=\"mailto:hitesh@intelligrape.com?subject=Feedback On Blog\">Mail<\/a><\/p>\n<p>LinkedIn,<a href=\"http:\/\/www.facebook.com\/home.php?#!\/profile.php?id=100000114437286\" target=\"_blank\">Facebook<\/a>,<a href=\"http:\/\/twitter.com\/d1_ricky\" target=\"_blank\">Twitter<\/a><\/p>\n<p>_________________________________<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Xdotool is a tool that simulates user key movements.) Usually when we start to work , we usually require some apps to be running. In my case I have to run a grails app, sql , subversion and IDE in different tabs of same terminal. Normally it would take almost 1-2 minutes if I do [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":23},"categories":[1],"tags":[448,8,450,449],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2015"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=2015"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2015\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=2015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=2015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=2015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}