home-manager
home-manager copied to clipboard
kconifg:init
Description
Fixes https://github.com/nix-community/home-manager/issues/607 by providing a way to programattically set kde configuration files.
However as note that any theme changed with this module requires a logout, as the proper way would be to exec plasma-apply-*
and those commands seem to require a working DBus and thus https://github.com/nix-community/home-manager/pull/2548 for testing on my setup.
Checklist
-
[x] Change is backwards compatible.
-
[ ] Code formatted with
./format
. -
[ ] Code tested through
nix-shell --pure tests -A run.all
. -
[ ] Test cases updated/added. See example.
-
[x] Commit messages are formatted like
{component}: {description} {long description}
See CONTRIBUTING for more information and recent commit messages for examples.
-
If this PR adds a new module
-
[ ] Added myself as module maintainer. See example.
-
[ ] Added myself and the module files to
.github/CODEOWNERS
.
-
Some thoughts after trying something like this locally:
Activate after linkGeneration rather than writeBoundary so if someone removes an old home-manager config for one of these files and then sets it up this way, the old link is removed before trying to set it. What does this script do if a file doesn't already exist, or if it can't be written to?
Ask KWin and KGlobalSettings to reload configs so they can apply immediately. Seems to work for me but not confident this reloads all configs:
$DRY_RUN_CMD ${pkgs.libsForQt5.qt5.qttools.bin}/bin/qdbus org.kde.KWin /KWin reconfigure || echo "KWin reconfigure failed"
# the actual values are https://github.com/KDE/plasma-workspace/blob/c97dddf20df5702eb429b37a8c10b2c2d8199d4e/kcms/kcms-common_p.h#L13
for changeType in {0..10}; do
$DRY_RUN_CMD ${pkgs.dbus}/bin/dbus-send --type=signal /KGlobalSettings org.kde.KGlobalSettings.notifyChange int32:$changeType int32:0 || echo "KGlobalSettings.notifyChange failed"
done
Some thoughts after trying something like this locally:
What does this script do if a file doesn't already exist, or if it can't be written to?
The file is created without problems
Ask KWin and KGlobalSettings to reload configs so they can apply immediately. Seems to work for me but not confident this reloads all configs:
$DRY_RUN_CMD ${pkgs.libsForQt5.qt5.qttools.bin}/bin/qdbus org.kde.KWin /KWin reconfigure || echo "KWin reconfigure failed" # the actual values are https://github.com/KDE/plasma-workspace/blob/c97dddf20df5702eb429b37a8c10b2c2d8199d4e/kcms/kcms-common_p.h#L13 for changeType in {0..10}; do $DRY_RUN_CMD ${pkgs.dbus}/bin/dbus-send --type=signal /KGlobalSettings org.kde.KGlobalSettings.notifyChange int32:$changeType int32:0 || echo "KGlobalSettings.notifyChange failed" done
That requires dbus access, not aviable in nixos module until https://github.com/nix-community/home-manager/pull/2548 is merged
Strange, it works for me already, tested by toggling settings and confirming they are applied immediately with that change.
@LunNova If you are using home-manager from the terminal and not as a NixOS module then it should work, yes.
Can we have a setting to wait until default kde configs are created? Here I set hotkeys in khotkeysrc but expect that default hotkeys are set by kde: https://github.com/kurnevsky/nixfiles/blob/0ba02c1adf544d6f635fe9d5a50046e93fbd4955/modules/kde.nix#L211 If config is created by kwriteconfig5 kde won't set defaults I suppose.
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
Still relevant
Can we have a setting to wait until default kde configs are created? Here I set hotkeys in khotkeysrc but expect that default hotkeys are set by kde: https://github.com/kurnevsky/nixfiles/blob/0ba02c1adf544d6f635fe9d5a50046e93fbd4955/modules/kde.nix#L211 If config is created by kwriteconfig5 kde won't set defaults I suppose.
kwriteconfig modifies the old configs without deleting them,so old configuration would not me modified if not opresent in the nix config
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
I've been using this approach in my own configs for a while and it works well. It'd be nice to get this merged at some point.
Is there anything left that needs done?
@LunNova this pr is for me feature complete, I'm just waiting for review
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
Going to poke at this to keep it alive.
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
Still waiting for the review
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
I added a minor fixup commit. Please have a look, if it seems fine then I'll squash it and merge.
Thanks a lot for your patience and hard work! Finally merged to master now 🙂