Usb drive icon on Taskbar

Technical issues/questions of an intermediate or advanced nature.
Testuser
Samurai
Samurai
Posts: 170
Joined: 26 May 2021, 15:11
Distribution: Porteux-v2.6-LXDE

Usb drive icon on Taskbar

Post#1 by Testuser » 30 Jul 2026, 18:17

Below is a yad script for managing the USB drives connected in a device. Any changes or modifications are welcome

Seject script is used which poweroff the drive, if you do not want that replace it with udisksctl command.

Features
1. USb Icon pops up on Taskbar on USB insert from clicking that icon, we can eject (poweroff the drive).
2. Usb Icon vanishes on all USB eject.
3. Yad notifications for, drive name ejected, waiting for sync, if drive used then msg of cannot disconnect, etc.
4. Right click the icon also has yad menu
5. If one usb is there direct poweroff, if more than one it will display two drives connected and you can double click to eject the selected one.

Setup required

1. Udev rule - File name - 99-usb-tray.rules - /etc/udev/rules.d/

Code: Select all

SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_BUS}=="usb", ACTION=="add", RUN+="/usr/local/bin/usb-tray-handler.sh add"
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_BUS}=="usb", ACTION=="remove", RUN+="/usr/local/bin/usb-tray-handler.sh remove"
2. Polkit rule

# place this file in /etc/polkit-1/rules.d otherwise the script executed will show polit/authentication error

Code: Select all

polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.udisks2.eject-media" ||
         action.id == "org.freedesktop.udisks2.filesystem-unmount" ||
         action.id == "org.freedesktop.udisks2.power-off-drive") &&
        (subject.isInGroup("wheel") || subject.isInGroup("storage") || subject.isInGroup("plugdev"))) {
        return polkit.Result.YES;
    }
});
3. Yad script for showing GUI window and notifications - usb-tray-handler.sh place this in /usr/local/bin/

Code: Select all

#!/bin/bash

# Copy icon as svg file to this path /usr/share/icons/kora/devices/scalable to show tray icon bigger.
# Have rule created at /etc/polkit-1/rules.d/10-porteus-udisks.rules, otherwise authentication error will come.
# Have rule here, /etc/udev/rules.d/99-usb-tray.rules

# --- VARIABLES & HOOKS ---
ICON_USB="drive-removable-media-usb"
PIPE="/tmp/yad_usb_pipe"
ERR_FILE="/tmp/usb_eject_err"

# Automatically determine desktop user context when run by root (udev)
if [ "$(id -u)" -eq 0 ]; then
    USER=$(loginctl list-sessions | awk 'NR>1 {print $3}' | grep -v 'root' | head -n 1)
    [ -z "$USER" ] && USER=$(who | awk '{print $1}' | head -n 1 | tr -d '\n')
else
    USER=$(whoami)
fi

USER_ID=$(id -u "$USER")
GROUP=$(id -gn "$USER")
HOME_DIR=$(getent passwd "$USER" | cut -d: -f6)

# Environment variables needed when root/udev spawns YAD for the user
export DISPLAY=:0
export XAUTHORITY="$HOME_DIR/.Xauthority"
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$USER_ID/bus"

# Helper functions
count_usb_drives() {
    lsblk -d -o TRAN -n | grep -c "usb"
}

list_usb_drives() {
    lsblk -d -o NAME,MODEL,TRAN -nr | \
        awk '$3=="usb" {printf "%s\n%s\n", $1, $2}'
}

notify_error() {
    local model="$1"
    local err_msg=$(cat "$ERR_FILE" 2>/dev/null)
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 5 \
        --text "Failed to remove $model: ${err_msg:-Unknown error}"
}

notify_remove() {
    local model="$1"
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 7 \
        --text "Safely removed $model"
}

notify_none() {
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 4 \
        --text "No USB drives found"
}

auto_close() {
    if [ "$(count_usb_drives)" -eq 0 ]; then
        if [ -p "$PIPE" ]; then
            echo "quit" > "$PIPE" 2>/dev/null
            rm -f "$PIPE"
        fi
    fi
}

