Gnome3 for the experienced (FUN Stuff!!!)

Discuss non-support related topics related to LMDE.
Forum rules
Before you post please read this

Are you interested in Gnome3/Gnome-Shell?

I'm interested in running/testing G-S...
231
55%
I'll run Gnome3, but not the Shell
51
12%
I'm staying with Gnome2 for now
105
25%
What's Gnome3??????
32
8%
 
Total votes : 419

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby cbowman57 on Tue Nov 08, 2011 10:52 am

That link is for a version that works in Gnome shell 3.2, not 3.0
cbowman57
Level 2
Level 2
 
Posts: 90
Joined: Mon Mar 14, 2011 7:46 pm

Linux Mint is funded by ads and donations.
 

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby xircon on Tue Nov 08, 2011 2:16 pm

Yes, I realised what the problem was, but was on the way out. Wrongly assumed that I was on the version as you guys :oops: Have started another thread, ZeroZero PM'd me.
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 773
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby cbowman57 on Tue Nov 08, 2011 2:29 pm

Yeah, it can get confusing during transitions.
cbowman57
Level 2
Level 2
 
Posts: 90
Joined: Mon Mar 14, 2011 7:46 pm

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby GeneC on Tue Nov 08, 2011 3:00 pm

I noticed that my 'Activites' Hot-spot is broken. I can still trigger the windows overlay with the keyboard (Windows "Super Key'), but nothing with mouse. I had edited the /usr/share/gnome-shell/js/ui/panel.js to remove the text (Activities) but that was some time back. Just stopped working today.

I tired putting text back in, but nothing at all shows up on panel?

I am using mgse-menu (Mint menu) extension, but am also using it on Oneiric, and all still works fine there?
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

1. LMDE(201303) - Gnome Shell 3.6/Cin. 1.8 - Testing
2. LMDE - XFCE 4.10 - SID

3. SolydXK/KDE 4.10-3/SID
(All 64bit multiarch, Nvidia 319.17 - Liquorix 3.8.xx)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1402
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby GregE on Tue Nov 08, 2011 7:08 pm

Gene,

Might I suggest just using tweak to turn off all the extensions and restart the shell. The issue with editing /usr/share/gnome-shell/js/ui/panel.js directly is that every time there is an update to Gnome-Shell it will more than likely overwrite it with a new one.

I have overdone the extensions a few times and introduced conflicts. You could also find the extension that moves the hot corner to the right and see if that brings it back.


:)

ps mgse should work fine on Oneiric as Oneiric is the basis for LinuxMint 12. It is making them function properly in LMDE that provides a small challenge.
User avatar
GregE
Level 4
Level 4
 
Posts: 418
Joined: Sun Jan 16, 2011 6:24 am
Location: Melbourne, Australia

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby GeneC on Tue Nov 08, 2011 8:23 pm

GregE wrote:Gene,

Might I suggest just using tweak to turn off all the extensions and restart the shell. The issue with editing /usr/share/gnome-shell/js/ui/panel.js directly is that every time there is an update to Gnome-Shell it will more than likely overwrite it with a new one.

I have overdone the extensions a few times and introduced conflicts. You could also find the extension that moves the hot corner to the right and see if that brings it back.


:)

ps mgse should work fine on Oneiric as Oneiric is the basis for LinuxMint 12. It is making them function properly in LMDE that provides a small challenge.


Thanks Greg :)
I had tried turning off extensions with no fix. But following your advice I removed several extensions that i didn't use. Notably msge bottom panel, window list, and a couple others. That did the trick. Hot-spot is working again, so there was a conflict there, that was not readily apparent. I did keep msge-menu, and it and others all work fine.
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

1. LMDE(201303) - Gnome Shell 3.6/Cin. 1.8 - Testing
2. LMDE - XFCE 4.10 - SID

3. SolydXK/KDE 4.10-3/SID
(All 64bit multiarch, Nvidia 319.17 - Liquorix 3.8.xx)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1402
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby GregE on Wed Nov 09, 2011 12:24 am

Tweak Tool 3.2.1-1 is in experimental and it works.
User avatar
GregE
Level 4
Level 4
 
Posts: 418
Joined: Sun Jan 16, 2011 6:24 am
Location: Melbourne, Australia

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby GregE on Thu Nov 10, 2011 5:41 am

Just for interest .....
Debian have announced on Google Plus that Gnome 3.0 is now wholly available in testing.
User avatar
GregE
Level 4
Level 4
 
