*

Welcome, Guest. Please login or register.
Did you miss your activation email?

Pages: [1]
Print
Author Topic: How do I disable the Journal activity?  (Read 9902 times)

How do I disable the Journal activity?

bc
Contributor
*
Posts: 37


January 25, 2008, 09:40:48 AM

I haven't been able to figure out how to disable the Journal activity (it's started automatically when Sugar starts up and there is no "Stop" option available for it). I know why it's there and how it can be used, but I don't want it to start up for the following reasons:

1. I NEVER use it
2. When I Alt-Tab through running Activities, it is one of the Activities that I have to skip over
3. It consumes resources (however minor this may be)

Has anyone figured out how to disable the Journal?

Thanks,
Bill
Logged

#1 Re: How do I disable the Journal activity?

Chris J
Senior Contributor
**
Posts: 189


January 25, 2008, 11:12:05 AM

You may not use the Journal, but the Sugar OS uses it all the time. There might be a way to hide it but disabling it will break the OS.

Just ignore it; it isn't hurting anything.
Logged

Chris J, identified on mesh neighborhood as Chris J when running Sugar emulation and Sabrina when using my daughter's XO. Currently using the xo1share.org jabber server. Located in San Luis Obispo, CA

#2 Re: How do I disable the Journal activity?

bc
Contributor
*
Posts: 37


January 25, 2008, 11:20:51 AM

You may not use the Journal, but the Sugar OS uses it all the time. There might be a way to hide it but disabling it will break the OS.

Just ignore it; it isn't hurting anything.

Sugar may need to write things to files for use by the journal; however, I don't see why the Journal Activity/UI needs to be loaded. I would like to be able to ignore it; however, it is "in my face" all the time (I use Alt-Tab to switch between Activities a lot. Typically, I'm running Opera and Terminal and I dislike having to Alt-Tab over the Journal activity).

Surely, there must be some way to disable the Journal UI?

- Bill
Logged

#3 Re: How do I disable the Journal activity?

Ben James Ben
Senior Contributor
**
Posts: 142



January 25, 2008, 12:38:46 PM

Hmmm... The Journal Activity is tightly integrated into Sugar, so I believe that it can't be disabled without causing major problems. However, there isn't any reason why it couldn't be removed from Sugar's Alt-Tab key "next activity" behavior.

In /usr/share/sugar/shell/view/keyhandler.py:
Code:
  55     '<alt>Tab'       : 'next_window',
  56     '<alt>n'         : 'next_window',
  57     '<ctrl><alt>Tab' : 'previous_window',
  58     '<alt>p'         : 'previous_window',

 139     def handle_previous_window(self):
 140         self._shell.activate_previous_activity()
 141
 142     def handle_next_window(self):
 143         self._shell.activate_next_activity()

In /usr/share/sugar/shell/view/Shell.py:
Code:
228     def activate_next_activity(self):
 229         home_model = self._model.get_home()
 230         activity = home_model.get_next_activity()
 231         if activity:
 232             self.take_activity_screenshot()
 233             activity.get_window().activate(1)

In /usr/share/sugar/shell/model/homemodel.py:
Code:
  90     def get_next_activity(self):
  91         activities = self._get_activities_with_window()
  92         i = activities.index(self._pending_activity)
  93         if len(activities) == 0:
  94              return None
  95         elif i + 1 < len(activities):
  96             return activities[i + 1]
  97         else:
  98             return activities[0]

So, it looks like it should be possible to have Sugar skip the Journal by editing activate_next_activity() and activate_previous_activity() to skip the activity if "activity.get_type() == 'org.laptop.JournalActivity'". A better way would be to override homemodel.get_next_activity() with another function and have Shell.activate_next_activity() call that other function. Something like this (though the if-else blocks need to be cleaned up):

Code:
     def get_next_activity_but_not_journal(self):
         activities = self._get_activities_with_window()
         i = activities.index(self._pending_activity)
         if len(activities) == 0:
              return None
         elif i + 1 < len(activities):
             if activities[i + 1].get_type() != 'org.laptop.JournalActivity':
                 return activities[i + 1]
             elif i + 2 < len(activities):
                 return activities[i + 2]
         else:
             if activities[0].get_type() != 'org.laptop.JournalActivity':
                 return activities[0]
             elif 1 < len(activities):
                 return activities[1]
             else:
                 return None
Logged

#4 Re: How do I disable the Journal activity?

Ben James Ben
Senior Contributor
**
Posts: 142



January 25, 2008, 01:02:13 PM

It would be much easier to override homemodel._get_activities_with_window() instead:

Code:
    def _get_activities_with_window(self):
        ret = []
        for i in self._activities:
            if i.get_window() is not None:
               ret.append(i)
        return ret

