Giter VIP home page Giter VIP logo

gnome-shell-extension-services-systemd's Introduction

Services Systemd

About

Services Systemd is a Gnome Shell Extension which allows to start and stop systemd services via a menu in the status area in the main menu panel. As there exists all a lot of irrelevant systemd services - in the sense of being displayed in this menu - the user can preselect which services should be shown in the preference dialog of the extension.

Screenshot

Install

Gnome Shell Extensions Page

The easiest way to install this extension is via the official Gnome Shell Extensions resource page: https://extensions.gnome.org/extension/1034/services-systemd/

Arch Linux

For Arch Linux the AUR package gnome-shell-extension-services-systemd-git is provided.

Authorization

Done via a password prompt from the command pkexec of the polkit package. This command usually pops up a graphical password prompt.

Without Password Prompt

Using pkexec (default)

In the recent versions of this extension the authorization is done by pkexec (before via gksu). Therefore if you would like to be able to start systemd services without getting prompted for a password, you will have to configure a polkit policy. The policy file org.freedesktop.policykit.pkexec.systemctl.policy would allow the execution of systemctl [start|stop] without a password confirmation. Simple copy the file in your polkit policy folder (usually: /usr/share/polkit-1/actions).

Using systemctl

You can also choose to use systemctl natively and bypass a password prompt.

To do this, add the policy file 10-service_status.rules to /etc/polkit-1/rules.d.

Feel free to change the wheel group noted in the file to any other group that you see fit.

Future

Planned additional functionality:

  • Separators/Groups
  • Adjustable systemd folders
  • Other services

Credits

Some parts have been taken from the gnome extension Services.

License

GPLv3

gnome-shell-extension-services-systemd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gnome-shell-extension-services-systemd's Issues

Installed from extensions.gnome.org, does not get what it's master

  • Ubuntu GNOME 15.10
  • Gnome Shell 3.16.4

I installed this extension from gnome.org, but it tries to run gksudo (which is not shipped in ubuntu for a since a long time).

Here is the code in my .local/share/gnome-shell/extensions/[email protected]/extension.js:

//GLib.spawn_command_line_async('sh -c "pkexec --user root systemctl ' + (active ? 'stop' : 'start') + ' ' + service['service'] + '; exit;"');
GLib.spawn_command_line_async('sh -c "gksudo systemctl ' + (active ? 'stop' : 'start') + ' ' + service['service'] + '; exit;"');

It's not what's in this repository master. I would like to use pkexec, as it's available right away.

Should I install directly from git? Or is it a release/packaging issue from extensions.gnome.org?

Anyway thanks for this extension, it's badly needed :)

command-method is empty

command-method can be set through settings dialog but after reopening the dialog the element is empty again.

Gnome 3.28
Extension: latest

[feature request] Let symbol represent if all added services are running

Heyho,
I would really like to see the symbol eg. being green or having a tick, if all added services are running. It should be eg. red, if at least one service is off. This would also mean, that the extension queries the status every x seconds (may be configurable).

Does that sound good and is this feasible?
Many thanks in advance =)

Services from /usr/lib/systemd/user/ not listed in drop down menu.

I'm using costume user level services in my Arch Linux GNOME shell desktop, for example, for SoundWireServer and Lantern. As I understand, that's not relay an issue, but not implemented. Would be nice be able to add those services too. Otherwise, extension like this was something that was missing from GNOME shell and was bothering me for a while now. Thank you for reading minds! Keep up the good work!

Auth still required with policy file in the right folder.

I'm using Debian 9 with Gnome 3.22.2.

I put org.freedesktop.policykit.pkexec.systemctl.policy file into /usr/share/polkit-1/actions folder but auth window still appears when I try to start/stop/restart a systemd service using this Gnome extension.

The command method is pkexec. By the way, it seems that I'm not able to select the command method in Services Systemd window.

Any hint on where to start if I want to try debugging by myself?

Autocomplete doest work on ubuntu 16.04

Hai there, seem this extension are depend on new Gtk.EntryCompletion() for autocomplete systemd services list right? Sadly, apache2 and mysql does't included with bash-completion package. Should we just disable it? and let user type the service manually