Posts: 418
Joined: Sun Jan 16, 2011 6:24 am
Location: Melbourne, Australia

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby viking777 on Fri Nov 11, 2011 2:07 pm

Thanks to GregE's advice re Nvidia drivers, I just got my first look at Gnome 3 today and I must say, I think it is great! Now I have to be careful here, because I have only been using it for about an hour and that is not enough time to find out all the shortcomings, and it is like Christmas, new presents always look good at first sight, but you never know how long that is going to last. But even taking that into account, there are still several things that I would like to keep from this DE. The first and most important is that it is very 'mouse' dependent. That suits me wonderfully. My first choice for interacting with any computer is the mouse, by a long way. Second is the keyboard and third, a long way behind, is the touch screen. The activites hotspot for me then is superb, it suits my way of working perfectly.

The next very important thing that Gnome3 has done is to hide the lower panel by default. The default gnome way of having an upper and lower panel both visible at the same time has stopped my from using it for years (well actually it hasn't because I just delete the lower panel, but this is an equally good solution - and yes I know I could have done it myself but I didn't). The last thing that impresses me is that the horrible, horrible gnome menu has gone - what an absolute relief - not being able to find your programs at all is better than having to look at that dreadful thing.

I have even gone as far as reinstalling Evolution (I always delete it if it is installed by default) in order to have the excellent calendar application on the top panel display my appointments, and very well it works too though I haven't discovered if it displays reminders in advance of appointments, it probably does but I haven't found out how yet.

So all in all I am very impressed, but watch this space because I am also very fickle :lol:
Fujitsu Lifebook AH532 Laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Ubuntu12.10 (Unity), Mint14 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 13
Level 13
 
Posts: 4916
Joined: Mon Dec 01, 2008 11:21 am

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby xircon on Fri Nov 11, 2011 7:10 pm

@Viking +1

I like it, between us we can iron out the kinks and make it work. I come from a background of KDE use, only been using Gnome since I installed LMDE.

The only problem I have is I am running hot hot hot :)
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"
User avatar
xircon
Level 5
Level 5
 
Posts: 773
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby zerozero on Fri Nov 11, 2011 8:20 pm

viking777 wrote: I just got my first look at Gnome 3 today and I must say, I think it is great!

that is surprising (to me) :lol: :lol: but anyway welcome to the shell and enjoy it while it lasts :mrgreen:
User avatar
zerozero
Level 16
Level 16
 
Posts: 6302
Joined: Tue Jul 07, 2009 2:29 pm

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby michaelzap on Fri Nov 11, 2011 8:26 pm

For those of you who want to better understand what the GNOME team was trying to do with Shell:
http://live.gnome.org/GnomeShell/Design/
michaelzap
Level 3
Level 3
 
Posts: 139
Joined: Sat Sep 11, 2010 9:32 pm

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby MALsPa on Fri Nov 11, 2011 11:11 pm

What a long thread! I've been seeing it popping up for some time now but hadn't taken a look at it because, although I've been playing around with Unity, I hadn't really taken a good look at GNOME 3 yet.

Well, I installed Fedora 16, and although I've gone with the KDE spin for the last two versions, I decided to go with GNOME this time.

GNOME Shell is quite nice! I guess I'll have to look through this thread and see what kinds of things you folks have uncovered. But just digging around on my own I've been able to set it up quite well, and I like the feel of it -- actually very nice for getting things done, or so it seems so far!
User avatar
MALsPa
Level 7
Level 7
 
Posts: 1940
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby viking777 on Sat Nov 12, 2011 7:21 am

I have spent ages looking around for ways to add gnome-shell-extensions to gnome-shell, but I just can't get it done :( I have the tweak tool installed but it shows no extensions because I can't get hold of any and I really want a shutdown button in my exit menu instead of suspend (idiotic idea that :evil: ) I know I can just hold down 'Alt' but I shouldn't have to. I have tried:

Code: Select all
sudo add-apt-repository ppa:webupd8team/gnome3


But all I get is:
Code: Select all
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 55, in <module>
    sp = SoftwareProperties()   
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 90, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 538, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)   
  File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 90, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template


I have tried some other ppa's as well but I get the same (or similar) every time. Neither can I add it through Synaptic because when I click on Settings>Repositories, nothing happens. I have also tried adding
Code: Select all
deb http://ppa.webupd8team/gnome3


to sources.list manually but then I get:
Code: Select all
E: Malformed line 8 in source list /etc/apt/sources.list (dist)
E: The list of sources could not be read.
Go to the repository dialog to correct the problem.
E: _cache->open() failed, please report.