Code:
    def _get_activities_with_window_but_not_journal(self):
        ret = []
        for i in self._activities:
            if i.get_window() is not None and i.get_type() != 'org.laptop.JournalActivity':
               ret.append(i)
        return ret
Logged

#5 Re: How do I disable the Journal activity?

bc
Contributor
*
Posts: 37


January 25, 2008, 01:21:44 PM

It would be much easier to override homemodel._get_activities_with_window() instead:

Great - thanks!

- Bill
Logged

#6 Re: How do I disable the Journal activity?

unrequited
Senior Contributor
**
Posts: 120



January 25, 2008, 08:07:26 PM

It takes up a LOT of memory, and before I go on a long websurfing session, or even times when I'm viewing comics or ebooks, I'll kill it using root's killall -r Journal. Then when I'm done, I'll just restart Sugar.
Logged

-Unrequited

#7 Re: How do I disable the Journal activity?

Brian Callahan
Commenter

Posts: 8


January 26, 2008, 04:05:46 AM

Thanks, Ben! I had exactly the same situation as Bill. My laptop is much nicer to use now.
Logged

#8 Re: How do I disable the Journal activity?

Nick Tindall
Commenter

Posts: 22


Seeking enlightenment


January 28, 2008, 04:47:09 PM

I'm with Brian and Bill. Nice, localized, and very effective mod, Ben.

Update 2008/02/03:  I must say it is nice killing the Journal completely. Smiley
But if I kept the journal around, the _get_next_activity_but_not_journal() technique had a few problems for me, e.g., it didn't get to the next activity if I was already at the journal. I found that this worked more the way I expected:
Code:
    def get_next_activity(self):
        activities = self._get_activities_with_window()
        if len(activities) == 0:
            return None
        i = activities.index(self._pending_activity) + 1
        if i >= len(activities):
            i = 0
        if activities[i].get_type() == 'org.laptop.JournalActivity':
            i = i + 1
        if i >= len(activities):
            return activities[0]
        else:
            return activities[i]
and something similar for def get_previous_activity(self):
Not very elegant; perhaps someone can do better.
Nick
« Last Edit: February 03, 2008, 10:48:49 PM by Nick Tindall » Logged

#9 Re: How do I disable the Journal activity?

sracer
Master Contributor
***
Posts: 286


January 28, 2008, 05:24:23 PM

It takes up a LOT of memory, and before I go on a long websurfing session, or even times when I'm viewing comics or ebooks, I'll kill it using root's killall -r Journal. Then when I'm done, I'll just restart Sugar.
Hey... that's great!  I've noticed a nice little performance boost by killing the Journal.
Logged

#10 Re: How do I disable the Journal activity?

snth
New

Posts: 1


September 07, 2008, 01:48:03 PM

I simply commented out line 80 in /usr/share/sugar/shell/view/Shell.py:

Code:
gobject.idle_add(self._start_journal_idle)

No problems so far.
Logged

#11 Re: How do I disable the Journal activity?

anthill
Contributor
*
Posts: 37


December 06, 2008, 07:47:00 PM

What a great idea.  The journal is only a few button presses away, I don't need it interrupting Alt-Tab every time.

The latest update (703?) has slightly different code for homemodel.py, and I'm not enough of a coder to figure out if Nick's sample code above needs to be tweaked, or how.  Anyone tried this?
Logged

#12 Re: How do I disable the Journal activity?

mavrothal
Global Moderator
OLPC News Forum Expert
****
Posts: 941


December 07, 2008, 12:56:23 AM

I simply commented out line 80 in /usr/share/sugar/shell/view/Shell.py:

Code:
gobject.idle_add(self._start_journal_idle)

No problems so far.

Under os767-8.2 this will make the XO-unusable Applications will not launch (including terminal....) and will not even reboot! I had to ctrl-Alt-"neighborhood" to get a terminal and correct this.
Logged

XO: Is never going to run Flash, but is certainly flashy!
Pages: [1]
Print
Jump to:  

Welcome, Guest. Please login or register.
Did you miss your activation email?
September 02, 2010, 01:46:05 PM

Login with username, password and session length
Recent Topics
[Today at 12:54:50 PM]

[September 01, 2010, 08:24:07 PM]

[August 31, 2010, 01:25:28 PM]

[August 30, 2010, 11:26:07 PM]

[August 30, 2010, 11:23:56 PM]

[August 30, 2010, 10:40:34 AM]

[August 28, 2010, 10:00:01 PM]

[August 25, 2010, 03:10:02 PM]

[August 22, 2010, 09:48:07 AM]

[August 21, 2010, 02:39:32 PM]
Members
Total Members: 4552
Latest: Richard Rowe
Stats
Total Posts: 31115
Total Topics: 3759
Online Today: 65
Online Ever: 220
(February 05, 2009, 11:29:32 AM)
Users Online
Users: 1
Guests: 46
Total: 47