Allow starting instances of disabled template unit files

A nice feature to add would be to allow the following situation.

I have a template unit file [email protected] in my user directory.
This template handles various remote mount points, configurable by environment files.

All instances are disabled by default. Those instances are only started, if I need them.
I can now add instances which are already active or at least enabled.

But I would like to be able to add entries for instances which do not already exist, e.g. mount@server.

This is prevented by a check, if the unit file exists.
Would it be possible to disable this check for template instances?

It is already possible to add existing instances, but as soon as these are stopped, they are removed from the menu, since the file does no longer exist.

The removal can be reproduced by:

  1. starting an instance
  2. adding it to the menu
  3. closing the gnome tweak tool
  4. stopping the service
  5. opening tweak tool & plugin settings

ERROR on Ubuntu 18.0.4 and GNOME 3.28.2

I could not install this extension -> ERROR.
When I try to open the configuration panel I get this stacktrace:

`Error: Schema org.gnome.shell.extensions.services-systemd could not be found for extension [email protected]. Please check your installation.

Stack trace:
getSettings@/home/khauschild/.local/share/gnome-shell/extensions/[email protected]/convenience.js:87:15
ServicesSystemdSettings<._init@/home/khauschild/.local/share/gnome-shell/extensions/[email protected]/prefs.js:18:26
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
buildPrefsWidget@/home/khauschild/.local/share/gnome-shell/extensions/[email protected]/prefs.js:488:18
_selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:91:22
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:243:17
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
main@resource:///org/gnome/shell/extensionPrefs/main.js:397:5
@

:1:43
`

Service does not exist.

Hi
At the first, I want to say that I'm Persian, so sorry for my bad English, and I'm a newbie in Linux too so I am ashamed if I ask elementary questions.
Thank you for your extension, that's so good but when I wanted to add a service in "services systemd" window, I was confronted with this error message: "Service does not exist." for example I added "kerio-kvc.service", that service is installed and running on my computer, I checked with systemctl status command. So what's the problem?

M.

P.S. I learn a little about user services right now, so i got my answer. but it would be better if you add a section for user services in your extension. thank you. ๐Ÿ‘

Many services appearing twice

When adding a new service the autocompletion shows most of my services twice.
Do you need the outputs of systemctl --system list[-unit]s --type=service,timer?

Broke after update

After updating just now it says ERROR and the following is displayed when opening the settings:

Error: Schema org.gnome.shell.extensions.services-systemd could not be found for extension [email protected]. Please check your installation.

Stack trace:
  getSettings@/home/josia/.local/share/gnome-shell/extensions/[email protected]/convenience.js:87:15
  ServicesSystemdSettings<._init@/home/josia/.local/share/gnome-shell/extensions/[email protected]/prefs.js:18:26
  wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
  buildPrefsWidget@/home/josia/.local/share/gnome-shell/extensions/[email protected]/prefs.js:488:18
  _selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:91:22
  wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
  _onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:243:17
  wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
  main@resource:///org/gnome/shell/extensionPrefs/main.js:397:5
  @<main>:1:43
  

Any ideas?

[Feature request] Please add support for masking services instead of disabling

Is it possible to add support to mask a service, instead of just disabling it ?

I sometimes mask the avahi-daemon service on some Wi-Fi networks, because I don't want any Wi-Fi printers popping up. Just disabling avahi-daemon is of no use, because it is automatically restarded (by CUPS I think). You need to mask it.

It would be great if your extension would allow to mask a service instead of just disabling it. Ideally this should be done on a per-service basis, allowing for each service to choose if toggling the switch disables the service or masks it.

Feature request: Add support for multi services

Accept multi service entry, sample if add this in dconf :
{"name":"Web","service":"mysqld.service httpd.service","type":"system"}
It's ok start mysql and apache

I need to use DConf and not the extension preferences

Support for redhat 7.3

Hi, does't it work with GNOME Shell 3.14.4 ?