Can anyone help me out?
Fujitsu Lifebook AH532 Laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Ubuntu12.10 (Unity), Mint14 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 13
Level 13
 
Posts: 4916
Joined: Mon Dec 01, 2008 11:21 am

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby zerozero on Sat Nov 12, 2011 7:55 am

viking, :)
LMDE doesn't suport add-apt, you could add that repo manually to your sources.list, but would be of no good anyway because the extensions in there are for gtk3.2, and we are still in gtk3.0.
(edit= now i saw that you tried also to add it manually, but gave error), yeahh the repos address is
Code: Select all
deb http://ppa.launchpad.net/webupd8team/gnome3/ubuntu oneiric main
deb-src http://ppa.launchpad.net/webupd8team/gnome3/ubuntu oneiric main

https://launchpad.net/~webupd8team/+archive/gnome3

but, back to the point, here viewtopic.php?f=201&t=85102 you have some tweaks and tricks to our shell v. and the power off extension is on fpmurphy's
User avatar
zerozero
Level 16
Level 16
 
Posts: 6302
Joined: Tue Jul 07, 2009 2:29 pm

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby viking777 on Sat Nov 12, 2011 8:52 am

[quote="zerozero":****]viking, :)
LMDE doesn't suport add-apt, you could add that repo manually to your sources.list, but would be of no good anyway because the extensions in there are for gtk3.2, and we are still in gtk3.0.
(edit= now i saw that you tried also to add it manually, but gave error), yeahh the repos address is
[code:****]deb http://ppa.launchpad.net/webupd8team/gnome3/ubuntu oneiric main
deb-src http://ppa.launchpad.net/webupd8team/gnome3/ubuntu oneiric main [/code:****]
https://launchpad.net/~webupd8team/+archive/gnome3

but, back to the point, here viewtopic.php?f=201&t=85102 you have some tweaks and tricks to our shell v. and the power off extension is on fpmurphy's[/quote:****]

