[Solved] Gnome-Shell and separating programs in the program switcher

Hi,
I would like to treat different instances of Emacs as different programs in Super-Tab program switcher in Gnome-Shell (I run mail and music in different instances).
In the overview they show as different programs via .desktop files.  But with Super-Tab they always collapse into one program (always with the normal Emacs icon).
Any tips on how to tell gnome that different instances of some program is are to be considered different applications?
Here's an example of a desktop file that I use to start a "specialized" Emacs instance.
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=EMMS
GenericName=Music Player
GenericName[es]=Reproductor de música
Comment=The Emacs Multimedia System.
Exec=emacsclient -s emms -ca '' --eval "(progn (setq x-resource-class \"EMMS\") (emms-smart-browse) )" -F '((title . "EMMS") (icon-type . "/home/rasmus/.local/share/icons/emms.png"))'
Icon=emms
Terminal=false
Type=Application
StartupNotify=true
Categories=AudioVideo;Player;Audio;
Last edited by Pank (2015-05-28 14:35:58)

Thanks.  Now, I'm calling (p-wm_class "EMMS") from my emms.desktop file now.  There's also text under the icon now.  Thanks a lot
Here's the defun:
(defun p-wm_class (&optional new-class)
"Return the WM_CLASS for the current window name.
If NEW-CLASS is a string or list of strings, set a new WM_CLASS.
If NEW-CLASS is non-nil remove Emacs from WM_CLASS and
WM_CLASS has more than one value."
(let ((old-class
(with-temp-buffer
(save-excursion
(call-process-shell-command
(format "xprop -name %s -f WM_CLASS 8s"
x-resource-class)
nil t))
(when (search-forward "WM_CLASS" nil t)
(search-forward "=" (line-end-position))
(split-string-and-unquote
(buffer-substring (point)
(line-end-position))
"[ \t,]"))))
;; anyway don't know how to set more than one value...
(new-class-string (cond ((and (listp new-class)
(cl-every 'stringp new-class))
(mapconcat 'identity
new-class ", "))
((stringp new-class)
new-class))))
(or
(cond ((stringp new-class)
(call-process-shell-command
(format "xprop -name %s -f WM_CLASS 8s -set WM_CLASS \"%s\""
x-resource-class
new-class))
new-class)
((and new-class (member-ignore-case "Emacs" old-class))
(call-process-shell-command
(format "xprop -name %s -f WM_CLASS 8s -set WM_CLASS \"%s\""
x-resource-class
(car (delete "emacs" (delete "Emacs" old-class)))))
(car (delete "emacs" (delete "Emacs" old-class)))))
old-class)))

Similar Messages

  • [SOLVED]Gnome-shell won't start

    Hello. I cant start Gnome-shell and it force to Fallback. In addition to, in the Fallback mode, i can't change any parameters of gnome.
    get this message when run the command:
    gnome-shell --replace
    (gnome-shell:18571): Gdk-WARNING **: The program 'gnome-shell' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadRequest (invalid request code or no such operation)'.
    (Details: serial 132 error_code 1 request_code 139 minor_code 66)
    (Note to programmers: normally, X errors are reported asynchronously;
    that is, you will receive the error a while after causing it.
    To debug your program, run it with the GDK_SYNCHRONIZE environment
    variable to change this behavior. You can then get a meaningful
    backtrace from your debugger if you break on the gdk_x_error() function.)
    I have ATI Graphic card and installed Catalyst 12.4
    How can i fix it?
    Last edited by vahid5695 (2012-07-03 07:07:25)

    demizer wrote:
    Not enough information.
    Are you starting Gnome through startx or GDM?
    What is contained in .xsession-errors?
    Do you have the testing repo enabled in pacman.conf?
    Sorry for that i am new in GNU/Linux world and I didnt know what information had been needed.
    Thank you for your answer.
    I use GDM.
    Testing repo is not enable.
    and the .xsession-errors is:
    [vahid@arch ~]$ cat .xsession-errors
    /etc/gdm/Xsession: Beginning session setup...
    localuser:vahid being added to access control list
    /etc/gdm/Xsession: Setup done, will execute: /usr/bin/ssh-agent -- gnome-session
    gnome-session[779]: WARNING: Session 'gnome' runnable check failed: Exited with code 1
    GNOME_KEYRING_CONTROL=/home/vahid/.cache/keyring-hA8Z7l
    SSH_AUTH_SOCK=/home/vahid/.cache/keyring-hA8Z7l/ssh
    GNOME_KEYRING_CONTROL=/home/vahid/.cache/keyring-hA8Z7l
    SSH_AUTH_SOCK=/home/vahid/.cache/keyring-hA8Z7l/ssh
    GNOME_KEYRING_CONTROL=/home/vahid/.cache/keyring-hA8Z7l
    SSH_AUTH_SOCK=/home/vahid/.cache/keyring-hA8Z7l/ssh
    GPG_AGENT_INFO=/home/vahid/.cache/keyring-hA8Z7l/gpg:0:1
    GNOME_KEYRING_CONTROL=/home/vahid/.cache/keyring-hA8Z7l
    SSH_AUTH_SOCK=/home/vahid/.cache/keyring-hA8Z7l/ssh
    (gnome-panel:855): Gtk-CRITICAL **: gtk_accelerator_parse_with_keycode: assertion `accelerator != NULL' failed
    ** (gnome-panel:855): WARNING **: Unable to parse mouse modifier '(null)'
    Failed to play sound: File or data not found
    Initializing tracker-store...
    ** (nm-applet:876): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: Launch helper exited with unknown return code 1
    ** Message: applet now removed from the notification area
    Initializing tracker-miner-fs...
    ** (nm-applet:876): WARNING **: fetch_connections_done: error fetching connections: (25) Launch helper exited with unknown return code 1.
    ** (nm-applet:876): WARNING **: Failed to register as an agent: (25) Launch helper exited with unknown return code 1
    Tracker-Message: Setting up monitor for changes to config file:'/home/vahid/.config/tracker/tracker-store.cfg'
    Tracker-Message: Setting up monitor for changes to config file:'/home/vahid/.config/tracker/tracker-miner-fs.cfg'
    ** Message: Starting applet secret agent because GNOME Shell disappeared
    ** (nm-applet:876): WARNING **: Failed to register as an agent: (25) Launch helper exited with unknown return code 1
    Starting log:
    File:'/home/vahid/.local/share/tracker/tracker-miner-fs.log'
    Tracker-Message: Setting up monitor for changes to config file:'/home/vahid/.config/tracker/tracker-store.cfg'
    Starting log:
    File:'/home/vahid/.local/share/tracker/tracker-store.log'
    ** Message: applet now embedded in the notification area
    (nm-applet:876): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -23 and height 27
    ** Message: applet now removed from the notification area
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    kbuildsycoca4 running...
    kbuildsycoca4(980) KBuildSycoca::checkTimestamps: checking file timestamps
    kbuildsycoca4(980) KBuildSycoca::checkTimestamps: timestamps check ok
    kbuildsycoca4(980) kdemain: Emitting notifyDatabaseChanged ()
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.

  • Gnome-shell and keyboard shortcuts

    So, I'm relatively new to gnome-shell, and I've noticed this :
    If I run my session, I can use any of my keybindings, for example to make screenshots, open guake terminal ( I've really missed transparency ), etc.
    If I launch any of my apps, the keybindings still work.
    If I quit all the running apps, the keybindings stop to work.
    I must either RUN A NEW APP or GO TO THE TOP-LEFT HOTSPOT THING in order to have my keybindings back.
    If I close the apps again, or in the second case I leave the top-left corner with the mouse cursor, keybindings die again.
    The only case when it works is at the beginning of the session, when nothing is opened yet.
    Quitting the session and reopening again solves the problem.
    I know, gnome-shell is new. But I really miss gnome2.xx.
    Last edited by scar (2011-06-18 18:14:37)

    Transparency: OK
    Upstream reported :OK
    I think, the shortcut problem is caused by the guake terminal,  see this post:
    https://bbs.archlinux.org/viewtopic.php?id=121419
    SOLVED?
    Last edited by scar (2011-06-27 17:16:50)

  • Hi when i use treeMap class and if i exit the program

    hi
    hi when i use treeMap class and if i exit the program,
    what will happen? the information that i put in the treeMap will be disappear??
    if it is like that,,how am i able to retrieve my data...when i restart my program..
    once i put ID as key and put my customer information,
    in it, after exit my program,, and i can't find
    my customers by their ID,,,,,,,,,how can,,i solve it......

    what will happen? the information that i put in the
    treeMap will be disappear??Yes. Of course. If you want data to hang around you have to tell the computer. If you want anything to happen you have to tell the computer.
    if it is like that,,how am i able to retrieve my
    data...when i restart my program..Tada! Tell the computer. Your simplest option is to use Serialization.
    Before exiting your program, serialize your TreeMap to disk. After starting your program serialize your TreeMap from disk.
    First stop should be your text book to learn what Serialization is and how it works, then try to write some code, then ask us to help with any problems.
    Dave.

  • [SOLVED] Gnome Shell Extensions won't install from website

    When I go to https://extensions.gnome.org/ from either Chromium or Firefox, extensions fail to install. If I click the toggle to turn a new extension "ON", nothing happens. Reloading the site switches it back to "OFF".
    I was able to install gnome-shell-extension-mediaplayer-git from the AUR. (Which also pulls in gnome-shell-extension-common-git.) It works fine. The problem is that most of the extensions on the AUR appear to be outdated and the users directed to the official site.
    This is a relatively new install of Arch and extensions have never worked. Maybe there's a package I'm missing? Or is there a way to get any debugging output? I'm not sure where to look.
    Last edited by ioos (2013-02-27 23:50:32)

    I found the following from AskUbuntu (not my own words, pasted from the source:
    I'll take a wild stab in the dark: If you're using Chrome/Chromium, navigate to about:plugins and make sure "Gnome Shell Integration" is enabled. Then navigate back to extensions.gnome.org and when the ribbon appears at the top make sure you "Always Allow for this Site"
    On Firefox you'll have to do something similar if you've turned extensions off. Browse to about:plugins and make sure libgnome-shell-browser-plugin.so is present / enabled. If it's not, upgrade Gnome Shell, or find it on your filesystem and link to it from to ~/.mozilla/plugins (you shouldn't have to do this though).
    Source

  • I just purchased Adobe Photoshop Elements 13 but my computer is not recognizing my CDRom and I cannot download the program. I tried copying the files on the program disc to my hard drive but get a message the installer will not work. I have the redemption

    I just purchased Adobe Photoshop Elements 13 but my PC is not recognizing my CDRom and I cannot download the program. I tried copying the files on the program disc to my hard drive but get a message the installer will not work. I have the redemption code and serial numbers. Can I download the program online somewhere? If I download a trial version for instance will it allow me to enter my serial number and use it for the full program?

    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.6| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • HT1199 Hai, i tried to open itunes on my windows 8 laptop but it comes out with 'iTunes has stop working' notification and need to close the program everytime i try to load it. Please help! thanks.

    Hai, i tried to open itunes on my windows 8 laptop but it comes out with 'iTunes has stop working' notification and need to close the program everytime i try to load it. Please help! thanks.

    Hi ajay-9,
    Thanks for visiting Apple Support Communities.
    The steps in this article can help if iTunes is quitting unexpectedly on your PC:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Cheers,
    Jeremy

  • Hello, what to do if a program crash? I was working in a power point presentation and suddenly the little rainbow circle appeared and can not close the program, thanks

    Hello, what to do if a program crash? I was working in a power point presentation and suddenly the little rainbow circle appeared and can not close the program, thanks

    Welcome to Apple Support Communities
    Press Alt, Command and Esc keys, select the crashed app and force quit it. Then, open this app again.
    If you didn't save this document, it's possible that you lost the changes you made unless you have OS X Lion or Mountain Lion and they saved your document automatically

  • Purchased aperture progam and downloaded onto desktop. recently purchased a macbook pro and want to transfer the program to new computer.  can it be done and how do I do it?

    I purchased the Aperture progam last year and downloaded to desk top Mac.  I now have a mac book pro and want to transfer the program.  Is it possible and How do I do it? 

    What is your Mac OS X version? And your Aperture Version?
    Did you buy from the App Store? When you downloaded Aperture from the App Store, you only need to sign into the App Store with the Apple ID you used to buy Aperture and to download it to your Mac Book Pro from the "Purchased" tab at the App Store. Your licence covers the installation on all your Macs for private purposes.
    If you bought a licence key from the Apple Store, not the App Store, copy the installer you downloaded to your Mac Book Pro and run it there. Then unlock Aperture with your licence key.
    Regards
    Léonie

  • Hi guys, I was presented with iPhone and then I rewrote the program, but right now, the ability to such a problem ..... want username and password

    hi guys, I was presented with iPhone and then I rewrote the program, but right now, the ability to such a problem ..... want username and password

    I don't understand. What "program" do you mean, and what do you mean by "rewrote"? If you mean that the iPhone has Activation Lock - that is, you restored the iPhone and now it's asking for the previous owner's Apple ID and password to activate the device - then you will need that information, or you'll need to get the previous owner to remove the device from his/her iCloud account:
    http://support.apple.com/kb/PH2702
    If you can't reach the previous owner or he/she is unwilling to cooperate, then the device is unusable by you.
    Regards.

  • I've paid for photoshop online and want to download the program. Where do I do it?

    I've paid for photoshop online and want to download the program. Where do I do it?

    I'll give it a try.
    Thanks.
    Martin

  • HT3805 I just installed Aperture 3 from a CD. i also imported my photos from my Iphoto library. After importing most of the photos imported are blurry and it tells me the program is "processing" and it never stops. What do I do?

    I just installed Aperture 3 from a CD. i also imported my photos from my Iphoto library. After importing most of the photos imported are blurry and it tells me the program is "processing" and it never stops. What do I do?

    I just installed Aperture 3 from a CD. i also imported my photos from my Iphoto library. After importing most of the photos imported are blurry and it tells me the program is "processing" and it never stops. What do I do?

  • Why can I download and install CS6beta but the program does not activate???

    Why can I download and install CS6beta but the program refuses to be activated on the idiotic grounds that either I am not connected to the internet or my computer clock is not showing the right time?  If in New Zealand we're not allowed to use the beta, why does Adobe not have the decency and courtesy of telling us so and why instead of feeding us with those stupid putoffs???    

    I had a note from PS Pattie ; I can't find it here.  Anyhow, these were her questions and my answers:
    Q:Did you download from this location?  http://labs.adobe.com/technologies/photoshopcs6/
    A: Yes
    Q:Did you select TRY and enter your Adobe ID?
    A: I was then asked to "Sign in". I pressed the sign and got the following reaction:
    Please connect to the internet and retry. Either your computer is offline or the clock on your computer is set incorrectly, causing a connection error.  An internet connection is required. Please connect to the internet or adjust your clock and try again.  If this problem persist, please contact Customer Support.  I did so and was told "This page is not available"
    Q: Did you try to download again and install?
    A:  Yes, three times – each time 1.71GB.  I tried many other devices; none worked.
    gw

  • When i downloaded itunes and try to launch the program it says a installed component is not installed. What does that mean?

    When i downloaded itunes and try to launch the program it says a installed component is not installed. What does that mean?

    Just in case the component being referenced is not part of iTunes but is rather part of one of the other related programs, it might be worth trying a complete uninstall/reinstall of iTunes and related componentry, as per the following troubleshooting document:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7

  • I transfered my Final Cut Pro from a macbook to a new macbook pro and i cant get the program to open.

    I transfered my Final Cut Pro from a macbook to a new macbook pro and i cant get the program to open. I have already uninstalled a reinstalled 4 times. What should I do?

    How did you transfer it?
    As a first step you should trash the preferences with http://www.digitalrebellion.com/prefman/

Maybe you are looking for