[Solved] How to list recently used windows?

I like the Unity feature where a key binding either opens or focuses an application window. With KDE I can define a keyboard shortcut which, for example, performs
wmctrl -xa emacs.Emacs || emacs
However, I'd like it to focus on the last focused window, not the first opened window. Is there a command to list all windows in the order they were recently used? (Clearly the Task Switcher gets this information from somewhere.)
Last edited by raul_l (2014-12-16 16:58:24)

The command I was looking for is
xprop -root | grep "^_NET_CLIENT_LIST_STACKING"
If anyone is interested, this script
#!/bin/bash
app=$1
workspace=$(wmctrl -d | grep '\*' | cut -d ' ' -f1)
win_list=$(wmctrl -lx | grep $app | grep " $workspace " | awk '{print $1}')
IDs=$(xprop -root|grep "^_NET_CLIENT_LIST_STACKING" | tr "," " ")
IDs=(${IDs##*#})
for (( idx=${#IDs[@]}-1 ; idx>=0 ; idx-- )) ; do
for i in $win_list; do
if [ $((i)) = $((IDs[idx])) ]; then
wmctrl -ia $i
exit 0
fi
done
done
exit 1
in conjunction with the key binding
the_above_script.sh emacs.Emacs || emacs
produces the correct Unity behavior. (How to mark this thread solved?)
EDIT: I modified the script a little bit. It turns out wmctrl and xprop use slightly different formats for displaying hexadecimal numbers.
Last edited by raul_l (2014-12-17 12:08:07)

Similar Messages

  • After updating to iTunes 12  the Apple Mobile Device USB Driver is not listed, I use Windows 8.1, how can i solve this?

    After I updates ITunes to the latest version (12), ITunes wont find my iphone and Ipad anymore, after searching I found that the Apple Mobile Device USB Driver is not listed anymore, on the support website of Apple it doesnt explain how to solve this,.
    I use Windows 8.1 and so now also ITunes 12, both my Iphone 4S and Ipad Air have the latest IOS version.
    I hope anybody can tell me how to solve this that the Apple Mobile Device USB Driver is back, thank you

    Found a possible solution for me.
    While the phone was plugged into my computer and iTunes is CLOSED.
    1. I went to Services in Windows.
    2. I selected Apple Mobile Device and right clicked and selected "Stop".
    3. Then I right-clicked again and selected "Start".
    4. Then I went to Device Manager and right clicked my iPhone with the yellow alert icon and selected "Uninstall".  You will get a warning about uninstalling the device.  Click OK.
    5.  At the top of Device Manager I clicked the Action menu and selected "Scan for Hardware Changes".
    This re-installed the iPhone and everything started working again.

  • Clicking on Dock icon only brings most-recently-used window to front

    In Leopard, clicking on the iChat Dock icon would bring all iChat windows (contact lists, chats, etc.) in front of other open applications, and give focus to the most recently used iChat window.
    After installing Snow Leopard, clicking on the iChat Dock icon only brings the most recently used iChat window to the front and gives it focus -- other iChat windows remain behind other application windows (if that is where they were before).
    Is this just me? My friend tells me that it still behaves like it did in Leopard on his computer. Any ideas?

    In the First Post your Specs said Snow Leopard, now they say Tiger
    Sorry, I didn't realize it wouldn't remember that setting for me -- I am running Snow Leopard.
    With Chax in Leopard/iChat 4 an extra item was added to the Window menu of iChat that says "Always On top"
    No, this is not what I was looking for. I have another machine with Leopard, and it does not have Chax -- iChat windows are not always in front, but they all come to the front when clicking on the Dock icon.
    I don't use it on the Buddy List as you can set it on Any iChat window.
    What do you mean, "you can set it on Any iChat window"? You mean the Chax setting, or something else?
    Are any Minimised to the DOCK ?
    No, none are minimized to the Dock.
    Chax does not work in iChat 5 and may be the cause of the issue.
    There is a beta version of Chax for iChat 5.
    I would delete Chax and then the com.apple.ichat.plist to remove any thing in it that refers to Chax and then relaunch iChat.
    I deleted Chax and every Chax and iChat plist, then restarted my computer. The problem did not go away -- still, only one window comes to the front when I click on the iChat Dock icon -- the others stay behind other windows.

  • How to clean recent used fonts dropbox on Pages '09?

    Hi everyone!
    I've searched a lot but can't resolve this. I can't clear my recent used fonts on Pages '09. I'm not talking about the box opened with cmd+T, I'm talking about the dropbox next to the font size, bold, italic, etc.
    I've tried to delete the com.apple.iWork.Pages.plist but it only clears the cmd+T box.
    Could you guys help me?
    Thanks a lot!

    This list is stored in Pages preferences file.
    You may remove the entire array entitled : SFIFontCacheRecents
    or remove some fonts items.
    Yvan KOENIG (VALLAURIS, France) jeudi 26 avril 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • [Solved] How to list installed AUR packages ?

    Hi,
    I use "packer" to install AUR packages.
    How can I get a list of installed AUR packages ?
    Thanks for your help
    - PierreR
    Last edited by PierreR (2011-12-06 11:37:40)

    You should focus your Google searches to the forum
    site:bbs.archlinux.org how to list installed AUR packages
    https://www.google.com/search?q=site%3A … 78&bih=977 (I used your title for the search)
    You can set the settings to pick only the hits from e..g the last year.

  • CS3 How to recall recently used fonts

    How do I find the recently used fonts?
    Thanks.

    How many times are you going to ask? There's no recently used fonts
    feature in ID.
    Bob

  • [Solved] How to list which DNS I am using?

    Edit, solution to find which DNS you are using.  Install:
    sudo pacman -S dnsutils
    To get the "dig" command.  Then use it:
    dig http://www.google.ca
    And at the bottom of the output you will see
    SERVER:
    Which is immediately followed by the DNS you are using.
    Thank you x33a.
    Original post:
    I'm trying to use Google DNS which are 8.8.8.8, and 8.8.4.4.  I have a pure systemd installation and have the dhcpcd service unit active:
    [email protected] loaded active running dhcpcd on eth0
    In my /etc/dhcpcd.conf file I have the following:
    # A sample configuration for dhcpcd.
    # See dhcpcd.conf(5) for details.
    # Inform the DHCP server of our hostname for DDNS.
    hostname
    # To share the DHCP lease across OSX and Windows a ClientID is needed.
    # Enabling this may get a different lease than the kernel DHCP client.
    # Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box.
    #clientid
    # A list of options to request from the DHCP server.
    #option domain_name_servers, domain_name, domain_search, host_name
    option domain_name, domain_search, host_name
    option classless_static_routes
    nooption domain_name_servers
    # Most distributions have NTP support.
    option ntp_servers
    # Respect the network MTU.
    option interface_mtu
    # A ServerID is required by RFC2131.
    require dhcp_server_identifier
    # A hook script is provided to lookup the hostname if not set by the DHCP
    # server, but it should not be run by default.
    nohook resolv.conf
    nohook lookup-hostname
    noipv4ll
    With the only changes being "nooption domain_name_servers" and "nohook resolv.conf".
    Then in my /etc/resolv.conf I have the nameservers:
    # Generated by dhcpcd from eth0
    # /etc/resolv.conf.head can replace this line
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    #nameserver 192.168.0.1
    # /etc/resolv.conf.tail can replace this line
    /etc/resolv.conf has had "chattr +i" done to it to make it immutable from changes.
    I think I have it all set-up correctly, as in it all works, but I do not know of an explicit command to tell me exactly which DNS I am using.
    Last edited by headkase (2012-10-13 14:53:54)

    I switched my nameservers over to OpenDNS: http://www.opendns.com/
    Because they have a test page: http://www.opendns.com/welcome/
    And I got a successful result.  So, to change that all I modified were the nameserver numbers in "/etc/resolv.conf".  So, I assume that I configured "/etc/dhcpcd.conf" correctly.  With the OpenDNS nameservers those now come up as prepopulated in namebench too.  Thanks again, solved.

  • Firefox cannot be closed; the following message appears: "Can't load resource file, can not run". How to solve this problem; I am using Windows XP SP3

    Whwn I want to close Firefox 9.x , a pop-up appears with the message: "Can't load resource file ......" . First I have to close this pop-up, then Firefox is closed. Also with other versions of Firefox I had this problem.

    i deleted the rdf and now the first window only (and any tabs in it) are maximised. i found this in the rdf
    <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
    screenX="4"
    screenY="4"
    width="1008"
    height="461"
    sizemode="Normal" />
    i tried changing normal to maximised; no effect. either i need also to change the numbers (to match a maximised window) or ff ignores this. i want to be able to open different sites in different windows, and not have to maximise them manually. ff never used to be broken, why break this? what possible security flaw was fixed by screwing up ff to never open maximised unless u hack it or delete certain config files?

  • Since I use Firefox 4.0.1 I cannot save websites or photo's on websites and downloading from a website is also not working. If I click "save" or "save as" nothing happens. How to solve this ? I'm using Windows 7 home premium 32 bit

    If I right click on a downloadable photo on a website and ask to save, nothing happens, sometimes a dialogue box will ask me if I want to save it, I select yes but nothing happens. The same if I go to the menu in Firefox browser and ask to save a page, nothing happens. If I paste the same website address in my IE browser I can save and select savings location without any problem. The same for downloads.

    I have a year old Epson and an HP.. I upgraded to a win 7 64 bit and doing some sharing/networking.. Got some 32 bit XPand two win 7 64 bit..   The Epson ,shares and connects up  with no issues.. the HP is just a fiasco...   No more HP for me ...

  • [Solved]How to fix grub after Windows XP install?

    I installed Windows XP on top of Arch in a different partition.
    It looks something like this:
    /dev/sda1 - XP
    /dev/sda2 - Arch
    /dev/sda3 - Swap
    Grub is located on /dev/sda2/ in /boot/grub/
    Windows XP obviously overwritten the mbr like it normally does.
    I tried loading the arch live install cd, and trying grub-install /dev/sda and /dev/sda1 and /dev/sda2 but it doesn't do anything.
    I want to overwrite Windows XP's boot loader with grub and add XP as an option to boot. Can someone please give me noob friendly instructions on how to accomplish this with minimal effort? It's important I don't damage the XP or Arch partitions. Thanks for any help.
    Last edited by PrimoTurbo (2008-07-30 18:06:43)

    I fixed it! Nearly the same instructions as lucke gave but I just used the Arch Live cd. All I did was boot Arch Live cd, it presented me with grub and bunch of options. (I didn't even boot into the cd) just pressed C so it loaded the grub terminal.
    Then:
    find /boot/grub/stage1
    Which outputs:
    root (hdX,Y)
    (In my case it was hd0,1)
    Then:
    root (hdX,Y)
    [Don't forget there is space after root and (hdX,Y)]
    Finally:
    setup hd0

  • How to print when using Windows 8 Adobe Reader

    How does one print a simple .pdf document using Adobe Reader in Windows 8.  With the document open, the print button is visible on the tool bar but clinking on that only brings up the screen asking where do I want to save the document.  It is already saved...I just want to print it!  Clicking on file and then selecting print results in the same.  I've never had this problem before.  I have been a long time Adobe user but always WIndows 7 or Windows XP.  This Windows 8 is killing me.
    Thanks for any help you can offer!

    This sounds like you have 'Print to File' set; uncheck it (Advanced button on the Print panel).

  • How to list mappings used in flow

    Hi all
    Is there a table or view which will list all objects (mappings) used in a given processflow?
    Any tip appreciated
    KR
    Rolf

    This is a query on OWB public views. The external join is used to show missing links (dropped mappings)
    SELECT
    m.PROJECT_NAME, m.INFORMATION_SYSTEM_NAME, pa.PACKAGE_NAME,
    pr.process_name, a.activity_name, a.bound_object_id,
    CASE WHEN x.map_id IS NULL THEN
         '*** MISSING LINK: '|| a.bound_object_name
    ELSE
         '/'||isys.PROJECT_NAME||'/' || isys.INFORMATION_SYSTEM_NAME || '/' || x.map_name
    END bound_mapping
    FROM
    all_iv_process_activities a,
    all_iv_processes pr,
         all_iv_packages pa,
         all_iv_process_modules m,
         all_iv_xform_maps x,
         all_iv_information_systems isys
    WHERE a.activity_type = 'PlSqlMapProcessNoteTag'
         AND a.process_id = pr.process_id
         AND pr.package_id = pa.package_id
         AND pa.schema_id = m.information_system_id
         AND x.map_id (+) = a.bound_object_id
         AND isys.information_system_id (+) = x.information_system_id
    ORDER BY 1,2,3,4,5

  • [solved]How to unlock LUKS using keyfile on usbdrive during boot?

    Hi all,
    I would like some advise for booting encrypted partitions using kefiles on a flashdrive. I'm setting up a Intel Atom based homeserver, and and want my data to be encrypted in case the server gets stolen. To save some encryption overhead I prefer to leave root unencrypted and only encrypt /home, and if this works, later on /var, /tmp and swap as well. My plan is to have a keyfile on a flash thumbdrive, and only have the thumbdrive plugged in while booting.
    I have read the dm-crypt wiki page, but it assumes an encrypted root, and this approach won't work in my situation, where only non-root mountpoints are encrypted. If i put 'ASK' in /etc/crypttab I get prompted for the passphrase and the LUKS container unlocks and mounts fine. I can also unlock the LUKS container manually using the keyfile that I created. However when I put the path to the keyfile in /etc/crypttab instead of 'ASK', and let the usbdrive automount using an udev rule the unlock at boot fails. It seems that my udev rule is only executed when I plug in a drive after booting, not when it is already plugged in during boot. How would I accomplish this? Mount it with fstab and automatically unmount it after booting, or some entirely different way?
    my /etc/fstab:
    none /dev/pts devpts defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/sda1 / ext4 defaults 0 1
    /dev/sda2 swap swap defaults 0 0
    /dev/mapper/home /home ext4 defaults 0 1
    /etc/crypttab:
    home /dev/sda3 /media/usbhd-sdc1/keyfiles/arch_server_-_home.key
    /etc/udev/rules.d/01.usbdrive_automount.rules (sdb is a second, currently unused harddisk):
    KERNEL=="sd[b-z]", NAME:="%k", SYMLINK+="usbhd-%k", GROUP:="users", OPTIONS="last_rule"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", SYMLINK+="usbhd-%k", GROUP:="users", NAME:="%k"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mkdir -p /media/usbhd-%k"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", PROGRAM=="/sbin/blkid -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,dirsync,noexec,nodev,noatime,dmask=000,fmask=111 /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,async,dirsync,noexec,nodev,noatime /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
    ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/umount -l /media/usbhd-%k"
    ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/rmdir /media/usbhd-%k", OPTIONS="last_rule"
    <edit>
    Okay I have found a solution. The trick was to make sure the usbstick gets mounted first, so the keyfile is available for the unlocking/mounting during boot. To do so I have added 'usb' to the hooks line in /etc/mkinitcpio.conf and recompiled the initramfs as described in the wiki link above.
    Next I changed my /etc/udev/rules.d/01.usbdrive_automount.rules a little so that the mountpoint of the usbdrive stays after unplugging it:
    KERNEL=="sd[b-z]", NAME:="%k", SYMLINK+="usbhd-%k", GROUP:="users", OPTIONS="last_rule"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", SYMLINK+="usbhd-%k", GROUP:="users", NAME:="%k"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mkdir -p /media/usbhd-%k"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", PROGRAM=="/sbin/blkid -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,dirsync,noexec,nodev,noatime,dmask=000,fmask=111 /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
    ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,async,dirsync,noexec,nodev,noatime /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
    ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/umount -l /media/usbhd-%k", OPTIONS="last_rule"
    #ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/umount -l /media/usbhd-%k"
    #ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/rmdir /media/usbhd-%k", OPTIONS="last_rule"
    /etc/fstab:
    The usbdrive is put above the encrypted partition to make it get mounted first:
    none /dev/pts devpts defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/sdc1 /media/usbhd-sdc1 ext2 defaults 0 0
    /dev/sda1 / ext4 defaults 0 1
    /dev/sda2 swap swap defaults 0 0
    /dev/mapper/home /home ext4 defaults 0 1
    /etc/crypttab:
    home /dev/sda3 /media/usbhd-sdc1/keyfiles/arch_server_-_luks.key
    So now I plug in the flashdrive, turn on the server, unplug the flashdrive and udev automatically unmounts the flashdrive while leaving the mountpoint /media/usbhd-sdc1 for the next boot.
    </edit>
    Last edited by rwd (2009-12-04 19:36:14)

    graysky wrote:@ratcheer - You can try now if it's a major pain in the balls by enabling [testing] and using the updated linux package.
    If you do enable testing make sure you aren't like myself: I'm not competent enough to enable testing..
    Edit:
    To elaborate a bit.  If you enable testing and then just do a "pacman -Syu" then you are going to pull in all sorts of packages you may not want and it may be complicated to get rid of later.  To avoid this I would enable testing, do this:
    sudo pacman -Syy
    sudo pacman -S testing/linux
    So it would pull in the absolute minimum that I wanted from testing.  Then I would disable the testing repository and pacman -Syy again.  That would convert the new linux package and packages it requires to manual packages.  E.g. they would be shown under "pacman -Qm"
    Because once you start pulling packages in from testing it is almost a one-way street.  As I instructed above, that is my gross understanding.  I don't use testing at all, it is supposed to be used if you are actively testing Arch and providing feedback while doing so.
    Last edited by headkase (2012-10-03 01:51:51)

  • [SOLVED]How can I setWhereClause using a session value ?

    I have a session value that I want to use to pass as the bind variable to my Where clause on a View object.
    I have dragged the view from the data control pallete onto my page as an ADF form.
    I need to be able to set the Where clause of this view programmatically but I don't know where I should do this. Basically on entering this page the where clause should get set programmatically to the session value.
    I thought about creating a static block in my page's backing bean and doing it there but how would I access the view object from there ?
    Or should I create a Service method that sets the where clause and does an executeQuery and expose that to my page and execute it from my page's backing bean ?
    cheers

    Hi Dom,
    If you are using Oracle's binding layer - you could add a binding for "ExecuteWithParams" to the pagedef (right-click the bindings folder, add action binding, pick your View Object, choose execute with parameters as action); use an EL expression based upon sessionScope as the value for the bind variable.Then, add an invokeAction to the pageDef (right-click executables folder, choose invokeAction), specifying your executeWithParams binding as the binds property.
    Hope this gets you started.
    John

  • [Solved]How to list groups available

    I added my own user to my Arch setup. How would I get a list of available groups so I could add my user to them?
    Last edited by jordanwb (2008-09-08 02:01:18)

    Misfit138 wrote:
    kensai wrote:edit "/etc/group", add your username in front of the group you want to be in.
    hehe
    The 'Slackware Way'...
    Old habits, hard to break. Let me install Slackware on Virtualbox, I miss it.
    Last edited by kensai (2008-09-08 02:17:40)

Maybe you are looking for