Zerozero, or anyone else that can help. Trying to follow the suggestions on fpmurphy's site I have trashed the entire gnome 3 installation and sadly, as I only got it yesterday I don't have a backup :( .

Could somebody copy and paste the entire contents of the following file (providing you haven't modified it in any way) so I can replace my broken copy with a working one:

/usr/share/gnome-shell/js/ui/statusMenu.js

TIA.
Fujitsu Lifebook AH532 Laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Ubuntu12.10 (Unity), Mint14 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 13
Level 13
 
Posts: 4916
Joined: Mon Dec 01, 2008 11:21 am

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby GeneC on Sat Nov 12, 2011 9:02 am

Viking.

Here is mine, but just to make sure.
Your on LMDE-Testing-Gnome3.0?

This is the first time I have opened this file, so I am pretty sure its 'stock'.
Use at your own risk.

/usr/share/gnome-shell/js/ui/statusMenu.js

Code: Select all
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */

const Gdm = imports.gi.Gdm;
const DBus = imports.dbus;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Tp = imports.gi.TelepathyGLib;
const UPowerGlib = imports.gi.UPowerGlib;
const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext;

const GnomeSession = imports.misc.gnomeSession;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Util = imports.misc.util;

const BUS_NAME = 'org.gnome.ScreenSaver';
const OBJECT_PATH = '/org/gnome/ScreenSaver';

const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
const DISABLE_USER_SWITCH_KEY = 'disable-user-switching';
const DISABLE_LOCK_SCREEN_KEY = 'disable-lock-screen';
const DISABLE_LOG_OUT_KEY = 'disable-log-out';

const ScreenSaverInterface = {
    name: BUS_NAME,
    methods: [ { name: 'Lock', inSignature: '' } ]
};

let ScreenSaverProxy = DBus.makeProxyClass(ScreenSaverInterface);

// Adapted from gdm/gui/user-switch-applet/applet.c
//
// Copyright (C) 2004-2005 James M. Cape <jcape@ignore-your.tv>.
// Copyright (C) 2008,2009 Red Hat, Inc.

function StatusMenuButton() {
    this._init();
}

StatusMenuButton.prototype = {
    __proto__: PanelMenu.Button.prototype,

    _init: function() {
        PanelMenu.Button.prototype._init.call(this, 0.0);
        let box = new St.BoxLayout({ name: 'panelStatusMenu' });
        this.actor.set_child(box);

        this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });

        this._gdm = Gdm.UserManager.ref_default();
        this._gdm.queue_load();

        this._user = this._gdm.get_user(GLib.get_user_name());
        this._presence = new GnomeSession.Presence();
        this._presenceItems = {};
        this._session = new GnomeSession.SessionManager();

        this._account_mgr = Tp.AccountManager.dup()

        this._upClient = new UPowerGlib.Client();
        this._screenSaverProxy = new ScreenSaverProxy(DBus.session, BUS_NAME, OBJECT_PATH);
        this.actor.connect('destroy', Lang.bind(this, this._onDestroy));

        this._iconBox = new St.Bin();
        box.add(this._iconBox, { y_align: St.Align.MIDDLE, y_fill: false });

        let textureCache = St.TextureCache.get_default();
        this._availableIcon = new St.Icon({ icon_name: 'user-available', style_class: 'popup-menu-icon' });
        this._busyIcon = new St.Icon({ icon_name: 'user-busy', style_class: 'popup-menu-icon' });
        this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible', style_class: 'popup-menu-icon' });
        this._idleIcon = new St.Icon({ icon_name: 'user-idle', style_class: 'popup-menu-icon' });

        this._presence.connect('StatusChanged', Lang.bind(this, this._updatePresenceIcon));
        this._presence.getStatus(Lang.bind(this, this._updatePresenceIcon));

        this._name = new St.Label();
        box.add(this._name, { y_align: St.Align.MIDDLE, y_fill: false });
        this._userLoadedId = this._user.connect('notify::is-loaded', Lang.bind(this, this._updateUserName));
        this._userChangedId = this._user.connect('changed', Lang.bind(this, this._updateUserName));

        this._createSubMenu();
        this._gdm.connect('notify::is-loaded', Lang.bind(this, this._updateSwitchUser));
        this._gdm.connect('user-added', Lang.bind(this, this._updateSwitchUser));
        this._gdm.connect('user-removed', Lang.bind(this, this._updateSwitchUser));
        this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
                                       Lang.bind(this, this._updateSwitchUser));
        this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
                                       Lang.bind(this, this._updateLogout));
        this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
                                       Lang.bind(this, this._updateLockScreen));
        this._updateSwitchUser();
        this._updateLogout();
        this._updateLockScreen();

        this._upClient.connect('notify::can-suspend', Lang.bind(this, this._updateSuspendOrPowerOff));
    },

    _onDestroy: function() {
        this._user.disconnect(this._userLoadedId);
        this._user.disconnect(this._userChangedId);
    },

    _updateUserName: function() {
        if (this._user.is_loaded)
          this._name.set_text(this._user.get_real_name());
        else
          this._name.set_text("");
    },

    _updateSessionSeparator: function() {
        let showSeparator = this._loginScreenItem.actor.visible ||
                            this._logoutItem.actor.visible ||
                            this._lockScreenItem.actor.visible;
        if (showSeparator)
            this._sessionSeparator.actor.show();
        else
            this._sessionSeparator.actor.hide();
    },

    _updateSwitchUser: function() {
        let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
        if (allowSwitch && this._gdm.can_switch ())
            this._loginScreenItem.actor.show();
        else
            this._loginScreenItem.actor.hide();
        this._updateSessionSeparator();
    },

    _updateLogout: function() {
        let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY);
        if (allowLogout)
            this._logoutItem.actor.show();
        else
            this._logoutItem.actor.hide();
        this._updateSessionSeparator();
    },

    _updateLockScreen: function() {
        let allowLockScreen = !this._lockdownSettings.get_boolean(DISABLE_LOCK_SCREEN_KEY);
        if (allowLockScreen)
            this._lockScreenItem.actor.show();
        else
            this._lockScreenItem.actor.hide();
        this._updateSessionSeparator();
    },

    _updateSuspendOrPowerOff: function() {
        this._haveSuspend = this._upClient.get_can_suspend();

        if (!this._suspendOrPowerOffItem)
            return;

        // If we can't suspend show Power Off... instead
        // and disable the alt key
        if (!this._haveSuspend) {
            this._suspendOrPowerOffItem.updateText(_("Power Off..."), null);
        } else {
            this._suspendOrPowerOffItem.updateText(_("Suspend"), _("Power Off..."));
        }
    },

    _updatePresenceIcon: function(presence, status) {
        if (status == GnomeSession.PresenceStatus.AVAILABLE)
            this._iconBox.child = this._availableIcon;
        else if (status == GnomeSession.PresenceStatus.BUSY)
            this._iconBox.child = this._busyIcon;
        else if (status == GnomeSession.PresenceStatus.INVISIBLE)
            this._iconBox.child = this._invisibleIcon;
        else
            this._iconBox.child = this._idleIcon;

        for (let itemStatus in this._presenceItems)
            this._presenceItems[itemStatus].setShowDot(itemStatus == status);
    },

    _createSubMenu: function() {
        let item;

        item = new PopupMenu.PopupImageMenuItem(_("Available"), 'user-available');
        item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.AVAILABLE));
        this.menu.addMenuItem(item);
        this._presenceItems[GnomeSession.PresenceStatus.AVAILABLE] = item;

        item = new PopupMenu.PopupImageMenuItem(_("Busy"), 'user-busy');
        item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.BUSY));
        this.menu.addMenuItem(item);
        this._presenceItems[GnomeSession.PresenceStatus.BUSY] = item;

        item = new PopupMenu.PopupSeparatorMenuItem();
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupMenuItem(_("My Account"));
        item.connect('activate', Lang.bind(this, this._onMyAccountActivate));
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupMenuItem(_("System Settings"));
        item.connect('activate', Lang.bind(this, this._onPreferencesActivate));
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupSeparatorMenuItem();
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupMenuItem(_("Lock Screen"));
        item.connect('activate', Lang.bind(this, this._onLockScreenActivate));
        this.menu.addMenuItem(item);
        this._lockScreenItem = item;

        item = new PopupMenu.PopupMenuItem(_("Switch User"));
        item.connect('activate', Lang.bind(this, this._onLoginScreenActivate));
        this.menu.addMenuItem(item);
        this._loginScreenItem = item;

        item = new PopupMenu.PopupMenuItem(_("Log Out..."));
        item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
        this.menu.addMenuItem(item);
        this._logoutItem = item;

        item = new PopupMenu.PopupSeparatorMenuItem();
        this.menu.addMenuItem(item);
        this._sessionSeparator = item;

        item = new PopupMenu.PopupAlternatingMenuItem(_("Suspend"),
                                                      _("Power Off..."));
        this.menu.addMenuItem(item);
        this._suspendOrPowerOffItem = item;
        item.connect('activate', Lang.bind(this, this._onSuspendOrPowerOffActivate));
        this._updateSuspendOrPowerOff();
    },

    _setPresenceStatus: function(item, event, status) {
        this._presence.setStatus(status);

        this._setIMStatus(status);
    },

    _onMyAccountActivate: function() {
        Main.overview.hide();
        let app = Shell.AppSystem.get_default().get_app('gnome-user-accounts-panel.desktop');
        app.activate(-1);
    },

    _onPreferencesActivate: function() {
        Main.overview.hide();
        let app = Shell.AppSystem.get_default().get_app('gnome-control-center.desktop');
        app.activate(-1);
    },

    _onLockScreenActivate: function() {
        Main.overview.hide();
        this._screenSaverProxy.LockRemote();
    },

    _onLoginScreenActivate: function() {
        Main.overview.hide();
        this._gdm.goto_login_session();
        this._onLockScreenActivate();
    },

    _onQuitSessionActivate: function() {
        Main.overview.hide();
        this._session.LogoutRemote(0);
    },

    _onSuspendOrPowerOffActivate: function() {
        Main.overview.hide();

        if (this._haveSuspend &&
            this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
            this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
                this._upClient.suspend_sync(null);
            }));
        } else {
            this._session.ShutdownRemote();
        }
    },

    _setIMStatus: function(session_status) {
        let [presence_type, presence_status, msg] = this._account_mgr.get_most_available_presence();
        let type, status;

        // We change the IM presence only if there are connected accounts
        if (presence_type == Tp.ConnectionPresenceType.UNSET ||
            presence_type == Tp.ConnectionPresenceType.OFFLINE ||
            presence_type == Tp.ConnectionPresenceType.UNKNOWN ||
            presence_type == Tp.ConnectionPresenceType.ERROR)
          return;

        if (session_status == GnomeSession.PresenceStatus.AVAILABLE) {
            type = Tp.ConnectionPresenceType.AVAILABLE;
            status = "available";
        }
        else if (session_status == GnomeSession.PresenceStatus.BUSY) {
            type = Tp.ConnectionPresenceType.BUSY;
            status = "busy";
        }
        else {
          return;
        }

        this._account_mgr.set_all_requested_presences(type, status, msg);
    }
};


