4

How can I make a Switch User entry in the Awesome menu?

If it helps, I use kubuntu.

2 Answers2

8

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.

Ben G ben
  • 93
  • 1
  • 4
  • `/usr/bin/dm-tool switch-to-user username` is exactly what i needed. Most "switch user guides" point to `su - username` which is not what I needed. – i_want_more_edits Aug 15 '22 at 01:07
0

In my environment Ben's rc.lua did not run. I had to modify the code


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