Switch User in Awesome WM menu

awesome-wm, menu, switch-statement

Solution

if you are using ubuntu with lightdm as the display manager you can use the "dm-tool"

type `dm-tool -h` to list the options, they are self explenetory

i have it like this in my rc.lua

mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
                                    { "Debian", debian.menu.Debian_menu.Debian },
                                    { "open terminal", terminal },
                                    { "switch user", terminal .. " -e /usr/bin/dm-tool switch-to-user username" }
                                  }
                        })

the dm-tool option `switch-to-user` take you to the login screen with the user you add as an argument already selected all that's left is to type in the password.

Problem

How can I make a Switch User entry in the Awesome menu? If it helps, I use kubuntu.

Original source