nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.17k stars 1.85k forks source link

Set plank items #3180

Open davidak opened 2 years ago

davidak commented 2 years ago

Description

I have multiple desktop systems and want to configure them identical with the same plank items.

I would like to implement it myself, but i did not find the time the last years... so feel free to do it.

Research

The plank items seem to be files in HOME/.config/plank/dock1/launchers/:

[davidak@gaming:~]$ ll $HOME/.config/plank/dock1/launchers/
total 48
-rw-r--r-- 1 davidak users 115 Apr 23  2019 gala-multitaskingview.dockitem
-rw-r--r-- 1 davidak users 107 Feb 12  2022 google-chrome.dockitem
-rw-r--r-- 1 davidak users 116 Apr 23  2019 io.elementary.calendar.dockitem
-rw-r--r-- 1 davidak users 113 Jan 23  2022 io.elementary.files.dockitem
-rw-r--r-- 1 davidak users 113 Apr 23  2019 io.elementary.music.dockitem
-rw-r--r-- 1 davidak users 114 Apr 23  2019 io.elementary.photos.dockitem
-rw-r--r-- 1 davidak users 119 Apr 23  2019 io.elementary.switchboard.dockitem
-rw-r--r-- 1 davidak users 116 Jun 22  2019 io.elementary.terminal.dockitem
-rw-r--r-- 1 davidak users 114 Apr 23  2019 io.elementary.videos.dockitem
-rw-r--r-- 1 davidak users 117 Feb 12  2022 org.keepassxc.KeePassXC.dockitem
-rw-r--r-- 1 davidak users 108 Jul  1 16:21 signal-desktop.dockitem
-rw-r--r-- 1 davidak users  99 Apr 23  2019 steam.dockitem
[davidak@gaming:~]$ cat ~/.config/plank/dock1/launchers/steam.dockitem 
[PlankDockItemPreferences]
Launcher=file:///run/current-system/sw/share/applications/steam.desktop
[davidak@gaming:~]$ cat ~/.config/plank/dock1/launchers/signal-desktop.dockitem 
[PlankDockItemPreferences]
Launcher=file:///run/current-system/sw/share/applications/signal-desktop.desktop
[davidak@gaming:~]$ cat ~/.config/plank/dock1/launchers/org.keepassxc.KeePassXC.dockitem 
[PlankDockItemPreferences]
Launcher=file:///run/current-system/sw/share/applications/org.keepassxc.KeePassXC.desktop

It might work to specify a list PlankItems with Nix Packages and home-manager generates the files.

In the last example, the package is called keepassxc, but the desktop file org.keepassxc.KeePassXC.desktop. The binary is called keepassxc. Not sure what the best way is to get the desktop file name. A dirty way would be to search /run/current-system/sw/share/applications/.

Elementary is working on a new dock, so it might not be useful to invest much time in this. But Plank can also be used individually, so maybe somebody cares about this.

stale[bot] commented 2 years ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.