remove_usb() {
    local dev="$1"
    local model=$(lsblk -d -o NAME,MODEL -nr | awk -v d="$dev" '$1==d {print $2}')
    
    # 1. Spawn immediate background notice that auto-closes after 5 seconds
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 5 \
        --text "Syncing data to $model... Do not unplug!" &
    local sync_notify_pid=$!

    # 2. seject runs and blocks here until sync completes
    if /usr/local/bin/seject "/dev/$dev" 2>"$ERR_FILE"; then
        kill "$sync_notify_pid" 2>/dev/null
        notify_remove "$model"
    else
        kill "$sync_notify_pid" 2>/dev/null
        notify_error "$model"
    fi
    rm -f "$ERR_FILE"
}

show_menu() {
    selection=$(list_usb_drives |\
    yad --list \
        --window-icon="$ICON_USB" \
        --title="USB Drives" \
        --width=400 --height=300 \
        --image="$ICON_USB" --image-on-top \
        --column="Device" \
        --column="Model" \
        --button="Close:1" --button="Remove Selected:0" \
        --print-column=1 \
        --separator="")

    [[ $? -ne 0 ]] && return
    [[ -z "$selection" ]] && return
    remove_usb "$selection"
}

# --- STAGE 2: THE GUI MENU EXECUTION ---
if [ "$1" == "--gui-menu" ]; then
    usb_data=$(list_usb_drives)

    if [[ -z "$usb_data" ]]; then
        notify_none
        auto_close
        exit 1
    fi

    usb_count=$(echo "$usb_data" | grep -c '^')

    if (( usb_count == 2 )); then
        dev=$(echo "$usb_data" | head -n 1)
        remove_usb "$dev"
    else
        show_menu
    fi

    auto_close
    exit 0
fi

# --- STAGE 1: BACKGROUND EVENT HANDLER (UDEV) ---
case "$1" in
    add)
        exec > /tmp/usb_udev.log 2>&1
        set -x
        
        if [ "$(count_usb_drives)" -gt 0 ] && ! pgrep -u "$USER" -f "yad --notification.*$PIPE" > /dev/null; then
            rm -f "$PIPE"
            mkfifo "$PIPE"
            chown "$USER":"$GROUP" "$PIPE"

sudo -u "$USER" DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
bash -c '
exec 3<>"'$PIPE'"
/usr/bin/yad \
 --notification \
 --listen \
 --image="usb-tray" \
 --text="External USB Storage Connected. Click to Eject." \
 --menu="Eject Menu!/usr/local/bin/usb-tray-handler.sh --gui-menu||Exit Icon!quit" \
 --command="/usr/local/bin/usb-tray-handler.sh --gui-menu" <&3 &'
        fi
        ;;
    remove)
        if [ "$(count_usb_drives)" -eq 0 ] && pgrep -u "$USER" -f "yad --notification.*$PIPE" > /dev/null; then
            echo "quit" > "$PIPE" 2>/dev/null
            rm -f "$PIPE"
        fi
        ;;
esac
The only thing that does not work is if a USb drive is connected before the OS boot, icon does not shown in Taskbar. At that time you have to normally eject or need to run the 3rd script manually.
Last edited by ncmprhnsbl on 02 Aug 2026, 01:45, edited 1 time in total.
Reason: added code tags for readability and easy copying

User avatar
Ed_P
Contributor
Contributor
Posts: 9328
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Usb drive icon on Taskbar

Post#2 by Ed_P » 30 Jul 2026, 19:32

An impressive concept. :happy62: :punk:

How does one execute a Seject script??

And any plans to make this a Porteus.xzm module?

Testuser
Samurai
Samurai
Posts: 170
Joined: 26 May 2021, 15:11
Distribution: Porteux-v2.6-LXDE

Usb drive icon on Taskbar

Post#3 by Testuser » 01 Aug 2026, 14:51

Hi Ed,

Thanks much for the reply.

I missed the seject link, my bad.

There are only three files you need to create like i mentioned, so you can create a porteus module.

I have these files integrated in my single Changes.xzm.

Thanks

https://github.com/rogeriooferraz/seject

User avatar
Ed_P
Contributor
Contributor
Posts: 9328
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Usb drive icon on Taskbar

Post#4 by Ed_P » 02 Aug 2026, 00:52

An impressive link. :happy62:

Any way your Changes.xzm file can be shared for it to be used for seject?

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4649
Joined: 20 Mar 2012, 03:42
Distribution: v5.1-alpha*-64bit
Location: australia
Contact:

Usb drive icon on Taskbar

Post#5 by ncmprhnsbl » 02 Aug 2026, 02:15