EDIT:
Changed from "Quote" to "Code" to save space and show proper formatting.
Last edited by GeneC on Thu Nov 17, 2011 1:41 pm, edited 1 time in total.
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

1. LMDE(201303) - Gnome Shell 3.6/Cin. 1.8 - Testing
2. LMDE - XFCE 4.10 - SID

3. SolydXK/KDE 4.10-3/SID
(All 64bit multiarch, Nvidia 319.17 - Liquorix 3.8.xx)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1402
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby zerozero on Sat Nov 12, 2011 9:03 am

i have made same changes to the shell (not directly to this file)
Code: Select all
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */

const Gdm = imports.gi.Gdm;
const DBus = imports.dbus;
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Tp = imports.gi.TelepathyGLib;
const UPowerGlib = imports.gi.UPowerGlib;
const Gettext = imports.gettext.domain('gnome-shell');
const _ = Gettext.gettext;

const GnomeSession = imports.misc.gnomeSession;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Util = imports.misc.util;

const BUS_NAME = 'org.gnome.ScreenSaver';
const OBJECT_PATH = '/org/gnome/ScreenSaver';

const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
const DISABLE_USER_SWITCH_KEY = 'disable-user-switching';
const DISABLE_LOCK_SCREEN_KEY = 'disable-lock-screen';
const DISABLE_LOG_OUT_KEY = 'disable-log-out';

