Comments (35)
To exit wayfire, you can use Ctrl+Alt+Backspace.
There is not a way to do this with wf-shell yet as far as I know.
from wf-shell.
@nwg-piotr I just asked how a compositor should be exited from a panel or whatever, and I was told that the following can be done:
1. Open the wayland socket which is typically `$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY` 2. Use SO_PEERCRED to get the PID of the compositor on that socket 3. Send SIGINT to the compositor
All of this can happen in a small C program, or maybe a python script.
On a side note, wayfire doesn't handle SIGINT properly, but that is a problem with Wayfire itself.
I have created https://github.com/soreau/wayland-logout based on this.
from wf-shell.
@soreau's based script is dank af.
I give it a 5/7
from wf-shell.
To exit wayfire, you can use Ctrl+Alt+Backspace.
Is this documented anywhere? I couldn't find it.
Even so, I believe it would be a good idea if wf-shell could be used to exit a session (or even turn off a system), because it seems like it's a system designed in a way that can be used primarily by mouse as well.
It's open to discussion how this might be best implemented.
from wf-shell.
To exit wayfire, you can use Ctrl+Alt+Backspace.
Is this documented anywhere? I couldn't find it.
I don't think so. I also couldn't find any documentation on how to start wayfire. Perhaps it could be added somewhere like the wiki.
Even so, I believe it would be a good idea if wf-shell could be used to exit a session (or even turn off a system), because it seems like it's a system designed in a way that can be used primarily by mouse as well.
It's open to discussion how this might be best implemented.
Perhaps we could have string options that point to scripts for logout, reboot and shutdown. If the option is set, a button is created in the menu for it. By default the options would not be set so the buttons wouldn't exist but we could add some example scripts to the wiki and when used, the buttons would automatically show and execute the respective script. @ammen99 what do you think?
from wf-shell.
The biggest problem with such a feature is that if you have multiple Wayfire instances, you want to only close the current one. So Wayfire and wf-shell would need to communicate via either DBus or via a Wayland protocol. I can imagine that we can have a small wayland protocol plugin in Wayfire which accepts such commands, and a small widget in wf-shell which uses this protocol.
from wf-shell.
@ammen99 True indeed, I had considered a protocol first but thought this might be too complex. Do we have any example of a plugin implementing a protocol yet?
from wf-shell.
No, but it is not hard to do. Just create a singleton plugin like autostart, and in the constructor set up the wl_global and callbacks.
from wf-shell.
@ericonr If you feel like this is something you'd like to do, you probably should join #wayfire on irc.freenode.net where we can chat. I must say that for a newcomer, this task might be a bit daunting, though we should be able to help you through it.
from wf-shell.
Yeah, the task seems to have increased in scope a bit. I felt the IPC interface on sway, using a socket, works pretty well overall. Is there any reason in particular this project doesn't use that?
Is making a wayland protocol exclusively for wayfire logout a "sustainable" endeavor? I don't know much about this, so I could be talking nonsense, though. Any reason you thought about implementing a protocol instead of a DBus interface?
I just joined your channel on freenode as well!
from wf-shell.
Is making a wayland protocol exclusively for wayfire logout a "sustainable" endeavor? I don't know much about this, so I could be talking nonsense, though. Any reason you thought about implementing a protocol instead of a DBus interface?
As @ammen99 outlined, there must be some sort of IPC, whether it be DBus, protocol or another socket. I assume wayland protocol by default since it's native and wayfire doesn't currently use DBus or any other IPC.
from wf-shell.
#30 offers an option, which I've added to the wiki.
from wf-shell.
Actually if you don't run multiple Wayfire sessions on the same machine, you can also just add a launcher which does pkill wayfire
from wf-shell.
I first installed Wayfire last night, and got to this thread in search of solution to this issue. While answering, I did not yet know that there was no command to exit the session, apart from the built-in key binding. It would be really useful. @ericonr , if you know a reasonable workaround, join the thread, please.
from wf-shell.
There is no integrated logout button in wf-shell but there is Ctrl+Alt+Backspace to end the wayfire session or you can look here for wlogout.
from wf-shell.
or you can look here for wlogout
I know, but this is not a solution to this certain issue. To have a "Logout" button in nwgbar
, a command is necessary, not another set of buttons.
from wf-shell.
@soreau isn't wf-shell just an application that is started by wayfire? So exiting wf-shell shouldn't be the goal (I think).
From the minimal look over nwgbar
, it seems to be using swaymsg
to send a command (or is it an api call??) to sway to logout.
Something like an invoker for wayfire api would be the desirable outcome, @nwg-piotr correct me if I am wrong.
I guess the dbus thing mentioned above is aiming to solve this.
I defer judgements and decisions.
from wf-shell.
@soreau isn't wf-shell just an application that is started by wayfire? So exiting wf-shell shouldn't be the goal (I think).
I don't understand what you mean by this. Why would you only want to shutdown the shell apps? I thought the goal was to run a command that either a) exits wayfire immediately, or b) start a gui app that allows you to choose shutdown/logout/etc. I thought wlogout provides b.
From the minimal look over
nwgbar
, it seems to be usingswaymsg
to send a command (or is it an api call??) to sway to logout.
Can't it just call wlogout instead of swaymsg or whatever?
Something like an invoker for wayfire api would be the desirable outcome, @nwg-piotr correct me if I am wrong.
I guess the dbus thing mentioned above is aiming to solve this.I defer judgements and decisions.
from wf-shell.
@soreau isn't wf-shell just an application that is started by wayfire? So exiting wf-shell shouldn't be the goal (I think).
I don't understand what you mean by this. Why would you only want to shutdown the shell apps? I thought the goal was to run a command that either a) exits wayfire immediately, or b) start a gui app that allows you to choose shutdown/logout/etc. I thought wlogout provides b.
I am actually agreeing with what you said, I don't know if I phrased it weirdly.
OTOH, I don't think even wlogout provides (b) as even wlogout needs the logout button to be mapped to a command (though I haven't tested this theory out).
From the minimal look over
nwgbar
, it seems to be usingswaymsg
to send a command (or is it an api call??) to sway to logout.Can't it just call wlogout instead of swaymsg or whatever?
What the result would be
Open nwgbar
> Press logout
button > Opens wlogout
> Press logout
button (which does nothing, as there's still no logout command)
Both wlogout
and nwgbar
need some command to map the buttons to.
Something like an invoker for wayfire api would be the desirable outcome, @nwg-piotr correct me if I am wrong.
I guess the dbus thing mentioned above is aiming to solve this.
I defer judgements and decisions.
from wf-shell.
If using logind
, you could use loginctl terminate-user $USER
, which is also set by default as logout command in wlogout
.
Edit: loginctl terminate-session $XDG_SESSION_ID
is superior as it will only terminate your current session, instead of all sessions of the current user.
from wf-shell.
What the result would be
Opennwgbar
> Presslogout
button > Openswlogout
> Presslogout
button (which does nothing, as there's still no logout command)
Ah, I didn't realize wlogout doesn't actually do anything.
from wf-shell.
If using
logind
, you could useloginctl terminate-user $USER
, which is also set by default as logout command inwlogout
.
Then again, maybe it does?
from wf-shell.
@soreau interesting workaround, then this should work similarly for nwgbar, both are basically similar for end user command configuration.
Though this still has the same aforementioned issues
As @ammen99 outlined, there must be some sort of IPC, whether it be DBus, protocol or another socket. I assume wayland protocol by default since it's native and wayfire doesn't currently use DBus or any other IPC.
from wf-shell.
And there is a dbus plugin now, though it isn't upstreamed to wayfire. Maybe wayfire-plugins-extra could house it but I'm not sure how @ammen99 would feel about this..
from wf-shell.
you could use
loginctl terminate-user $USER
On my machine this ends the wayfire / sway session, but it hangs afterwards.
Finally - nwgbar is just a button bar, nothing else. It's up to the user which commands to use. As far as I know, the same problem appears on dwm.
from wf-shell.
@nwg-piotr I just asked how a compositor should be exited from a panel or whatever, and I was told that the following can be done:
- Open the wayland socket which is typically
$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
- Use SO_PEERCRED to get the PID of the compositor on that socket
- Send SIGINT to the compositor
All of this can happen in a small C program, or maybe a python script.
On a side note, wayfire doesn't handle SIGINT properly, but that is a problem with Wayfire itself.
from wf-shell.
One way or another, the nwgbar command, a part of nwg-launchers, is just a configurable button bar, which does nothing else but displays a horizontal or vertical row of buttons assigned to user-defined commands. The sample template, which comes preinstalled, creates the exit menu for sway on Arch Linux:
[
{
"name": "Lock screen",
"exec": "swaylock -f -c 000000",
"icon": "system-lock-screen"
},
{
"name": "Logout",
"exec": "swaymsg exit",
"icon": "system-log-out"
},
{
"name": "Reboot",
"exec": "systemctl reboot",
"icon": "system-reboot"
},
{
"name": "Shutdown",
"exec": "systemctl -i poweroff",
"icon": "system-shutdown"
}
]
However, this may be ANY set of buttons with ANY commands. Whatever could be called here to exit Wayfire, must be an external command/script.
from wf-shell.
I understand, that's why I said the above steps can be executed by a small script which can then be put as a command there. I will try to put something together in the next few days and see how well it works.
from wf-shell.
Thanks in advance! Also on behalf of @epsilon-0 , I believe. :)
from wf-shell.
I have created https://github.com/soreau/wayland-logout based on this.
It would be great to make it available to users in some way.
At least I'll give it a try. Tomorrow, as it's almost 4 am in my place. I was working on displays detection in Azote for it to work on Wayfire. Seems to be all right now (not yet merged).
from wf-shell.
Also I have pushed a python version as well.
from wf-shell.
Even better!
from wf-shell.
@soreau While at the office, I tested the python version. Works perfectly well.
from wf-shell.
Fixed in #71
from wf-shell.
from wf-shell.
Related Issues (20)
- printf only partially works on command_output HOT 3
- Pressing super key for workspace overview opens menu on every workspace HOT 1
- subprojects/gvc outdated (5 years old) HOT 2
- panel crashes if problems with icons HOT 1
- Not showing WLAN interface on FreeBSD 14 HOT 1
- wf-panel doesn't seem to open certain apps HOT 10
- window-list high cpu usage when full
- latest commits change some expected panel behavior HOT 3
- default.css will not update to newer contents automatically
- Just a showcase
- Panel tray icon behaving unexpectedly (icon size animations) HOT 2
- moveable panel HOT 1
- [Feature Request] Add Pager widget and support for per-workspace tasks HOT 4
- Suggestions for Command-outputs and a little issue with WCM
- LG monitor hotplug on DPMS wake causes several apps to either crash or lose their windows on output recovery HOT 6
- Command-output tooltip execution spam HOT 2
- Tray tooltip variables are used without checking for escape sequences HOT 1
- Panel crashes after immediately switching apps via launchers widget
- panel: harmonise icon sizing HOT 5
- Too many icons blank, icon-mapping option has no effect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wf-shell.