-
Notifications
You must be signed in to change notification settings - Fork 44
User units for the systemd module #294
Comments
This seems feasible. Right now it connects only to the system dbus, but I expect it should be possible to extend it to support connecting to the current user's dbus as well. If you want to try making that work go for it, otherwise I might get to it at a less busy time |
Hi there! From what I understand, changing the dbusType to session dbus could potentially fix the problem. Including an option to specify the dbusType when creating the module could be a viable solution. Is that correct? |
That was my expectation, so I think the PR's general logic is sound. Thanks for attempting this! |
Issue: #294 Added an optional busType parameter in the Service function on the systemd module in order to not introduce a breaking change. I tested locally and seems to work just fine
As #374 got merged i've decided to give them a try ... @KarolosLykos (or @soumya92 ) may i ask what OS are you running and how does the I've already have something to see if the greenclip := systemd.UserService("greenclip").
Output(func(si systemd.ServiceInfo) bar.Output {
out := outputs.Group()
out.OnClick(click.Left(func() {
si.Stop()
}))
if si.State == systemd.StateActive {
out.Append(
outputs.Pango(
pango.Icon("mdi-clipboard").Color(colors.Hex("#34eb55")),
))
} else {
out.Append(
outputs.Pango(
pango.Icon("mdi-clipboard-off").Color(colors.Hex("#eb4034")),
))
}
return out
}) and the
|
I don't actually have any user units, so I can't test this. Based on your description my first guess would be that the watcher is actually still watching system bus, so that would be the place to start. If you want to explore go for it, otherwise I'll try to look at this when I have time. |
@bavarianbidi I haven't had extensive experience with the |
This works for me, thanks for implementing this @KarolosLykos ! I do have some dbus watcher problems but for system services as well so I'll open another issue. |
I'm having the same issue as #294 (comment) with the emacs server service. |
I'm using barista along with home-manager. home-manager is basically a way to have your
home/
directory be generated from configurations files. In particular, you can do things such asprograms.emacs = enable
and home-manager automatically creates a systemd unit for the Emacs server.But if i want to access this unit inside barista through the systemd module, I get an error saying the unit is unknown. This is because the unit generated by home-manager is not listed by
systemctl list-units
, but instead bysystemctl --user list-units
. I don't know much about systemd but I assume this is because home-manager creates user-specific unit-files but the systemd module in barista can only access root unit-files.Is there a way to access the units listed only by
systemctl --user list-units
using barista's systemd module ? If not, could it be extended so that this becomes possible ?Thanks !
The text was updated successfully, but these errors were encountered: