Skip to main content

A program that lets you save your Plasma configuration in an instant!

Project description

WARNINGS

  1. This is a fork of https://github.com/Prayag2/konsave that was heavily refactored
  2. Code here is no longer compatible with parent project which means that any improvements there will need to be manually ported to this version

Konsave (Save Linux Customization)

A CLI program that will let you save and apply your Linux customizations with just one command! Konsave also lets you share your dot files to your friends in an instant! It officially supports KDE Plasma but it can be used on all other desktop environments too!


Installation

pip install konsave-urban

Usage

Get Help

$ konsave -h
usage: Konsave [-h] [-d] {list,save,remove,apply,export,import,wipe,version,reset-config,config-check} ...

positional arguments:
  {list,save,remove,apply,export,import,wipe,version,reset-config,config-check}
    export              Export a profile to a konsave archive
    import              Import a profile from a konsave archive
    wipe                Wipe all profiles - this cannot be undone!
    version             Show Konsave version
    reset-config        Reset the konsave config to the factory default. This option is mainly useful for development
    config-check        Check currect config against ~/.config folders/files and show what is backed up and what is not

options:
  -h, --help            show this help message and exit
  -d, --debug           Enable debug logging

Please report bugs at https://www.github.com/urban-1/konsave

Save current configuration as a profile

$ konsave save test
Konsave: Saving profile...
Konsave: Profile saved successfully!

Overwrite an already saved profile

Normally you would get:

$ konsave save test
Traceback (most recent call last):
  File "/home/urban/git/konsave/.venv/bin/konsave", line 33, in <module>
    sys.exit(load_entry_point('Konsave', 'console_scripts', 'konsave')())
  File "/home/urban/git/konsave/konsave/__main__.py", line 127, in main
    return funcs[args.cmd](args)
  File "/home/urban/git/konsave/konsave/funcs.py", line 131, in save_profile
    args.name not in profile_list or args.force
AssertionError: Profile with this name already exists

if you want to overwrite that is there:

$ konsave save test -f
Konsave: Saving profile...
Konsave: Profile saved successfully!
$ konsave save test --force
Konsave: Saving profile...
Konsave: Profile saved successfully!

List all profiles

$ konsave list
Konsave profiles:
  ID  NAME
----  -------
   0  test

Remove a profile

$ konsave remove test
Konsave: removing profile...
Konsave: removed profile successfully

Apply a profile

konsave apply test

If you are a KDE user, you can supply -r/--reload-kde which will invoke a killall plasmashell; kstart plasmashell to restart plasma and pick up the changes.

You may need to log out and log in to see all the changes.

Export a profile as a ".knsv" file to share it with your friends!

konsave export <profile name>

If the target file already exists, the date will be automatically appended to the archive name. If you want to overwrite the existing file use -f/--force

You can also specify a different output file using the -o/--output flag, for example:

konsave export trigkey -o /tmp/test.knsv

# OR dump archive on screen
konsave export trigkey -o /dev/stdout

Import a ".knsv" file

konsave import <path to the file>

If you want to import under a different name (other than the knsv filename) use --import-name

Checking what is included

The following will compare the current Konsave config (conf.yaml) entries against the user's "~/.config" folder and will list all the entries along with info on if they are:

  • Backed up: Appear in the config. Entries that have False here exist in the filesystem but not in the konsave config. As such, these are configs that are not backed up
  • In ~/.config: Exist in the file system. Entries that have False here are mentioned in the config but do not exist in the local system (not installed or imported)

Example:

$ konsave config-check

# Config section: configs

Entry                                    Backed Up?    In ~/.config
---------------------------------------  ------------  --------------
Code                                     False         True
KDE                                      False         True
Kvantum                                  True          False
QtProject.conf                           False         True
...
spectaclerc                              True          True
systemmonitorrc                          False         True
systemsettingsrc                         False         True
trashrc                                  False         True
user-dirs.dirs                           False         True
user-dirs.locale                         False         True
vivaldi                                  False         True
vlc                                      True          True

List files in archive

This is a basic list to allow people to do basic troubleshooting on file sizes. Anything more than that should be done by extracting and exporing the archive in /tmp (or some other temp location). Example output:

$ konsave ls-archive ~/tmp/test.knsv
File/Folder                                                                                         Size       Comp. Size
--------------------------------------------------------------------------------------------------  ---------  ------------
export/                                                                                             188.58 MB  185.15 MB
save/                                                                                               231.51 KB  61.62 KB
conf.yaml                                                                                           3.64 KB    1.23 KB
export/common/                                                                                      188.48 MB  185.07 MB
export/home_folder/                                                                                 0.00 B     0.00 B
...

Show current version

konsave version

Wipe all profiles

konsave wipe


Editing the configuration file

You can make changes to Konsave's configuration file according to your needs. The configuration file is located in ~/.config/konsave/conf.yaml. When using Konsave for the first time, you'll be prompted to enter your desktop environment.
For KDE Plasma users, the configuration file will be pre-configured.

The Format

---
save:
    # This inludes configs. All files listed here are being re-installed
    # when one calls konsave apply <profile> (overwriting existing user
    # configs)
    name:
        location: "path/to/parent/directory"
        entries: 
        # these are files which will be backed up. 
        # They should be present in the specified location.
            - file1
            - file2
export:
    # This includes files which will be exported with your profile archive.
    # These will not be copied over on "apply" but only on import. Ideally
    # this section should include files like icon packs, themes, fonts
    name:
        location: "path/to/parent/directory"
        entries: 
            - file1
            - file2
...

You can use these placeholders in the "location" of each item:

  • $HOME: the home directory
  • $CONFIG_DIR: refers to "$HOME/.config/"
  • $SHARE_DIR: refers to "$HOME/.local/share"
  • $BIN_DIR: refers to "$HOME/.local/bin"
  • ${ENDS_WITH="text"}: for folders with different names on different computers whose names end with the same thing.

Contributing

Please read CONTRIBUTION.md for info about contributing.

License

This project uses GNU General Public License 3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

konsave-urban-0.1.6.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

konsave_urban-0.1.6-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file konsave-urban-0.1.6.tar.gz.

File metadata

  • Download URL: konsave-urban-0.1.6.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for konsave-urban-0.1.6.tar.gz
Algorithm Hash digest
SHA256 277f7a45f6fef0459c51e2d5ec96af135414e48b4ad1e2680b849b7483988dd5
MD5 183fa8adae9df65373da9393e97c6ba1
BLAKE2b-256 6b480c7eea17c8701d79191759db964a48a8982987d86637c4c904161d2b8c48

See more details on using hashes here.

File details

Details for the file konsave_urban-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: konsave_urban-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for konsave_urban-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 952a7a9be16cbaf429d1c8c10f0e0ef87bce7bb5dfa7eb4a1724672ee7244200
MD5 3b9e4a3c52e968f4ab4866f4f6170434
BLAKE2b-256 14f78c7e02e2829221083f7a883cac074586fad5253c502cb307866f5d926dbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page