Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-01-26 05:14:03

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 812

launchers doing user switching

making desktop launchers do user switching was trivial.  just a basic desktop file, with its name being the user name, and the command being dm-tool switch-to-user followed by the name of the user.  i just created a little 20 line bash script to create a desktop file for each of the 18 users and move them into ~/Desktop.  it's not perfect because the terminals still cover them.  so as soon as i learn to make things on the panel, i won't need to shrink my terminal or minimize them or switch workspaces.

Offline

#2 2019-01-26 13:43:59

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: launchers doing user switching

Did this suggestion (using a launcher on your panel) not work?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2019-01-26 15:31:35

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 812

Re: launchers doing user switching

ToZ wrote:

Did this suggestion (using a launcher on your panel) not work?

i didn't understand the context of that script.  it looked like the script was supposed to be run by something and then it would do the switch by invoking dm-tool switch-to-user to accomplish that.  but i can make scripts do things.  what is not clear to me is how to set up the panel to do so.  i was looking at a plugin called "Launcher".  it had a means to select existing applications to launch.  so i could create a panel button to launch Firefox but not give a command with arguments.  i didn't even see a way to have Firebox be launched to a specific web site.  of course it can be hard to use if all you have is a place to type in a command if what you want is some common application to launch.  suppose i want to have a panel button launch the script ${HOME}/launch/netscan and give it the argument 8.8.8.8 or some other IP address.  how would i set that up?

Offline

#4 2019-01-26 16:59:53

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: launchers doing user switching

Skaperen wrote:

what is not clear to me is how to set up the panel to do so.

You can create custom launchers.

  1. Save the script somewhere on your system and make it executable.

  2. Add a "Launcher" to the panel.

  3. Got to the launcher properties and click on the "Add a new empty item" button (or right-click and select "New Application").

  4. Fill in all the fields and for Command, select this script.

This will create a custom launcher that will execute this script when clicked.

i was looking at a plugin called "Launcher".  it had a means to select existing applications to launch.  so i could create a panel button to launch Firefox but not give a command with arguments.  i didn't even see a way to have Firebox be launched to a specific web site.

You can always edit the launcher and change the command as required (including adding parameters).

suppose i want to have a panel button launch the script ${HOME}/launch/netscan and give it the argument 8.8.8.8 or some other IP address.  how would i set that up?

Create a custom launcher as above, but run this script instead:

#!/bin/bash
ANS=$(zenity --title Netscan --entry --text "Enter an IP or Range to scan")
xfce4-terminal --title "Netscan using NMap" -H -x nmap $ANS 

Here we use nmap, so make sure nmap is installed.

For both scripts, you will need zenity installed.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2019-01-26 17:06:21

mint4all
Member
From: off the map
Registered: 2018-08-21
Posts: 264

Re: launchers doing user switching

Launch a browser-session to an URL or IPaddress? Simple, like this:Launch2site.png
Theres a UI-problem with xfce's (as i have noted in another topic before: the launch-edit popup does not offer the "Edit Link" option. Workaround: use thunar to create the link on the desktop, then drag-drop it onto the launch-button's mini-menu of sub-launchers. Otherwise, create a launcher with the command line, like i did, "firefox -new-window https://www.lastpass.com" passing the URL to the browser. Both methods work just fine -- panel-level quick-links to URLs (akin to windoz' web-shortcuts).


Linux Mint 21.2 -- xfce 4.18 ... Apple iMAC -- Dell & HP Desktops and Laptops -- Family & Community Support

Offline

#6 2019-01-26 21:01:08

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 812

Re: launchers doing user switching

ToZ wrote:
  1. Save the script somewhere on your system and make it executable.

  2. Add a "Launcher" to the panel.

  3. Got to the launcher properties and click on the "Add a new empty item" button (or right-click and select "New Application").

  4. Fill in all the fields and for Command, select this script.

what does that button mentioned in #3 look like?  i see some greyed-out buttons on the right side.

t was doing "Add Application" instead of "New Application" earlier.  that is probably one source of confusion.  i just tried making one with a command "dm-tool switch-to-user forums" and it worked.  i need a better icon, now.  the letter "F" would do.

now i need to do 323 more of these so i end up with 18 on each of 18 users (324).  only 17 are actually needed per user (no need to switch to itself).  but doing 18 keeps the button line-up consistent between users.  this is why i like to find how to do this by changing file contents ... i can script the file changes/additions a lot easier.  that's how i put in 324 desktop launchers, previously.

ToZ wrote:

For both scripts, you will need zenity installed.

not really.  i don't want to have to enter anything.  just click and go and a menu if 18 buttons doesn't work well.

Offline

Board footer

Powered by FluxBB