added code tags to first post
Testuser wrote: ↑
01 Aug 2026, 14:51
There are only three files you need
plus yad https://slackware.nl/slakfinder/index.p ... e=#results
(and possibly deps)
Ed_P wrote: ↑
30 Jul 2026, 19:32
And any plans to make this a Porteus.xzm module?
it's a fairly easy make:
(as root)
1. mkdir -p /tmp/module/{etc/{udev/rules.d/,polkit-1/rules.d},usr/local/bin}
2. copy each block from above to 99-usb-tray.rules, 99-usb-tray-polkit.rules and usb-tray-handler.sh repectively
3. put 99-usb-tray.rules in /tmp/module/etc/udev/rules.d/ ... and 99-usb-tray-polkit.rules in /tmp/module/etc/polkit-1/rules.d/ ...and usb-tray-handler.sh in /tmp/module/usr/local/bin/
4. make usb-tray-handler.sh executable: chmod +x /tmp/module/usr/local/bin/usb-tray-handler.sh
5. go to https://github.com/rogeriooferraz/sejec ... ain/seject click "download raw file" (it's the download arrow thingy)
6. put seject in /tmp/module/usr/local/bin & make it executable chmod +x /tmp/module/usr/local/bin/seject
7. make module: dir2xzm /tmp/module usb-tray-handler.xzm
8. get yad, if you haven't already ..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 9328
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Usb drive icon on Taskbar

Post#6 by Ed_P » 02 Aug 2026, 20:59

ncmprhnsbl wrote: ↑
02 Aug 2026, 02:15
plus yad https://slackware.nl/slakfinder/index.p ... e=#results
(and possibly deps)
Salix Extra or SlackDCE Project? :%)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4649
Joined: 20 Mar 2012, 03:42
Distribution: v5.1-alpha*-64bit
Location: australia
Contact:

Usb drive icon on Taskbar

Post#7 by ncmprhnsbl » 03 Aug 2026, 03:06

Ed_P wrote: ↑
02 Aug 2026, 20:59
Salix Extra or SlackDCE Project?
a quick test here shows the newer SlackDCE one is fine.
with 5.01 that is.. for the alphas it needs to be compiled.
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Testuser
Samurai
Samurai
Posts: 170
Joined: 26 May 2021, 15:11
Distribution: Porteux-v2.6-LXDE

Usb drive icon on Taskbar

Post#8 by Testuser » 12 Aug 2026, 10:25

hi Ed_P

Sorry, I was super busy that why didnt got the time to create a module for this.

Took 2-3 months to make this script work by trial and error with Gemini.

Hope you are able to make a module, if not please let me know I will create one.

Thanks for understanding :)

Testuser
Samurai
Samurai
Posts: 170
Joined: 26 May 2021, 15:11
Distribution: Porteux-v2.6-LXDE

Usb drive icon on Taskbar

Post#9 by Testuser » 31 Aug 2026, 17:08

Hi, just an update.

New updated code of file usb-tray-handler.sh which fixed below issues. :Yahoo!:

1. When booted from Usb or Usb connected while boot does not show the usb icon.
2. Multiple usb icon on system tray for each additional pendrive connected (now only one icon in taskbar and clicking it will display all pendrives connected).

Below link to download the .xzm file with the script, usb icon, yad and it dependencies.

Feel free to ask for any queries or assistance.

https://www.mediafire.com/file/n4fmdmjy ... n.xzm/file

Code: Select all

#!/bin/bash

# Copy icon as svg file to this path /usr/share/icons/kora/devices/scalable to show tray icon bigger.
# Have rule created at /etc/polkit-1/rules.d/10-porteus-udisks.rules, otherwise authentication error will come.
# Have rule here, /etc/udev/rules.d/99-usb-tray.rules

# --- VARIABLES & HOOKS ---
ICON_USB="drive-removable-media-usb"
PIPE="/tmp/yad_usb_pipe"
ERR_FILE="/tmp/usb_eject_err"

# Fast non-blocking user detection
if [ "$(id -u)" -eq 0 ]; then
    USER=$(ps -C lxpanel -o user= 2>/dev/null | grep -v 'root' | head -n 1 | xargs)
    [ -z "$USER" ] && USER=$(loginctl list-sessions 2>/dev/null | awk 'NR>1 {print $3}' | grep -v 'root' | head -n 1 | xargs)
    [ -z "$USER" ] && USER=$(who 2>/dev/null | awk '{print $1}' | grep -v 'root' | head -n 1 | xargs)
    [ -z "$USER" ] && USER=$(ls /home 2>/dev/null | grep -v 'root' | head -n 1 | xargs)
    [ -z "$USER" ] && USER="guest"
