Skip to content

About

use on xfce4

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

Repository files navigation

image

my_linux_panel

my_linux_panel is a tiny Vista-like translucent desktop panel for Arch Linux

  • Xfce4 on X11.(recommand for 'only Xfce4')

It starts as one small menu button in the top-left corner. Pressing menu opens a glass panel with system status text, weather, Spotify now playing, native Spotify launch, shortcut icons, a weather-reset icon, settings, a guarded power dialog, and an Xfce notification inbox.

The glass area is click-through on X11. Only these widgets catch clicks:

  • menu / close
  • the top-right power button
  • the notification bell directly below the power button
  • shell, internet, Spotify, file, weather settings, and settings icons

Quick Install on Arch Linux + Xfce4

Run the installer from this repository:

sudo ./install.sh

The installer intentionally requires sudo. If you run it without sudo, it exits before changing anything. Root is required because the installer can install Arch packages and places the final binary in:

/usr/local/bin/myPanel

The installer is optimized for Xfce4/X11. It will warn you if the current desktop does not look like Xfce.

What install.sh Does

install.sh:

  1. Checks that it is running with sudo.
  2. Checks that it is running on Arch Linux.
  3. Offers to install required packages with pacman.
  4. Builds myPanel with clang or gcc.
  5. Installs the binary to /usr/local/bin/myPanel.
  6. Creates ~/.config/myPanel/panel.ini for the real desktop user.
  7. Creates ~/.config/autostart/mypanel.desktop for Xfce login startup.
  8. Tries to enable the Xfce compositor for real transparency.
  9. Detects the current ALSA audio bridge and installs only the matching bridge packages for Spotify: pipewire-alsa for PipeWire, or alsa-plugins + pulseaudio-alsa for PulseAudio. The installer does not install the PulseAudio sound server package or switch the machine from one audio stack to another.
  10. Builds a tiny X11 Spotify focus helper and writes a ~/.local/bin/spotify wrapper for the desktop user. The wrapper focuses an existing Spotify window, or directly starts the Spotify Linux binary prepared by spotify-launcher under ~/.local/share/spotify-launcher. If that cached binary is missing, the wrapper asks spotify-launcher to prepare it first.
  11. Offers to start or restart the panel immediately.

The weather config is written with file mode 0600, so API keys in URLs are not world-readable.

Installer Audio Detection

Spotify's Linux binary uses the system audio stack. The installer keeps that stack intact and only installs the ALSA bridge that matches the existing setup.

Detection order:

  1. Current pcm.!default / ctl.!default ALSA backend.
  2. The target desktop user's live PipeWire or PulseAudio session.
  3. Already installed bridge packages.
  4. Installed PipeWire or PulseAudio packages.
  5. A manual choice if the stack is still unclear.

For PipeWire systems, the installer uses:

pipewire-alsa

For PulseAudio systems, the installer uses:

alsa-plugins pulseaudio-alsa

It intentionally avoids installing pulseaudio itself because that can replace or compete with an existing PipeWire setup.

Installer Weather Flow

The installer asks:

Do you want to enter a direct weather API URL?
  1. Yes, I have an Open-Meteo/OpenWeather URL or API-key URL
  2. No, choose a built-in Open-Meteo city
  3. Skip, use the default Seoul weather

If you choose 1, paste a complete HTTPS weather JSON URL. The direct API input screen clearly says that a blank API URL is handled as default: Seoul. Press Enter at the URL prompt to skip and use the default Seoul Open-Meteo weather.

Open-Meteo example, no API key needed:

https://api.open-meteo.com/v1/forecast?latitude=37.5665&longitude=126.9780&current=temperature_2m,weather_code&timezone=auto

OpenWeather example, API key needed:

https://api.openweathermap.org/data/2.5/weather?q=Seoul&appid=YOUR_KEY&units=metric

If you choose 2, the installer shows:

Choose a continent:
  1. Asia
  2. America
  3. Europe
  4. Africa
  5. Oceania

Each continent opens its own six-choice city menu: five built-in cities plus 6. Other, which returns to the direct API URL input screen. Asia starts with Seoul because this project is tuned from Seoul first:

1. Seoul
2. Shanghai
3. Beijing
4. Tokyo
5. Singapore
6. Other / enter a direct weather API URL

Choosing Other on any continent sends you to the same direct weather API URL input used by option 1.

Runtime UI

Closed state:

  • Only the small menu button is visible.

Open state:

  • System status text: time, CPU load, network latency, uptime, battery if present.
  • Top-right power button aligned with the settings icon column.
  • Notification bell directly below the power button. An unread dot appears when Xfce has unread notifications. Clicking the bell opens a separate, scrollable notification inbox without blocking the panel.
  • Weather area: weather icon and current weather label.
  • Shortcut row order: shell, internet, Spotify, file, weather settings, settings.
  • Spotify button: launches the local spotify wrapper first. That wrapper focuses an existing Spotify window or starts the cached Spotify Linux binary from ~/.local/share/spotify-launcher/install/usr/share/spotify/spotify. If the cached binary is missing, it asks spotify-launcher to prepare it. If neither command exists, the panel requests installation of spotify-launcher and playerctl through pkexec pacman, then starts Spotify after installation. The icon prefers the official Spotify app icon from the installed system icon theme, without bundling Spotify logo files into this repository.
  • Embedded Spotify player: placed directly under the shortcut row. It reads org.mpris.MediaPlayer2.spotify over DBus and shows album art, title, artist, album, track progress, previous/play-pause/next controls, and a top-right Spotify-only volume slider without embedding the fragile Spotify app window itself. This player is a custom GTK view built from Spotify/MPRIS metadata and commands, not a native Spotify-provided embedded UI. Because of that, some GTK widget styling can still feel more Linux-toolkit-like than macOS-native; future polish should focus on reducing default GTK widget chrome or drawing the compact media capsule manually.
  • Weather settings icon: opens a weather setup dialog and lets you paste a new API URL without editing files manually.
  • Power button: opens a separate dialog with immediate poweroff, suspend, and hibernate controls. The shutdown action has a 0-60 minute delay slider and runs shutdown now at 0 minutes or shutdown +N for a delayed shutdown.

