Welcome!

The kernel problem with recent updates has been solved. Find the solution here

Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Root terminal icon

Help for Current Versions of MX
User avatar
jj1j1
Forum Regular
Forum Regular
Posts: 214
Joined: Tue May 28, 2019 3:49 pm

Root terminal icon

#1

Post by jj1j1 » Sat Aug 17, 2019 5:00 pm

It's nice that the root terminal icon is red. I know to be onguard if I ever click it, though I noticed today that if I click it, it shows a black icon in xfce panel windows-button item. I checked with Plank. It too shows a running instance of root terminal as a black icon. Anyone else run into this? I wonder if there's a way to change this to show the red icon :confused:
True freedom is never asking the question; Am I free?

User avatar
fehlix
Developer
Posts: 4887
Joined: Wed Apr 11, 2018 5:09 pm

Re: Root terminal icon

#2

Post by fehlix » Sat Aug 17, 2019 7:15 pm

jj1j1 wrote:
Sat Aug 17, 2019 5:00 pm
It's nice that the root terminal icon is red... it shows a black icon in xfce panel windows-button item.
That's a know "issue" and kind of solved in a workaround by ToZ from Xfce forum, and a nice little xseticon tool, which would adjust the window-icon in the panel - but is not yet available in MX ... :snail:
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
jj1j1
Forum Regular
Forum Regular
Posts: 214
Joined: Tue May 28, 2019 3:49 pm

Re: Root terminal icon

#3

Post by jj1j1 » Sat Aug 17, 2019 7:27 pm

I was just reading about xseticon,https://unix.stackexchange.com/question ... mmand-lineI even went so far as to download the binaries, http://www.leonerd.org.uk/code/xseticon/. I get error, "Package glib-2.0 was not found" when trying to Make it. Was willing to break os a minute ago, but have since changed my mind. :p
True freedom is never asking the question; Am I free?

User avatar
fehlix
Developer
Posts: 4887
Joined: Wed Apr 11, 2018 5:09 pm

Re: Root terminal icon

#4

Post by fehlix » Sat Aug 17, 2019 7:36 pm

jj1j1 wrote:
Sat Aug 17, 2019 7:27 pm
I was just reading about xseticon,https://unix.stackexchange.com/question ... mmand-lineI even went so far as to download the binaries, http://www.leonerd.org.uk/code/xseticon/. I get error, "Package glib-2.0 was not found" when trying to Make it. Was willing to break os a minute ago, but have since changed my mind. :p
Perhaps this might help https://github.com/xeyownt/xseticon
EDIT:
And here ToZ's script: https://forum.xfce.org/viewtopic.php?pid=41712#p41712
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
jj1j1
Forum Regular
Forum Regular
Posts: 214
Joined: Tue May 28, 2019 3:49 pm

Re: Root terminal icon

#5

Post by jj1j1 » Sat Aug 17, 2019 9:01 pm

Thanks. That was a help. xseticon is installed, but I don't quite get the script. Is the <windowid> the pid? I have a feeling if I change the root terminal icon it will change the normal terminal icon also. Root terminal launcher command is normal terminal ran with gksu.
Edit; "xwininfo" shows the windowid...still don't get it.
True freedom is never asking the question; Am I free?

User avatar
fehlix
Developer
Posts: 4887
Joined: Wed Apr 11, 2018 5:09 pm

Re: Root terminal icon

#6

Post by fehlix » Sat Aug 17, 2019 9:34 pm

jj1j1 wrote:
Sat Aug 17, 2019 9:01 pm
Thanks. That was a help. xseticon is installed, but I don't quite get the script. Is the <windowid> the pid? I have a feeling if I change the root terminal icon it will change the normal terminal icon also. Root terminal launcher command is normal terminal ran with gksu.
Edit; "xwininfo" shows the windowid...still don't get it.
Here a slight adjusted variant of ToZ's template script
let's call it : x_root_terminal.sh
put it into
/usr/local/bin

Code: Select all

#!/bin/bash

### EDIT THESE VALUES #########################################################

# path to real executable
APP="/usr/bin/x-terminal-emulator"
# icon file - only png supported
ICON="/usr/share/icons/Faenza/apps/32/gksu-root-terminal.png" 
# wait time for application window to display - adjust to suit
WAIT=2 
###############################################################################