const ScreenSaverInterface = {
    name: BUS_NAME,
    methods: [ { name: 'Lock', inSignature: '' } ]
};

let ScreenSaverProxy = DBus.makeProxyClass(ScreenSaverInterface);

// Adapted from gdm/gui/user-switch-applet/applet.c
//
// Copyright (C) 2004-2005 James M. Cape <jcape@ignore-your.tv>.
// Copyright (C) 2008,2009 Red Hat, Inc.

function StatusMenuButton() {
    this._init();
}

StatusMenuButton.prototype = {
    __proto__: PanelMenu.Button.prototype,

    _init: function() {
        PanelMenu.Button.prototype._init.call(this, 0.0);
        let box = new St.BoxLayout({ name: 'panelStatusMenu' });
        this.actor.set_child(box);

        this._lockdownSettings = new Gio.Settings({ schema: LOCKDOWN_SCHEMA });

        this._gdm = Gdm.UserManager.ref_default();
        this._gdm.queue_load();

        this._user = this._gdm.get_user(GLib.get_user_name());
        this._presence = new GnomeSession.Presence();
        this._presenceItems = {};
        this._session = new GnomeSession.SessionManager();

        this._account_mgr = Tp.AccountManager.dup()

        this._upClient = new UPowerGlib.Client();
        this._screenSaverProxy = new ScreenSaverProxy(DBus.session, BUS_NAME, OBJECT_PATH);
        this.actor.connect('destroy', Lang.bind(this, this._onDestroy));

        this._iconBox = new St.Bin();
        box.add(this._iconBox, { y_align: St.Align.MIDDLE, y_fill: false });

        let textureCache = St.TextureCache.get_default();
        this._availableIcon = new St.Icon({ icon_name: 'user-available', style_class: 'popup-menu-icon' });
        this._busyIcon = new St.Icon({ icon_name: 'user-busy', style_class: 'popup-menu-icon' });
        this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible', style_class: 'popup-menu-icon' });
        this._idleIcon = new St.Icon({ icon_name: 'user-idle', style_class: 'popup-menu-icon' });

        this._presence.connect('StatusChanged', Lang.bind(this, this._updatePresenceIcon));
        this._presence.getStatus(Lang.bind(this, this._updatePresenceIcon));

        this._name = new St.Label();
        box.add(this._name, { y_align: St.Align.MIDDLE, y_fill: false });
        this._userLoadedId = this._user.connect('notify::is-loaded', Lang.bind(this, this._updateUserName));
        this._userChangedId = this._user.connect('changed', Lang.bind(this, this._updateUserName));

        this._createSubMenu();
        this._gdm.connect('notify::is-loaded', Lang.bind(this, this._updateSwitchUser));
        this._gdm.connect('user-added', Lang.bind(this, this._updateSwitchUser));
        this._gdm.connect('user-removed', Lang.bind(this, this._updateSwitchUser));
        this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
                                       Lang.bind(this, this._updateSwitchUser));
        this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
                                       Lang.bind(this, this._updateLogout));
        this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
                                       Lang.bind(this, this._updateLockScreen));
        this._updateSwitchUser();
        this._updateLogout();
        this._updateLockScreen();

        this._upClient.connect('notify::can-suspend', Lang.bind(this, this._updateSuspendOrPowerOff));
    },

    _onDestroy: function() {
        this._user.disconnect(this._userLoadedId);
        this._user.disconnect(this._userChangedId);
    },

    _updateUserName: function() {
        if (this._user.is_loaded)
          this._name.set_text(this._user.get_real_name());
        else
          this._name.set_text("");
    },

    _updateSessionSeparator: function() {
        let showSeparator = this._loginScreenItem.actor.visible ||
                            this._logoutItem.actor.visible ||
                            this._lockScreenItem.actor.visible;
        if (showSeparator)
            this._sessionSeparator.actor.show();
        else
            this._sessionSeparator.actor.hide();
    },

    _updateSwitchUser: function() {
        let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
        if (allowSwitch && this._gdm.can_switch ())
            this._loginScreenItem.actor.show();
        else
            this._loginScreenItem.actor.hide();
        this._updateSessionSeparator();
    },

    _updateLogout: function() {
        let allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY);
        if (allowLogout)
            this._logoutItem.actor.show();
        else
            this._logoutItem.actor.hide();
        this._updateSessionSeparator();
    },

    _updateLockScreen: function() {
        let allowLockScreen = !this._lockdownSettings.get_boolean(DISABLE_LOCK_SCREEN_KEY);
        if (allowLockScreen)
            this._lockScreenItem.actor.show();
        else
            this._lockScreenItem.actor.hide();
        this._updateSessionSeparator();
    },

    _updateSuspendOrPowerOff: function() {
        this._haveSuspend = this._upClient.get_can_suspend();

        if (!this._suspendOrPowerOffItem)
            return;

        // If we can't suspend show Power Off... instead
        // and disable the alt key
        if (!this._haveSuspend) {
            this._suspendOrPowerOffItem.updateText(_("Power Off..."), null);
        } else {
            this._suspendOrPowerOffItem.updateText(_("Suspend"), _("Power Off..."));
        }
    },

    _updatePresenceIcon: function(presence, status) {
        if (status == GnomeSession.PresenceStatus.AVAILABLE)
            this._iconBox.child = this._availableIcon;
        else if (status == GnomeSession.PresenceStatus.BUSY)
            this._iconBox.child = this._busyIcon;
        else if (status == GnomeSession.PresenceStatus.INVISIBLE)
            this._iconBox.child = this._invisibleIcon;
        else
            this._iconBox.child = this._idleIcon;

        for (let itemStatus in this._presenceItems)
            this._presenceItems[itemStatus].setShowDot(itemStatus == status);
    },

    _createSubMenu: function() {
        let item;

        item = new PopupMenu.PopupImageMenuItem(_("Available"), 'user-available');
        item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.AVAILABLE));
        this.menu.addMenuItem(item);
        this._presenceItems[GnomeSession.PresenceStatus.AVAILABLE] = item;

        item = new PopupMenu.PopupImageMenuItem(_("Busy"), 'user-busy');
        item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.BUSY));
        this.menu.addMenuItem(item);
        this._presenceItems[GnomeSession.PresenceStatus.BUSY] = item;

        item = new PopupMenu.PopupSeparatorMenuItem();
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupMenuItem(_("My Account"));
        item.connect('activate', Lang.bind(this, this._onMyAccountActivate));
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupMenuItem(_("System Settings"));
        item.connect('activate', Lang.bind(this, this._onPreferencesActivate));
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupSeparatorMenuItem();
        this.menu.addMenuItem(item);

        item = new PopupMenu.PopupMenuItem(_("Lock Screen"));
        item.connect('activate', Lang.bind(this, this._onLockScreenActivate));
        this.menu.addMenuItem(item);
        this._lockScreenItem = item;

        item = new PopupMenu.PopupMenuItem(_("Switch User"));
        item.connect('activate', Lang.bind(this, this._onLoginScreenActivate));
        this.menu.addMenuItem(item);
        this._loginScreenItem = item;

        item = new PopupMenu.PopupMenuItem(_("Log Out..."));
        item.connect('activate', Lang.bind(this, this._onQuitSessionActivate));
        this.menu.addMenuItem(item);
        this._logoutItem = item;

        item = new PopupMenu.PopupSeparatorMenuItem();
        this.menu.addMenuItem(item);
        this._sessionSeparator = item;

        item = new PopupMenu.PopupAlternatingMenuItem(_("Suspend"),
                                                      _("Power Off..."));
        this.menu.addMenuItem(item);
        this._suspendOrPowerOffItem = item;
        item.connect('activate', Lang.bind(this, this._onSuspendOrPowerOffActivate));
        this._updateSuspendOrPowerOff();
    },

    _setPresenceStatus: function(item, event, status) {
        this._presence.setStatus(status);

        this._setIMStatus(status);
    },

    _onMyAccountActivate: function() {
        Main.overview.hide();
        let app = Shell.AppSystem.get_default().get_app('gnome-user-accounts-panel.desktop');
        app.activate(-1);
    },

    _onPreferencesActivate: function() {
        Main.overview.hide();
        let app = Shell.AppSystem.get_default().get_app('gnome-control-center.desktop');
        app.activate(-1);
    },

    _onLockScreenActivate: function() {
        Main.overview.hide();
        this._screenSaverProxy.LockRemote();
    },

    _onLoginScreenActivate: function() {
        Main.overview.hide();
        this._gdm.goto_login_session();
        this._onLockScreenActivate();
    },

    _onQuitSessionActivate: function() {
        Main.overview.hide();
        this._session.LogoutRemote(0);
    },

    _onSuspendOrPowerOffActivate: function() {
        Main.overview.hide();

        if (this._haveSuspend &&
            this._suspendOrPowerOffItem.state == PopupMenu.PopupAlternatingMenuItemState.DEFAULT) {
            this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
                this._upClient.suspend_sync(null);
            }));
        } else {
            this._session.ShutdownRemote();
        }
    },

    _setIMStatus: function(session_status) {
        let [presence_type, presence_status, msg] = this._account_mgr.get_most_available_presence();
        let type, status;

        // We change the IM presence only if there are connected accounts
        if (presence_type == Tp.ConnectionPresenceType.UNSET ||
            presence_type == Tp.ConnectionPresenceType.OFFLINE ||
            presence_type == Tp.ConnectionPresenceType.UNKNOWN ||
            presence_type == Tp.ConnectionPresenceType.ERROR)
          return;

        if (session_status == GnomeSession.PresenceStatus.AVAILABLE) {
            type = Tp.ConnectionPresenceType.AVAILABLE;
            status = "available";
        }
        else if (session_status == GnomeSession.PresenceStatus.BUSY) {
            type = Tp.ConnectionPresenceType.BUSY;
            status = "busy";
        }
        else {
          return;
        }

        this._account_mgr.set_all_requested_presences(type, status, msg);
    }
};
User avatar
zerozero
Level 16
Level 16
 
