<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Rofi on iMil.net</title>
    <link>http://imil.net/blog/tags/rofi/</link>
    <description>Recent content in Rofi on iMil.net</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 13 Jun 2020 08:36:10 +0200</lastBuildDate>
    <atom:link href="http://imil.net/blog/tags/rofi/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Rofi Window Switcher With XFCE (updated, now with icons)</title>
      <link>http://imil.net/blog/posts/2020/rofi-window-switcher-with-xfce/</link>
      <pubDate>Sat, 13 Jun 2020 08:36:10 +0200</pubDate>
      <guid>http://imil.net/blog/posts/2020/rofi-window-switcher-with-xfce/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://bugs.launchpad.net/ubuntu/+source/wmctrl/+bug/1641608&#34;&gt;This bug&lt;/a&gt; forbids &lt;a href=&#34;https://github.com/davatorium/rofi&#34;&gt;rofi&lt;/a&gt; &lt;em&gt;window&lt;/em&gt; mode to give focus to a selected window when &lt;em&gt;click to focus&lt;/em&gt; is disabled in &lt;a href=&#34;https://www.xfce.org/&#34;&gt;XFCE&lt;/a&gt;. Using the same trick the first commenter used, I came up with this script which uses &lt;a href=&#34;https://sites.google.com/site/tstyblo/wmctrl&#34;&gt;wmctrl&lt;/a&gt; to handle windows listing, selection and focus:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/sh&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;clicktofocus&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;xfconf-query -c xfwm4 -p /general/click_to_focus -s &amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$clicktofocus true&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;w&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;wmctrl -l|awk &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;{$1=$2=$3=&amp;#34;&amp;#34;; sub(/^[ \t]+/, &amp;#34;&amp;#34;); print $0}&amp;#39;&lt;/span&gt; | &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;&#x9;rofi -dmenu -i -p &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Window Switcher&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;wmctrl -a &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$w&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$clicktofocus false&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Not the prettiest method but it emulates &lt;code&gt;rofi -show window&lt;/code&gt; pretty well.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