else
    USER=$(whoami)
fi

USER_ID=$(id -u "$USER" 2>/dev/null)
[ -z "$USER_ID" ] && USER_ID=1000

GROUP=$(id -gn "$USER" 2>/dev/null)
[ -z "$GROUP" ] && GROUP="guest"

HOME_DIR=$(getent passwd "$USER" | cut -d: -f6)
[ -z "$HOME_DIR" ] && HOME_DIR="/home/$USER"

# Environment variables needed when root/udev spawns YAD for the user
export DISPLAY=${DISPLAY:-:0}
export XAUTHORITY=${XAUTHORITY:-"$HOME_DIR/.Xauthority"}
export DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS:-"unix:path=/run/user/$USER_ID/bus"}

# Helper functions
count_usb_drives() {
    lsblk -d -o TRAN -n | grep -c "usb"
}

list_usb_drives() {
    lsblk -d -o NAME,MODEL,TRAN -nr | \
        awk '$3=="usb" {printf "%s\n%s\n", $1, $2}'
}

notify_error() {
    local model="$1"
    local err_msg=$(cat "$ERR_FILE" 2>/dev/null)
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 5 \
        --text "Failed to remove $model: ${err_msg:-Unknown error}"
}

notify_remove() {
    local model="$1"
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 7 \
        --text "Safely removed $model"
}

notify_none() {
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 4 \
        --text "No USB drives found"
}

auto_close() {
    if [ "$(count_usb_drives)" -eq 0 ]; then
        if [ -p "$PIPE" ]; then
            echo "quit" > "$PIPE" 2>/dev/null
            rm -f "$PIPE"
        fi
    fi
}

remove_usb() {
    local dev="$1"
    local model=$(lsblk -d -o NAME,MODEL -nr | awk -v d="$dev" '$1==d {print $2}')
    
    # 1. Spawn immediate background notice that auto-closes after 5 seconds
    yad --geometry 448x1-32+32 --sticky --skip-taskbar --on-top --undecorated --borders 5 \
        --image "$ICON_USB" --no-buttons --timeout 5 \
        --text "Syncing data to $model... Do not unplug!" &
    local sync_notify_pid=$!

    # 2. seject runs and blocks here until sync completes
    if /usr/local/bin/seject "/dev/$dev" 2>"$ERR_FILE"; then
        kill "$sync_notify_pid" 2>/dev/null
        notify_remove "$model"
    else
        kill "$sync_notify_pid" 2>/dev/null
        notify_error "$model"
    fi
    rm -f "$ERR_FILE"
}

show_menu() {
    selection=$(list_usb_drives |\
yad --list \
        --window-icon="$ICON_USB" \
        --title="USB Drives" \
        --image="$ICON_USB" --image-on-top \
        --column="Device" \
        --column="Model" \
        --button="Close:1" --button="Remove Selected:0" \
        --print-column=1 \
        --separator="" \
        --width=400 --height=300 \
        --geometry=400x300-10+40 \
        --on-top)

    [[ $? -ne 0 ]] && return
    [[ -z "$selection" ]] && return
    remove_usb "$selection"
}

# --- STAGE 2: THE GUI MENU EXECUTION ---
if [ "$1" == "--gui-menu" ]; then
    usb_data=$(list_usb_drives)

    if [[ -z "$usb_data" ]]; then
        notify_none
        auto_close
        exit 1
    fi

    usb_count=$(echo "$usb_data" | grep -c '^')

    if (( usb_count == 2 )); then
        dev=$(echo "$usb_data" | head -n 1)
        remove_usb "$dev"
    else
        show_menu
    fi

    auto_close
    exit 0
fi