Notification Inbox

The inbox uses the existing xfce4-notifyd notification history over its org.xfce.Notifyd.Log D-Bus interface (tested with xfce4-notifyd 0.9.7). The existing Xfce notification popups keep working. The panel does not replace the notification daemon or use a cloud service.

Enable notification logging in Notification settings -> Log. To save ordinary notifications as they arrive, enable logging and select Always. The same settings can be applied from your desktop user's terminal:

xfconf-query -c xfce4-notifyd -p /notification-log --create -t bool -s true
xfconf-query -c xfce4-notifyd -p /log-level --create -t string -s always

The inbox shows app names, timestamps, titles, bodies, and read status. It loads 100 entries at a time, with More (100) for older entries, up to the latest 1,000 entries. Mark read, Delete, and Mark all read update Xfce's shared history. Opening or closing the inbox does not mark notifications read. Deletion removes the selected saved entry, without closing the source app.

History survives panel restarts because Xfce stores it. Notifications received before logging was enabled cannot be recovered, and Xfce's app exclusions, transient-notification rules, and retention settings still apply. The bell tracks unread state even while the panel or inbox is closed. Updates follow D-Bus signals; there is no notification polling loop.

If history is empty or unavailable, use the inbox's Notification settings button to check logging and the installed xfce4-notifyd version.

Manual Build for Development

Install dependencies:

sudo pacman -S --needed base-devel gtk3 pkgconf curl exo xfce4-settings xfwm4 xfconf clang libx11 spotify-launcher playerctl libnotify xfce4-notifyd

Then install the ALSA bridge that matches your audio stack:

# PipeWire
sudo pacman -S --needed pipewire-alsa

# PulseAudio
sudo pacman -S --needed alsa-plugins pulseaudio-alsa

Build:

clang -O2 -pipe myPanel.c notification_center.c -o myPanel $(pkg-config --cflags --libs gtk+-3.0)

gcc works too when the local GCC toolchain is healthy:

gcc -O2 -pipe myPanel.c notification_center.c -o myPanel $(pkg-config --cflags --libs gtk+-3.0)

Run locally:

./myPanel

Notification integration checks (requires GTK development files, dbus-run-session, and an available X11 display):

tests/run-notification-tests.sh

These checks use synthetic notifications on an isolated D-Bus session. They do not read or modify the desktop's actual notification history.

Xfce Transparency

The panel uses real RGBA transparency, so the Xfce compositor must be enabled.

GUI path:

Settings Manager -> Window Manager Tweaks -> Compositor -> Enable display compositing

Terminal check:

xfconf-query -c xfwm4 -p /general/use_compositing

Enable it:

xfconf-query -c xfwm4 -p /general/use_compositing -s true

Config File

The config file is:

~/.config/myPanel/panel.ini

Weather:

[weather]
place=Seoul
url=https://api.open-meteo.com/v1/forecast?latitude=37.5665&longitude=126.9780&current=temperature_2m,weather_code&timezone=auto

Four configurable shortcut slots. They are rendered around the fixed Spotify and weather-settings buttons:

1 shell -> 2 internet -> Spotify -> 3 file -> weather settings -> 4 settings
[icons]
1_name=utilities-terminal
1_command=exo-open --launch TerminalEmulator
1_tooltip=Terminal

2_name=web-browser
2_command=exo-open --launch WebBrowser
2_tooltip=Browser

3_name=system-file-manager
3_command=exo-open --launch FileManager
3_tooltip=Files

4_name=preferences-system
4_command=xfce4-settings-manager
4_tooltip=Settings

For each shortcut:

  • *_name: GTK icon theme name, such as web-browser, or image path like ~/Pictures/icon.png.
  • *_command: command to run when clicked.
  • *_tooltip: hover text.

Restart myPanel after editing shortcut slots.

Xfce Autostart

The installer creates:

~/.config/autostart/mypanel.desktop

Expected contents:

[Desktop Entry]
Type=Application
Version=1.0
Name=myPanel
Comment=Translucent Xfce desktop status panel
Exec=/usr/local/bin/myPanel
TryExec=/usr/local/bin/myPanel
Terminal=false
StartupNotify=false
OnlyShowIn=XFCE;
Hidden=false

Manual GUI path:

Settings Manager -> Session and Startup -> Application Autostart -> Add

Use:

  • Name: myPanel
  • Command: /usr/local/bin/myPanel
  • Trigger: on login

Restart

pkill -x myPanel
/usr/local/bin/myPanel &

Check what is running:

pgrep -af myPanel

Troubleshooting

Installer says sudo is required:

sudo ./install.sh

Panel is black instead of translucent:

xfconf-query -c xfwm4 -p /general/use_compositing -s true

Weather says install curl:

sudo pacman -S --needed curl

Weather says parse fail:

  • Make sure the URL returns JSON.
  • For Open-Meteo, include current=temperature_2m,weather_code.
  • For OpenWeather, include units=metric.

Shortcut icon is blank:

  • Use a GTK icon name such as utilities-terminal, web-browser, or preferences-system.
  • Or use a real image path such as /home/YOUR_USER/Pictures/icon.png.

Shortcut click does nothing:

sh -lc 'your command here'

Run the command manually first. If it fails in the terminal, it will fail from the panel too.

About

use on xfce4

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages