首次运行会提示输入桌面环境,KDE Plasma 之外需自行配置 conf.yaml;应用 profile 后可能需要注销重新登录才能看到全部改动;导出时默认会附加日期时间避免覆盖,需加 -f 才会覆盖同名文件
konsave
Prayag2GPL-3.0更新放缓用 Python 写的命令行工具,能一键备份 Linux 桌面配置(dotfiles),并在多套配置间快速切换,在 KDE Plasma 上开箱即用。
A command line program written in Python to let you backup your dotfiles and switch to other ones in an instant. Works out-of-the box on KDE Plasma!
python -m pip install konsaveREADME 未说明,作为 Python CLI 工具不涉及 GPU 或显存要求
用一条命令备份 Linux 桌面配置并随时切换,官方支持 KDE Plasma
用 Python 写的命令行工具,能一键备份 Linux 桌面配置(dotfiles),并在多套配置间快速切换,在 KDE Plasma 上开箱即用。
核心能力
- 用一条命令保存当前配置为 profile
- 一键应用已保存的 profile 恢复定制
- 把 profile 导出为 .knsv 文件分享给他人
- 通过 conf.yaml 自定义要备份的文件和目录
- 支持 $HOME 等占位符匹配不同机器上的目录名
容易踩的坑
- v2.3.0v.2.3.0最新正式版2026-01-24 · 2026-01-24 10:11 UTC
Hello everyone! I hope you’re all doing well. I apologize for my recent absence from Konsave. I’ve been busy with college and have also been working on a new project, Drawy, a whiteboard app. This release includes support for KDE Plasma 6 in Konsave and resolves some Python warnings. Thank you for your understanding!
Changed
- Konsave now supports KDE Plasma 6 (thanks to @ftschindler, see https://github.com/Prayag2/konsave/pull/125)
- Konsave no longer shows Python warnings (thanks to @michal-gora, see https://github.com/Prayag2/konsave/pull/124)
Docs
- Add instructions to install Konsave using pipx (thanks to @holocronweaver, see https://github.com/Prayag2/konsave/pull/116)
- v2.2.02023-01-30 · 2023-01-30 19:32 UTC
查看更新说明
Added
- You can now set the output directory and archive name when exporting a profile (#72)
- Profiles will now be listed in alphabetical order (#67)
Fixed
- Fixed typo in README (#48)
Changed
- Improved README (#75)
- Made it clear that a profile needs to be saved before exporting in the help text.
- Logs will now be saved to
$HOME/.cache/konsave_log.txt
- v2.1.22022-04-20 · 2022-04-20 15:39 UTC
查看更新说明
- v2.1.12021-10-24 · 2021-10-24 13:02 UTC
查看更新说明
Removed
- Removed the prompt that asked you which desktop environment you use when you ran Konsave for the first time. See #45.
- Removed unused import of the
logfunction in__main__.py.
Changed
- Konsave will now automatically detect if you're using KDE plasma or not.
- Fixed some Pylint errors.
- v2.1.02021-09-07 · 2021-09-07 18:04 UTC
查看更新说明
Added
- The following placeholders for
config.yamlwere added:$SHARE_DIR: It points to$HOME/.local/share$BIN_DIR: It points to$HOME/.local/bin
Changed
- Now, there's no need to check for the ID of a profile if you already know its name. You can remove, apply and export a profile using its name. For example
konsave --export myprofile. See #38 - Replaced the words "variables and functions" with "placeholders".
- Updated readme.
Removed
- You'll no longer be able to use IDs to remove, apply and export profiles. You have to use the name of the profile to do so.
- The following placeholders were removed:
$KONSAVE_DIR$CONFIG_DIR
- The following placeholders for
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Installation
Install from PyPI using pip
python -m pip install konsave
Install from PyPI using pipx
pipx install konsave
Usage
Get Help
konsave -h or konsave --help
Save current configuration as a profile
konsave -s <profile name> or konsave --save <profile name>
Overwrite an already saved profile
konsave -s <profile name> -f or konsave -s <profile name> --force
List all profiles
konsave -l or konsave --list
Remove a profile
konsave -r <profile name> or konsave --remove <profile name>
Apply a profile
konsave -a <profile name> or konsave --apply <profile name>
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 -e <profile name> or konsave --export-profile <profile name>
Export a profile, setting the output dir and archive name
konsave -e <profile name> -d <archive directory> -n <archive name>
or
konsave --export-profile <profile name> --archive-directory <archive directory> --export-name <export name>
Export a profile, overwrite files if they already exist
konsave -e <profile name> -f or konsave --export-profile <profile name> --force
*note: without --force, the export will be appended with the date and time to ensure unique naming and no data is overwritten
Import a ".knsv" file
konsave -i <path to the file> or konsave --import-profile <path to the file>
Show current version
konsave -v or konsave --version
Wipe all profiles
konsave -w or 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.
Format
The configuration file should be formatted in the following way:
---
save:
name:
location: "path/to/parent/directory"
entries:
# These are files to be backed up.
# They should be present in the specified location.
- file1
- file2
export:
# This includes files which will be exported with your profile.
# They will not be saved but only be exported and imported.
# These may include files like complete icon packs and themes..
name:
location: "path/to/parent/directory"
entries:
- file1
- file2
...
Adding more files/folders to backup
You can add more files/folders in the configuration file like this:
save:
name:
location: "path/to/parent/directory"
entries:
- file1
- file2
- folder1
- folder2
export:
anotherName:
location: "another/path/to/parent/directory"
entries:
- file1
- file2
- folder1
- folder2
Using placeholders
You can use a few placeholders in the location of each entry in the configuration file. These are:
$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.
The best example for this is the ".default-release" folder of firefox.
${BEGINS_WITH="text"}: for folders with different names on different computers whose names start with the same thing.
save:
firefox:
location: "$HOME/.mozilla/firefox/${ENDS_WITH='.default-release'}"
entries:
- chrome
Contributing
Please read CONTRIBUTION.md for info about contributing.
License
This project uses GNU General Public License 3.0