# Deskmeter GNOME Extension - Installation Status **Date**: 2025-12-19 **GNOME Shell Version**: 49.2 (Wayland) **Extension UUID**: deskmeter-indicator@local --- ## ✅ Installation Complete 1. **Extension files installed** to `~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/` 2. **metadata.json updated** to support GNOME Shell 48 and 49 3. **Extension enabled** via dconf (added to enabled-extensions list) --- ## ⚠️ IMPORTANT: Required Before Testing ### 1. Log Out and Back In (Wayland Requirement) Since you're on Wayland, GNOME Shell **cannot** be restarted without logging out. The extension will **only** load after you log back in. ```bash # After logging back in, verify extension is loaded: gnome-extensions list --enabled | grep deskmeter ``` Expected output: `deskmeter-indicator@local` --- ### 2. Start dmweb Server The extension requires the dmweb Flask server running on port 10000: ```bash # Navigate to dmweb directory cd ~/wdir/dm-gnomeext/../../dm/dmapp/dmweb # or wherever your dmapp directory is located # Start the server python3 run.py ``` **Test the API endpoint:** ```bash curl http://localhost:10000/api/current_task ``` Expected response: ```json {"task_id":"12345678","task_path":"work/default"} ``` If you get an error, dmweb is not running. --- ## 🎯 What to Expect After logging back in and starting dmweb, you should see: - **Extension indicator** in the top-left panel (left of other indicators) - **Initial state**: Shows "loading..." for ~2 seconds - **Normal state**: Displays current task path (e.g., "work/default") - **After workspace switch**: Updates after 2.2 second delay - **Long paths**: Auto-truncates to show last 2 segments (e.g., ".../project/task") --- ## 🔧 Troubleshooting ### Extension Not Showing in Panel ```bash # 1. Check if extension is in enabled list gnome-extensions list --enabled | grep deskmeter # 2. If not listed, manually enable again gnome-extensions enable deskmeter-indicator@local # 3. Check extension info gnome-extensions info deskmeter-indicator@local # 4. View GNOME Shell logs for errors journalctl --user -u org.gnome.Shell@wayland.service -f # Filter for deskmeter errors: journalctl --user -u org.gnome.Shell@wayland.service --since "5 minutes ago" | grep -i deskmeter ``` ### Shows "offline" Instead of Task ```bash # Check if dmweb is running curl http://localhost:10000/api/current_task # Check if port 10000 is listening ss -tlnp | grep 10000 # Start dmweb if not running cd ~/wdir/dm-gnomeext/../../dm/dmapp/dmweb python3 run.py ``` ### Shows "error" Instead of Task This means the API is reachable but returned invalid JSON. Check dmweb logs: ```bash # In dmweb terminal, you should see the request # Look for Python errors or exceptions ``` ### Extension Shows in List but Not Enabled ```bash # Force enable via dconf dconf write /org/gnome/shell/enabled-extensions \ "$(dconf read /org/gnome/shell/enabled-extensions | sed "s/]$/, 'deskmeter-indicator@local']/")" # Verify it was added dconf read /org/gnome/shell/enabled-extensions # Then log out/in again ``` ### Extension Loads but Causes GNOME Shell Issues ```bash # Disable the extension gnome-extensions disable deskmeter-indicator@local # Or remove from dconf dconf write /org/gnome/shell/enabled-extensions \ "$(dconf read /org/gnome/shell/enabled-extensions | sed "s/, 'deskmeter-indicator@local'//")" # View detailed error logs journalctl --user -u org.gnome.Shell@wayland.service -n 200 | grep -A 10 -i "error.*deskmeter" ``` --- ## 🐛 Debug Mode: View Live Logs ```bash # Watch GNOME Shell logs in real-time (useful for debugging) journalctl --user -u org.gnome.Shell@wayland.service -f | grep --line-buffered -i "deskmeter\|error" # In another terminal, try interacting with the extension # (switch workspaces, etc.) and watch for log output ``` --- ## 🔍 Using GNOME Looking Glass for Debug If the extension loads but doesn't work: 1. Press `Alt+F2` 2. Type `lg` and press Enter 3. Go to the **Extensions** tab 4. Find `deskmeter-indicator@local` 5. Check if it shows as **ACTIVE** or has error state 6. Click on it to see error details --- ## 📝 Extension Files Location ``` ~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/ ├── extension.js (Main extension code) ├── metadata.json (Extension metadata with GNOME version support) └── stylesheet.css (Panel label styling) ``` --- ## 🔄 Update Extension After Code Changes ```bash # 1. Copy updated files cp -r gnome-extension/deskmeter-indicator@local/* \ ~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/ # 2. On Wayland: MUST log out and back in # (No way around this unfortunately) # 3. On X11: Can reload with Alt+F2 → r → Enter # (But you're on Wayland) ``` --- ## ✅ Quick Test Checklist After logging back in: - [ ] Extension appears in `gnome-extensions list --enabled` - [ ] dmweb server is running (`curl http://localhost:10000/api/current_task` works) - [ ] Task indicator visible in top panel (left side) - [ ] Shows current task path (not "loading...", "offline", or "error") - [ ] Updates when switching workspaces (after ~2 second delay) --- ## 📚 Useful Commands Reference ```bash # List all extensions gnome-extensions list # List enabled extensions gnome-extensions list --enabled # Enable extension gnome-extensions enable deskmeter-indicator@local # Disable extension gnome-extensions disable deskmeter-indicator@local # Get extension info gnome-extensions info deskmeter-indicator@local # View current dconf enabled extensions dconf read /org/gnome/shell/enabled-extensions # Test dmweb API curl http://localhost:10000/api/current_task # Check GNOME Shell version gnome-shell --version # View GNOME Shell service status systemctl --user status org.gnome.Shell@wayland.service ``` --- ## 🚨 If Everything Fails 1. **Collect logs:** ```bash journalctl --user -u org.gnome.Shell@wayland.service --since "10 minutes ago" > /tmp/gnome-shell-logs.txt ``` 2. **Check extension syntax:** ```bash cat ~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/extension.js | head -20 cat ~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/metadata.json ``` 3. **Disable and remove:** ```bash gnome-extensions disable deskmeter-indicator@local rm -rf ~/.local/share/gnome-shell/extensions/deskmeter-indicator@local ``` 4. **Reinstall from scratch:** ```bash cp -r gnome-extension/deskmeter-indicator@local ~/.local/share/gnome-shell/extensions/ gnome-extensions enable deskmeter-indicator@local # Log out and back in ``` --- ## 📁 Project Structure ``` dm-gnomeext/ └── gnome-extension/ ├── deskmeter-indicator@local/ │ ├── extension.js ← Main extension code │ ├── metadata.json ← Updated to support GNOME 49 │ └── stylesheet.css ← Panel styling ├── README.md ├── install.sh └── update.sh ``` --- ## 💡 Extension Behavior Notes - **Debounce delay**: Extension waits 2.2 seconds after workspace switch before querying API - This allows dmcore (polls every 2s) to detect the change and update MongoDB - **Path truncation**: Paths longer than 40 chars show as `.../last/two` - **Error handling**: - "loading..." = Initial state or pending update - "offline" = Cannot reach API endpoint - "error" = API reachable but invalid response - "no task" = Valid response but no current task --- Good luck! If you see the task indicator after logging back in, it's working perfectly.