# --- STAGE 1: BACKGROUND EVENT HANDLER (UDEV) ---
case "$1" in
    add)
        exec > /tmp/usb_udev.log 2>&1
        set -x
        
        # Fork into background IMMEDIATELY so udev exits instantly (0 boot delay)
        (
            # Lock file prevents duplicate execution when multiple udev events fire at once
            exec 9>/tmp/usb_tray.lock
            if ! flock -n 9; then
                exit 0
            fi

            # Wait up to 15 seconds during boot for X11 socket & GUI desktop session to load
            for i in {1..15}; do
                [ -e "/tmp/.X11-unix/X0" ] && pgrep -f "lxpanel|xfce4-panel|mate-panel|plasmashell" >/dev/null 2>&1 && break
                sleep 1
            done

            # EXIT IMMEDIATELY if the tray icon is ALREADY running anywhere on the system
            if pgrep -f "usb_tray_icon" > /dev/null 2>&1; then
                exit 0
            fi

            # Re-evaluate user once desktop environment is guaranteed to be running
            if [ "$(id -u)" -eq 0 ]; then
                USER=$(ps -C lxpanel -o user= 2>/dev/null | grep -v 'root' | head -n 1 | xargs)
                [ -z "$USER" ] && USER=$(loginctl list-sessions 2>/dev/null | awk 'NR>1 {print $3}' | grep -v 'root' | head -n 1 | xargs)
                [ -z "$USER" ] && USER=$(who 2>/dev/null | awk '{print $1}' | grep -v 'root' | head -n 1 | xargs)
                [ -z "$USER" ] && USER=$(ls /home 2>/dev/null | grep -v 'root' | head -n 1 | xargs)
                [ -z "$USER" ] && USER="guest"
            fi

            USER_ID=$(id -u "$USER" 2>/dev/null)
            [ -z "$USER_ID" ] && USER_ID=1000

            GROUP=$(id -gn "$USER" 2>/dev/null)
            [ -z "$GROUP" ] && GROUP="guest"

            HOME_DIR=$(getent passwd "$USER" | cut -d: -f6)
            [ -z "$HOME_DIR" ] && HOME_DIR="/home/$USER"

            export DISPLAY=:0
            export XAUTHORITY="$HOME_DIR/.Xauthority"
            export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$USER_ID/bus"

            if [ "$(count_usb_drives)" -gt 0 ]; then
                rm -f "$PIPE"
                mkfifo "$PIPE"
                chown "$USER":"$GROUP" "$PIPE"

                sudo -u "$USER" DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
                bash -c '
                exec 3<>"'$PIPE'"
                /usr/bin/yad \
                  --notification \
                  --listen \
                  --name="usb_tray_icon" \
                  --image="usb-tray" \
                  --text="External USB Storage Connected. Click to Eject." \
                  --menu="Eject Menu!/usr/local/bin/usb-tray-handler.sh --gui-menu||Exit Icon!quit" \
                  --command="/usr/local/bin/usb-tray-handler.sh --gui-menu" <&3 &'
            fi
        ) &
        ;;
    remove)
        # Only close icon when ALL USB drives have been removed
        if [ "$(count_usb_drives)" -eq 0 ]; then
            if pgrep -f "usb_tray_icon" > /dev/null 2>&1; then
                echo "quit" > "$PIPE" 2>/dev/null
                rm -f "$PIPE"
            fi
        fi
        ;;
esac
Thanks

User avatar
Ed_P
Contributor
Contributor
Posts: 9328
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Usb drive icon on Taskbar

Post#10 by Ed_P » 01 Sep 2026, 05:19

Porteus 5.01 ISO boot

Code: Select all

~#  uname -a
Linux porteus.example.net 7.0.12-porteus #1 SMP PREEMPT_DYNAMIC Thu Jun 11 13:40:14 Local time zone must  x86_64 13th Gen Intel(R) Core(TM) i5-13420H GenuineIntel GNU/Linux

~#  cat /etc/porteus/*
001-core.xzm:20260618
002-xorg.xzm:20260618
002-xtra.xzm:20260618
003-cinnamon.xzm:20240924
initrd.xz:20260309

~#  ls -l /mnt/live/memory/images
000-kernel.xzm : Jun 11 09:43
001-core.xzm : Jun 18 08:52
002-xorg.xzm : Jun 18 08:58
002-xtra.xzm : Jun 18 09:02
003-cinnamon.xzm : Dec 29 2023
Usb-Tray-Icon.xzm : Aug 31 12:58
 :
 ~#  cat /proc/cmdline
quiet BOOT_IMAGE=(loop)/boot/syslinux/vmlinuz from=/ISOs/Porteus/Porteus-CINNAMON-v5.01-x86_64.iso volume=33 reboot=cold extramod=/porteus5.0/Modules noload=kde;jinn;lxqt;xfce;lxde;mate;open;dat.xzm;menu2