Posts: 6302
Joined: Tue Jul 07, 2009 2:29 pm

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby viking777 on Sat Nov 12, 2011 9:25 am

Brilliant guys that got me going again, thanks very much. I would hate to lose the customisations I have made so far by reinstalling gnome-shell from scratch, this was a much better way to do it.

Now time to get Clonezilla out I think :)
Fujitsu Lifebook AH532 Laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Ubuntu12.10 (Unity), Mint14 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 13
Level 13
 
Posts: 4916
Joined: Mon Dec 01, 2008 11:21 am

Re: Gnome3 for the experienced (FUN Stuff!!!)

Postby viking777 on Sat Nov 12, 2011 2:26 pm

zerozero wrote:
viking777 wrote: I just got my first look at Gnome 3 today and I must say, I think it is great!

that is surprising (to me) :lol: :lol: but anyway welcome to the shell and enjoy it while it lasts :mrgreen:


I think it surprises me as well zerozero, but it is a fact. As an example, as you are already aware I broke gnome-shell earlier today and went back to fluxbox to post my plea for help. Now I have been using Fluxbox for a couple of years I guess, and whenever I am not using it I get annoyed when I right click on a desktop and don't get my own program menu showing up, but to tell you how fast gnome-shell has grown on me - I have been using it for less than 24 hours - but when I went back to Fluxbox I found myself sweeping my mouse up to the top left corner of the desktop and expecting a menu to appear!

2 years use of Fluxbox versus 24 hours use of gnome-shell, and I am 'conditioned' to do things the gnome-shell way. That says to me that the gnome-shell way has something going for it.

Of course it is not all roses, sweetness and light, .desktop files to add menu entries are pathetic compared to Fluxbox's plain text files, and the same goes for it's javascript config files, again Fluxbox is plain text. But at least gnome allows drag and drop onto the dash which is more than the likes of Xfce and Lxde allow you in their menus. For most people drag and drop would be all that is required, but not for power users, and I guess that is what I have become.
Fujitsu Lifebook AH532 Laptop. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Ubuntu12.10 (Unity), Mint14 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 13
Level 13
 
Posts: 4916
Joined: Mon Dec 01, 2008 11:21 am

Linux Mint is funded by ads and donations.
 
PreviousNext

Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 1 guest