[robbinespu@Redhat]$ uname -a
Linux Redhat 3.10.0-514.10.2.el7.x86_64 #1 SMP Mon Feb 20 02:37:52 EST 2017 x86_64 x86_64 x86_64 GNU/Linux
[robbinespu@Redhat]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.3 (Maipo)
[robbinespu@Redhat]$ gnome-shell --version
GNOME Shell 3.14.4

Abandoned

Sorry, actually I am not using this extension by myself for a couple of years, therefore I will not spend time on maintain it, if someone is willing to keep it runing or even extend its functionality, go for it! I can transfer ownership, but I am not sure, how we could handle the gnome extension id in the right way.
Thanks for any suggestions in advance.

Icon scaling

The icon of the menu entry when selecting "Position: Menu" is scaled wrong:
screenshot from 2018-08-22 00-56-39
My setup is FHD + 3440ร—1440 with scaling factor 1

Can't change status (needs root?)

Hey there,

I am on Arch and installed this via extensions.gnome.org. I can add services but not change their status. The button just jumps back to the original state.

I believe this is because it would need root access ? Maybe it could request the "needs root authentication" pop up ?

Thanks !

Does not work on GNOME 3.38

Extension does not work on GNOME 3.38.

It works without items but as soon as you add an item in the settings it stops working

Error: "meta is null"

I'm using 5.8.14-arch1-1

Not working on Gnome 3.32 / ES6 classes

Some recent changes in GS make this extension break with the following error:
gnome-shell[665]: JS ERROR: TypeError: this._construct is not a function
newClass@resource:///org/gnome/gjs/modules/_legacy.js:114:32
_refresh/<@[email protected]/extension.js:79:31
_refresh@extensions/[email protected]/extension.js:70:9
wapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_createContainer/<@[email protected] extension.js:53:13

[feature request] Define script to turn on/off & get status of non system service

Hi, I would appreciate possibility to define scripts instead of using systemd for managing some services.

As example, I have some development tools where I need to run command to start/stop something and some other command to show info whether its.

I could help implementing it, but I dont have experience with developing gnome extensions.

So if you would agree that this could be helpful and would like to implement it, could you maybe point me into right direction to start?

Thank you very much.

Btw. I really love this extension, its awesome

Does not work on 3.38

Hi,

plugin not compatible with version 3.38

Based on this: UshakovVasilii/gnome-shell-extension-freon#183

Fix: popupServiceItem.js line 25

Wrong line:
this.add(this.restartButton, { expand: false, x_align: St.Align.END });

Fixed line:
this.add_child(this.restartButton, { expand: false, x_align: Clutter.ActorAlign.CENTER });

Can't figure out the policies

Sorry to bother, this is not a bug with the software, just my incompetence. I am unable to disable the password prompt. I'm using Ubuntu Gnome 17.04.

Here's what I've done:

Added org.freedesktop.policykit.pkexec.systemctl.policy to /usr/share/polkit-1/actions, gave it same owner and chmod as the other actions in the folder.

Added 10-service_status.rules to /etc/polkit-1/rules.d. I had to create the rules.d directory because it didn't exist before. I tried to change to "wheel" group to "root" and "user" and even ended up removing the check for it and still nothing. I think the rule is not loaded, I tried to add polkit.log("action=" + action) in the file but I don't get any logs.

Copied 10-service_status.rules to /usr/share/polkit-1/rules.d. I think this is not the correct location, but at least it had other rules in there, so I figured, maybe, but I still get prompted for password.

When configuring this extension, choosing the Command Method, I have 2 choices: pkexec and systemctl, but doesn't matter which I choose, the select still stays without a selected option. But the password prompt says "Authentication is required to run '/bin/systemctl' as the super user." so I guess it's using the latter.

Worst of all, I don't really know how to policies are (re)loaded, so I end up restarting the computer after every small change to see if it worked and it's getting really cumbersome.

Support for GNOME >= 3.38

Hello!

Please update this to work the GNOME >= 3.38.
On "extensions.gnome.org" the user "devhammed" wrote there is a fix and
he wants to send a pull request...

Regards
Sven

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.