ISO: /ISOs/Porteus/Porteus-CINNAMON-v5.01-x86_64.iso

Code: Select all

guest@porteus:/usr/share/icons/kora/devices/scalable$ ls -l
total 1
-rw-r--r-- 1 root root 434 Jul 26 05:59 usb-tray.svg
guest@porteus:/usr/share/icons/kora/devices/scalable$ 
guest@porteus:/etc/udev/rules.d$ ls -l
total 9
-rwxr-xr-x 1 root root  160 Dec  7  2019 10-porteus-fstab-update.rules*
-rw-r--r-- 1 root root 1805 Mar 18 20:07 25-low-battey-action.rules
-rw-r--r-- 1 root root 1581 Mar 14 14:09 35-Safey-Remove-Drive-Sandisk-AllUsb.rules
-rw-r--r-- 1 root root  445 Sep  1 00:48 70-persistent-net.rules
-rw-r--r-- 1 root root  252 Jul 19 14:24 99-usb-tray.rules
guest@porteus:/etc/udev/rules.d$ 
guest@porteus:/etc/udev/rules.d$ su root
Password: 
root@porteus:/etc/udev/rules.d# ls -l /etc/polkit-1/rules.d/
total 2
-rw-r--r-- 1 root root 257 Feb 23  2020 00-early-checks.rules
-rw-r--r-- 1 root root 391 Jul 25 14:45 10-porteus-udisks.rules
-rw-r--r-- 1 root root 372 Apr 18  2020 25-guest-mount.rules
root@porteus:/etc/udev/rules.d# 
No icon on taskbar. :no: :o :%)

Code: Select all

root@porteus:/etc/udev/rules.d# ls -l /mnt/sda1/
total 96
drwxrwxrwx 3 guest users 16384 Aug 24 15:34 EFI/
drwxrwxrwx 2 guest users 16384 Aug 24 17:59 System\ Volume\ Information/
-rwxrwxrwx 1 guest users  1512 Aug 24 15:34 USB_INSTALLATION.txt*
drwxrwxrwx 4 guest users 16384 Aug 24 15:34 boot/
drwxrwxrwx 6 guest users 16384 Aug 25 15:44 porteus/
-rwxrwxrwx 1 guest users  7461 Aug 24 15:35 porteus-usb.sh*
root@porteus:/etc/udev/rules.d# 
Added in 14 minutes 36 seconds:
:shock:
Testuser wrote: ↑
31 Aug 2026, 17:08
usb-tray-handler.sh
Not in my /home/guest/ directory. :hmmm: Not part of the .xzm module. :o

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4649
Joined: 20 Mar 2012, 03:42
Distribution: v5.1-alpha*-64bit
Location: australia
Contact:

Usb drive icon on Taskbar

Post#11 by ncmprhnsbl » 01 Sep 2026, 08:14

Ed_P wrote: ↑
01 Sep 2026, 05:34
Not in my /home/guest/ directory. :hmmm: Not part of the .xzm module. :o
it's in <the_module>/usr/local/bin ..so not the problem
but there is a problem with the included <the_module>/usr/lib64/libgtksourceview.so* which is incompatible(and not needed) with cinnamon, xfce4 (and probably mate, gnome)
so a quick fix for cinnamon:
1. xzm2dir Usb-Tray-Icon.xzm
2. rm -rf Usb-Tray-Icon/usr/lib64
3. dir2xzm Usb-Tray-Icon
but also since udevd needs to restart to read the new rules, reboot with Usb-Tray-Icon.xzm enabled at bootup.
one more thing is the icon might not display properly .. in xfce, one fix was to copy or move or link /usr/share/icons/kora/devices/scalable/usb-tray.svg to /usr/share/icons/elementary-xfce/devices/24/
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Testuser
Samurai
Samurai
Posts: 170
Joined: 26 May 2021, 15:11
Distribution: Porteux-v2.6-LXDE

Usb drive icon on Taskbar

Post#12 by Testuser » 01 Sep 2026, 18:24

Hi Guys,

Sorry I forgot to mention, i am using LXDE porteux, so this (/usr/lib64/libgtksourceview.so) was required for Yad dependency.

ncmprhnsbl - Thanks much for the update :)

Post Reply