###############################################################################
### DON'T CHANGE ANYTHING BELOW
###############################################################################
function change-panel-icon {

    sleep $WAIT
    activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
    activeWinId="${activeWinLine:40}"

    xseticon -id "$activeWinId" "$ICON"
}

$APP & change-panel-icon
When APP= x-terminal is started the panel icon get changed after waiting 1 or two second until the window gets opened,
and xseticon set'sthe window-icon, which is displayed in the panel.
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
jj1j1
Forum Regular
Forum Regular
Posts: 214
Joined: Tue May 28, 2019 3:49 pm

Re: Root terminal icon

#7

Post by jj1j1 » Sun Aug 18, 2019 2:20 am

Just to verify as I've no experience with scripts, I assume that I need to change the command in the root terminl launcher to, "/usr/local/bin/x_root_terminal.sh". Anyway that's what I did. The icon changes perfectly. :bouncing: There's only one problem. The terminal isn't root now.
True freedom is never asking the question; Am I free?

User avatar
Head_on_a_Stick
Forum Regular
Forum Regular
Posts: 490
Joined: Sun Mar 17, 2019 3:37 pm

Re: Root terminal icon

#8

Post by Head_on_a_Stick » Sun Aug 18, 2019 11:07 am

jj1j1 wrote:
Sun Aug 18, 2019 2:20 am
There's only one problem. The terminal isn't root now.
Change the first APP line in fehlix's script to

Code: Select all

APP='/usr/bin/gksu /usr/bin/x-terminal-emulator'
But please note that running the entire terminal emulator as root is a really bad idea, the gksu package has been removed from Debian 10 for exactly this reason.

To attain a root shell open a non-root terminal emulator and run

Code: Select all

sudo -i
Or just use sudo for individual commands, which is probably safer.

EDIT: here's a "safe" alternative to using the gksu sledgehammer:

Code: Select all

mkdir -p ~/.local/share/applications
cp /usr/share/applications/gksu.desktop ~/.local/share/applications
Then edit ~/.local/share/applications/gksu.desktop and change the Exec line to

Code: Select all

Exec=/usr/bin/x-terminal-emulator -e 'sudo -i'
The menu entry for "root terminal" should now open a non-root terminal with a root shell.

I think this can be applied to fehlix's script by using

Code: Select all

APP="/usr/bin/x-terminal-emulator -e 'sudo -i'"
"Direct action is the logical, consistent method of anarchism." — Emma Goldman

User avatar
jj1j1
Forum Regular
Forum Regular
Posts: 214
Joined: Tue May 28, 2019 3:49 pm

Re: Root terminal icon

#9

Post by jj1j1 » Sun Aug 18, 2019 4:42 pm

But please note that running the entire terminal emulator as root is a really bad idea, the gksu package has been removed from Debian 10 for exactly this reason.
I guess if the root terminal icon wasn't in MX It wouldn't be a problem. Maybe MX team will follow suit in their next release. I just happened to use it, and didn't see it represented in the panel, which I use frequently.
Also, is there a difference between "sudo -i", and "su"?
Last edited by jj1j1 on Sun Aug 18, 2019 4:50 pm, edited 1 time in total.
True freedom is never asking the question; Am I free?

User avatar
Head_on_a_Stick
Forum Regular
Forum Regular
Posts: 490
Joined: Sun Mar 17, 2019 3:37 pm

Re: Root terminal icon

#10

Post by Head_on_a_Stick » Sun Aug 18, 2019 4:50 pm

jj1j1 wrote:
Sun Aug 18, 2019 4:42 pm
I guess if the root terminal icon wasn't in MX It wouldn't be a problem. Maybe MX team will follow suit in there next release.
Well the gksu package isn't available in Debian buster so unless the MX devs host their own version then there won't be a "root terminal" menu entry.

jj1j1 wrote:
Sun Aug 18, 2019 4:42 pm
is there a difference between "sudo -i", and "su"?
There is for Debian buster: http://forums.debian.net/viewtopic.php?f=16&t=142973

Check for yourself by using the env command ;)
"Direct action is the logical, consistent method of anarchism." — Emma Goldman

Post Reply

Return to “MX Help”