1

Is there a possibility to delete a tag in Hamster Time Tracking?

I went through all graphical menus but couldn't find any option.

The closest one is the following but it doesn't list my own tags:

enter image description here

orschiro
  • 12,987
  • 16
  • 82
  • 157

2 Answers2

3

You can edit the database file of hamster in ~/.local/share/hamster-applet/hamster.db to delete tags.

CLI method

We'll use sqlite3 program to do editing from command line.

  1. Install it using this command

    sudo apt-get install sqlite3
    
  2. Then open the database file

    sqlite3 ~/.local/share/hamster-applet/hamster.db
    
  3. See all the tags defined (Optional)

    select * from tags;
    

    This may return something like this.

    3|au|true
    

    Here, The first column is ID, second one is name and third one controls whether or not this tag should be shown for autocompletion.

  4. Now, To remove a tag named au (for example)

    delete from tags where name = 'au';
    

    This will delete the tag with au name. You can check using select * from tags;.

  5. Now, save the database (otherwise the save will not persist)

    .save ~/.local/share/hamster-applet/hamster.db
    
  6. Quit the sqlite3 prompt using command

    .quit;
    

Graphical method

  1. Install any sqlite3 database editor. Such as sqliteman.

     sudo apt-get install sqliteman
    
  2. Open the database file in ~/.local/share/hamster-applet/hamster.db.

  3. Navigate to Schema tab, main -> Tables. Double click tags to see it's data on the right-hand side panel.

  4. Select the row for the tab you want to remove and click on Remove Row button above.

  5. Then click on Commit Current Transaction to save the changes.

  6. Exit Sqliteman.

Here is a simple screenshot indicating the buttons in SQLiteman

sqliteman buttons, which is which


Thanks to SteveK's hint on Editing the database file.

Anwar
  • 75,875
  • 31
  • 191
  • 309
1

I was wondering about the same, since I want to get rid of some the suggested tags.

To me it seems like that all the tags are stored in the database file: ~/.local/share/hamster-applet/hamster.db. I tried to edit this file by deleting tags, but without success. The problem is that there are a number of additional characters around the tag you might or might not have to delete but to me it is not clear where to start and stop deleting.

After editing the file hamster did not respond and the only solution to this is to restore the file. So better make a backup before trying yourself (cp ~/.local/share/hamster-applet/hamster.db ~/.local/share/hamster-applet/hamster.db.bak)

Anwar
  • 75,875
  • 31
  • 191
  • 309
SteveK
  • 11
  • 1