Git Product home page Git Product logo

gedit-session-keeper's Introduction

Gedit Session Keeper

This is a plugin for Gedit, the official text editor of the GNOME desktop environment.

It restores the windows that were open the last time Gedit was closed (or forcibly stopped), preserving the open files in those windows and the ordering of their tabs. Tab groups are also restored.

This is intended to be a basic session saver without all possible bells and whistles. This should reduce the risk that the plugin breaks each time one of those bells or whistles is changed in a Gedit update. I'm sure there are fancier session savers, but this one does all I expect from it.

Limitations

The plugin relies on timings to decide when to update changes in session state. This means e.g. if you close a document and then immediately quit Gedit, the document will still be reopened the next time you start Gedit.

Make sure to save all documents before quitting. If the “save changes” dialog shows up during quitting while multiple windows were open, then some of them may fail to restore.

This plugin is for Gedit versions 3.28 or above. It might work with lower 3.x versions but this has not been tested. This plugin is NOT compatible with Gedit 2.x.

Installation

  1. Download the source code from this repository:

    https://github.com/Drlex0/Gedit-session-keeper

    You can either use git clone, or download the code as an archive.

  2. Copy these files to your Gedit plugins directory:

    mkdir -p ~/.local/share/gedit/plugins
    cp -r sessionkeeper.* ~/.local/share/gedit/plugins/
    
  3. (Re)start Gedit.

  4. Activate the plugin: go to Preferences, select Plugins tab and check Session Keeper.

  5. Quit and reopen Gedit. This is necessary to initialise and activate the plugin.

Credits

Inspired by:

License

Copyright © 2019 Alexander Thomas (doctor.lex at gmail.com)

Released under GNU General Public License version 3

gedit-session-keeper's People

Contributors

drlex0 avatar

Watchers

 avatar  avatar

gedit-session-keeper's Issues

Broken in gedit 46.2: no attribute get_location

Maybe trivial to fix, maybe it's utterly b0rked.

  File "/home/blah/.local/share/gedit/plugins/sessionkeeper.py", line 361, in on_tab_add_event
    if not tab.get_document().get_location():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Document' object has no attribute 'get_location'
Traceback (most recent call last):
  File "/home/blah/.local/share/gedit/plugins/sessionkeeper.py", line 386, in on_tab_change_event
    self.pending_states[timestamp] = self.get_state()
                                     ^^^^^^^^^^^^^^^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.