51.5-354 updates
This commit is contained in:
119
docs/EXTENSION_ORIGINAL.md
Normal file
119
docs/EXTENSION_ORIGINAL.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# Deskmeter GNOME Task Indicator
|
||||
|
||||
A GNOME Shell extension that displays your current deskmeter task in the top panel, positioned to the left of the panel indicators.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- GNOME Shell (versions 40-47 supported)
|
||||
- Deskmeter web server running on `http://localhost:10000`
|
||||
- The `/api/current_task` endpoint must be accessible
|
||||
|
||||
## Installation
|
||||
|
||||
1. Copy the extension to your GNOME extensions directory:
|
||||
|
||||
```bash
|
||||
cp -r /home/mariano/wdir/dm/gnome-extension/deskmeter-indicator@local ~/.local/share/gnome-shell/extensions/
|
||||
```
|
||||
|
||||
2. Restart GNOME Shell:
|
||||
- On X11: Press `Alt+F2`, type `r`, and press Enter
|
||||
- On Wayland: Log out and log back in
|
||||
|
||||
3. Enable the extension:
|
||||
|
||||
```bash
|
||||
gnome-extensions enable deskmeter-indicator@local
|
||||
```
|
||||
|
||||
Or use GNOME Extensions app (install with `sudo apt install gnome-shell-extension-prefs` if needed).
|
||||
|
||||
## Configuration
|
||||
|
||||
The extension updates automatically when you switch workspaces. It waits 2.2 seconds after a workspace switch to allow dmcore (which polls every 2 seconds) to detect the change and update MongoDB.
|
||||
|
||||
You can adjust the delay in `extension.js`:
|
||||
|
||||
```javascript
|
||||
const DEBOUNCE_DELAY = 2200; // milliseconds
|
||||
```
|
||||
|
||||
The API URL is set to:
|
||||
|
||||
```javascript
|
||||
const DESKMETER_API_URL = 'http://localhost:10000/api/current_task';
|
||||
```
|
||||
|
||||
## Uninstallation
|
||||
|
||||
```bash
|
||||
gnome-extensions disable deskmeter-indicator@local
|
||||
rm -rf ~/.local/share/gnome-shell/extensions/deskmeter-indicator@local
|
||||
```
|
||||
|
||||
Then restart GNOME Shell.
|
||||
|
||||
## Updating the Extension
|
||||
|
||||
After making changes to the extension code:
|
||||
|
||||
```bash
|
||||
# Use the update script
|
||||
cd /home/mariano/wdir/dm/gnome-extension
|
||||
./update.sh
|
||||
|
||||
# Then restart GNOME Shell (X11 only)
|
||||
Alt+F2, type: r, press Enter
|
||||
|
||||
# On Wayland: log out and back in
|
||||
```
|
||||
|
||||
Or manually:
|
||||
```bash
|
||||
cp -r /home/mariano/wdir/dm/gnome-extension/deskmeter-indicator@local \
|
||||
~/.local/share/gnome-shell/extensions/
|
||||
# Then restart GNOME Shell
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Extension not showing
|
||||
|
||||
1. Check if the extension is enabled:
|
||||
```bash
|
||||
gnome-extensions list --enabled
|
||||
```
|
||||
|
||||
2. Check for errors:
|
||||
```bash
|
||||
journalctl -f -o cat /usr/bin/gnome-shell
|
||||
```
|
||||
|
||||
3. Try disabling and re-enabling:
|
||||
```bash
|
||||
gnome-extensions disable deskmeter-indicator@local
|
||||
gnome-extensions enable deskmeter-indicator@local
|
||||
```
|
||||
|
||||
### Shows "offline" or "error"
|
||||
|
||||
- Ensure dmweb Flask server is running on port 10000
|
||||
- Test the API endpoint:
|
||||
```bash
|
||||
curl http://localhost:10000/api/current_task
|
||||
```
|
||||
Should return JSON like: `{"task_id":"12345678","task_path":"work/default"}`
|
||||
|
||||
### Changes not appearing
|
||||
|
||||
- Make sure you copied files after editing
|
||||
- GNOME Shell must be restarted (no way around this)
|
||||
- Check logs for JavaScript errors: `journalctl -b -o cat /usr/bin/gnome-shell | grep deskmeter`
|
||||
|
||||
### Debug with Looking Glass
|
||||
|
||||
Press `Alt+F2`, type `lg`, press Enter. Go to Extensions tab to see if the extension loaded and check for errors.
|
||||
|
||||
### Task path too long
|
||||
|
||||
The extension automatically truncates paths longer than 40 characters, showing only the last two segments with a `.../ ` prefix.
|
||||
298
docs/INSTALL_STATUS.md
Normal file
298
docs/INSTALL_STATUS.md
Normal file
@@ -0,0 +1,298 @@
|
||||
# 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.
|
||||
148
docs/PORT_DETECTION_README.md
Normal file
148
docs/PORT_DETECTION_README.md
Normal file
@@ -0,0 +1,148 @@
|
||||
# Port Auto-Detection
|
||||
|
||||
Both the task window and GNOME extension now automatically detect which port dmweb is running on.
|
||||
|
||||
## How It Works
|
||||
|
||||
### Automatic Detection
|
||||
|
||||
Both apps try ports in this order:
|
||||
1. **10001** - Worktree instance (tried first)
|
||||
2. **10000** - Default instance (fallback)
|
||||
|
||||
The first port that responds successfully is used.
|
||||
|
||||
### Task Window (task_window.py)
|
||||
|
||||
**Auto-detection** (recommended):
|
||||
```bash
|
||||
./task_window.py
|
||||
# OR
|
||||
python3 task_window.py
|
||||
```
|
||||
|
||||
Output will show:
|
||||
```
|
||||
Found dmweb API on port 10001
|
||||
API URL: http://localhost:10001/api/current_task
|
||||
```
|
||||
|
||||
**Manual port specification:**
|
||||
```bash
|
||||
# Specify custom port as argument
|
||||
python3 task_window.py 10001
|
||||
python3 task_window.py 10000
|
||||
python3 task_window.py 9999
|
||||
```
|
||||
|
||||
**Environment variable:**
|
||||
```bash
|
||||
# Set port via environment variable
|
||||
DESKMETER_PORT=10001 python3 task_window.py
|
||||
```
|
||||
|
||||
Priority order: Command line arg > Environment variable > Auto-detection
|
||||
|
||||
### GNOME Extension
|
||||
|
||||
The extension automatically tries ports 10001 and 10000 when it starts.
|
||||
|
||||
You'll see "detecting..." in the panel while it searches, then it will show:
|
||||
- The task name when port is found
|
||||
- "offline" if no port responds
|
||||
|
||||
## Testing
|
||||
|
||||
### Test with curl
|
||||
|
||||
```bash
|
||||
# Check which ports are running
|
||||
curl http://localhost:10000/api/current_task # default
|
||||
curl http://localhost:10001/api/current_task # worktree
|
||||
```
|
||||
|
||||
### Test task window
|
||||
|
||||
```bash
|
||||
# Auto-detect (will find port 10001 first)
|
||||
python3 task_window.py
|
||||
|
||||
# Force specific port
|
||||
python3 task_window.py 10000
|
||||
```
|
||||
|
||||
Watch the console output to see which port was detected/used.
|
||||
|
||||
## Configuration
|
||||
|
||||
### Changing Port Priority
|
||||
|
||||
Edit `task_window.py` line 16:
|
||||
```python
|
||||
DEFAULT_PORTS = [10001, 10000] # Try in this order
|
||||
```
|
||||
|
||||
Edit `gnome-extension/deskmeter-indicator@local/extension.js` line 11:
|
||||
```javascript
|
||||
const DEFAULT_PORTS = [10001, 10000]; // Try in this order
|
||||
```
|
||||
|
||||
### Adding More Ports
|
||||
|
||||
```python
|
||||
# In task_window.py
|
||||
DEFAULT_PORTS = [10001, 10000, 9999, 8080]
|
||||
```
|
||||
|
||||
```javascript
|
||||
// In extension.js
|
||||
const DEFAULT_PORTS = [10001, 10000, 9999, 8080];
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Window shows "offline - dmweb not running"
|
||||
|
||||
```bash
|
||||
# Check if any dmweb is running
|
||||
ps aux | grep dmweb
|
||||
|
||||
# Check what ports are listening
|
||||
ss -tlnp | grep -E "(10000|10001)"
|
||||
|
||||
# Test ports manually
|
||||
curl http://localhost:10000/api/current_task
|
||||
curl http://localhost:10001/api/current_task
|
||||
```
|
||||
|
||||
### Extension shows "detecting..." forever
|
||||
|
||||
The extension couldn't connect to any port. Check:
|
||||
|
||||
```bash
|
||||
# View extension logs
|
||||
journalctl --user -u org.gnome.Shell@wayland.service -f | grep deskmeter
|
||||
```
|
||||
|
||||
Common issues:
|
||||
- dmweb not running
|
||||
- Firewall blocking localhost connections
|
||||
- Wrong API endpoint (make sure `/api/current_task` exists)
|
||||
|
||||
### Force specific port for extension
|
||||
|
||||
Edit `~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/extension.js` line 11:
|
||||
|
||||
```javascript
|
||||
// Only try one port
|
||||
const DEFAULT_PORTS = [10001];
|
||||
```
|
||||
|
||||
Then log out and back in to reload the extension.
|
||||
|
||||
## Summary
|
||||
|
||||
✅ **Task window**: Auto-detects ports 10001, 10000 (can override with arg or env var)
|
||||
✅ **GNOME extension**: Auto-detects ports 10001, 10000
|
||||
✅ **Worktree-first**: Both try port 10001 before 10000
|
||||
✅ **Configurable**: Easy to change port list or add more ports
|
||||
85
docs/README.md
Normal file
85
docs/README.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# Deskmeter GNOME Integration - Documentation
|
||||
|
||||
Complete documentation for the Deskmeter GNOME task display tools.
|
||||
|
||||
## Documentation Files
|
||||
|
||||
### Getting Started
|
||||
|
||||
**[READY_TO_TEST.md](READY_TO_TEST.md)** - ⭐ START HERE
|
||||
Complete testing guide with checklists, troubleshooting, and commands. Everything you need to test both the task window and GNOME extension.
|
||||
|
||||
### Task Window
|
||||
|
||||
**[TASK_WINDOW_README.md](TASK_WINDOW_README.md)**
|
||||
Detailed guide for the standalone GTK task window:
|
||||
- Usage instructions
|
||||
- Configuration options
|
||||
- Startup and autostart setup
|
||||
- Comparison with extension
|
||||
|
||||
### GNOME Extension
|
||||
|
||||
**[INSTALL_STATUS.md](INSTALL_STATUS.md)**
|
||||
Extension installation status and troubleshooting:
|
||||
- Installation checklist
|
||||
- Wayland requirements
|
||||
- Detailed troubleshooting steps
|
||||
- GNOME Looking Glass debugging
|
||||
- Extension file locations
|
||||
|
||||
**[EXTENSION_ORIGINAL.md](EXTENSION_ORIGINAL.md)**
|
||||
Original extension README (kept for reference)
|
||||
|
||||
### Technical Details
|
||||
|
||||
**[PORT_DETECTION_README.md](PORT_DETECTION_README.md)**
|
||||
How automatic port detection works:
|
||||
- Auto-detection mechanism
|
||||
- Manual port configuration
|
||||
- Priority order
|
||||
- Testing and troubleshooting
|
||||
|
||||
## Quick Links
|
||||
|
||||
### Task Window
|
||||
```bash
|
||||
# Run with auto port detection
|
||||
python3 task_window.py
|
||||
|
||||
# Specify port manually
|
||||
python3 task_window.py 10001
|
||||
```
|
||||
|
||||
### GNOME Extension
|
||||
```bash
|
||||
# Check if enabled
|
||||
gnome-extensions list --enabled | grep deskmeter
|
||||
|
||||
# View logs
|
||||
journalctl --user -u org.gnome.Shell@wayland.service -f | grep deskmeter
|
||||
```
|
||||
|
||||
### API Testing
|
||||
```bash
|
||||
# Test dmweb API
|
||||
curl http://localhost:10001/api/current_task
|
||||
curl http://localhost:10000/api/current_task
|
||||
```
|
||||
|
||||
## Documentation Index
|
||||
|
||||
| File | Purpose | Audience |
|
||||
|------|---------|----------|
|
||||
| READY_TO_TEST.md | Complete testing guide | Everyone - start here |
|
||||
| TASK_WINDOW_README.md | Task window documentation | Window users |
|
||||
| INSTALL_STATUS.md | Extension troubleshooting | Extension users |
|
||||
| PORT_DETECTION_README.md | Port detection details | Advanced users |
|
||||
| EXTENSION_ORIGINAL.md | Original extension docs | Reference |
|
||||
|
||||
## Need Help?
|
||||
|
||||
1. **Start with** [READY_TO_TEST.md](READY_TO_TEST.md) for immediate testing
|
||||
2. **For task window issues** see [TASK_WINDOW_README.md](TASK_WINDOW_README.md)
|
||||
3. **For extension issues** see [INSTALL_STATUS.md](INSTALL_STATUS.md)
|
||||
4. **For port problems** see [PORT_DETECTION_README.md](PORT_DETECTION_README.md)
|
||||
268
docs/READY_TO_TEST.md
Normal file
268
docs/READY_TO_TEST.md
Normal file
@@ -0,0 +1,268 @@
|
||||
# Ready to Test - Deskmeter Task Display
|
||||
|
||||
**Date**: 2025-12-19
|
||||
**Status**: ✅ All updates complete and ready for testing
|
||||
|
||||
---
|
||||
|
||||
## What's Been Updated
|
||||
|
||||
### 1. Task Window (task_window.py) ✅
|
||||
|
||||
**New Features**:
|
||||
- ✅ **No window decorations** - Clean minimal window, no title bar or close button
|
||||
- ✅ **Workspace change detection** - Updates 2.2s after you switch workspaces
|
||||
- ✅ **Auto port detection** - Finds dmweb on port 10001 or 10000 automatically
|
||||
- ✅ **Faster updates** - Polls every 500ms to catch changes quickly
|
||||
- ✅ **Smaller window** - 400x60px (reduced from 400x80)
|
||||
|
||||
**How to Close**:
|
||||
- `Alt+F4` (keyboard)
|
||||
- `pkill -f task_window.py` (command line)
|
||||
- Kill the terminal where you started it
|
||||
|
||||
### 2. GNOME Extension ✅
|
||||
|
||||
**New Features**:
|
||||
- ✅ **Error handling** - Won't crash GNOME Shell if something fails
|
||||
- ✅ **Auto port detection** - Same as window, tries 10001 then 10000
|
||||
- ✅ **Safe enable/disable** - All operations wrapped in try-catch
|
||||
|
||||
**Updated files in**: `~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/`
|
||||
|
||||
---
|
||||
|
||||
## How to Test
|
||||
|
||||
### Option 1: Test Window Now (No Logout Required)
|
||||
|
||||
```bash
|
||||
cd /home/mariano/wdir/dm-gnomeext
|
||||
|
||||
# Run the window
|
||||
python3 task_window.py
|
||||
```
|
||||
|
||||
**Expected behavior**:
|
||||
1. Console shows: `Found dmweb API on port 10001`
|
||||
2. Small window appears showing: **work/own/deskmeter**
|
||||
3. Window has **no title bar** (clean, minimal)
|
||||
4. When you switch workspaces, it updates after ~2 seconds
|
||||
|
||||
**Make it always-on-top** (in another terminal):
|
||||
```bash
|
||||
wmctrl -r "Deskmeter Task" -b add,above,sticky
|
||||
```
|
||||
|
||||
**Position it** where you want (drag with mouse or use wmctrl)
|
||||
|
||||
### Option 2: Test GNOME Extension (Requires Logout)
|
||||
|
||||
```bash
|
||||
# 1. Verify extension is enabled
|
||||
gnome-extensions list --enabled | grep deskmeter
|
||||
|
||||
# 2. Check extension files are updated
|
||||
ls -la ~/.local/share/gnome-shell/extensions/deskmeter-indicator@local/
|
||||
|
||||
# 3. Log out and log back in
|
||||
|
||||
# 4. After login, check panel for task indicator (left side)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## What You'll See
|
||||
|
||||
### Task Window
|
||||
```
|
||||
┌────────────────────────┐
|
||||
│ work/own/deskmeter │
|
||||
└────────────────────────┘
|
||||
```
|
||||
- No borders, no title bar, just the task text
|
||||
- Clean minimal display
|
||||
- Position anywhere, stays on top
|
||||
|
||||
### GNOME Extension
|
||||
```
|
||||
[Activities] [deskmeter] [detecting...] → [work/own/deskmeter]
|
||||
└─ Panel indicator
|
||||
```
|
||||
- Shows in panel (left side)
|
||||
- "detecting..." while finding port
|
||||
- Then shows current task
|
||||
|
||||
---
|
||||
|
||||
## Testing Checklist
|
||||
|
||||
### Window Testing
|
||||
- [ ] Window appears without title bar/decorations
|
||||
- [ ] Shows current task: "work/own/deskmeter"
|
||||
- [ ] Can be moved by dragging
|
||||
- [ ] Can close with Alt+F4
|
||||
- [ ] Updates when you switch workspaces (wait ~2s after switch)
|
||||
- [ ] Can be set always-on-top with wmctrl
|
||||
- [ ] Auto-detects port 10001 (check console output)
|
||||
|
||||
### Extension Testing (after logout/login)
|
||||
- [ ] Extension shows in panel (left side)
|
||||
- [ ] Shows "detecting..." briefly
|
||||
- [ ] Shows current task after detection
|
||||
- [ ] Updates when switching workspaces (wait ~2s)
|
||||
- [ ] If extension fails, GNOME Shell still works (doesn't crash)
|
||||
- [ ] Can disable extension: `gnome-extensions disable deskmeter-indicator@local`
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Window shows "offline - dmweb not running"
|
||||
|
||||
```bash
|
||||
# Check if dmweb is running
|
||||
ps aux | grep dmweb
|
||||
|
||||
# Check what's on port 10001
|
||||
curl http://localhost:10001/api/current_task
|
||||
|
||||
# Should show: {"task_id":"8f797adb","task_path":"work/own/deskmeter"}
|
||||
```
|
||||
|
||||
### Window doesn't update on workspace change
|
||||
|
||||
```bash
|
||||
# Test wmctrl is working
|
||||
wmctrl -d
|
||||
|
||||
# Should show workspaces with * marking current one
|
||||
```
|
||||
|
||||
### Window won't stay on top
|
||||
|
||||
```bash
|
||||
# After starting window, in another terminal:
|
||||
wmctrl -r "Deskmeter Task" -b add,above,sticky
|
||||
|
||||
# Verify it worked:
|
||||
wmctrl -l -x | grep -i deskmeter
|
||||
```
|
||||
|
||||
### Extension doesn't appear in panel after logout/login
|
||||
|
||||
```bash
|
||||
# Check if enabled
|
||||
gnome-extensions list --enabled | grep deskmeter
|
||||
|
||||
# Check for errors
|
||||
journalctl --user -u org.gnome.Shell@wayland.service --since "5 minutes ago" | grep -i deskmeter
|
||||
|
||||
# Try manually enabling
|
||||
gnome-extensions enable deskmeter-indicator@local
|
||||
# Then logout/login again
|
||||
```
|
||||
|
||||
### Extension shows "detecting..." forever
|
||||
|
||||
dmweb is not running on any of the tried ports (10001, 10000). Start dmweb:
|
||||
|
||||
```bash
|
||||
cd ~/wdir/dm/dmapp/dmweb # or wherever your dmweb is
|
||||
python3 run.py
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Performance Notes
|
||||
|
||||
### Task Window
|
||||
- Checks workspace every 200ms (lightweight wmctrl call)
|
||||
- Updates task every 500ms when no workspace change
|
||||
- After workspace change: waits 2200ms before updating (gives dmcore time)
|
||||
- Minimal CPU usage: ~0.1-0.2%
|
||||
|
||||
### GNOME Extension
|
||||
- Only updates on workspace switch + periodic refresh
|
||||
- Uses debounce delay of 2200ms
|
||||
- Minimal overhead, integrated with GNOME Shell event loop
|
||||
|
||||
---
|
||||
|
||||
## Commands Quick Reference
|
||||
|
||||
```bash
|
||||
# Start task window
|
||||
cd /home/mariano/wdir/dm-gnomeext
|
||||
python3 task_window.py
|
||||
|
||||
# Make window always-on-top + sticky (all workspaces)
|
||||
wmctrl -r "Deskmeter Task" -b add,above,sticky
|
||||
|
||||
# Position window (example: top-right corner)
|
||||
wmctrl -r "Deskmeter Task" -e 0,1500,0,400,60
|
||||
|
||||
# Close window
|
||||
pkill -f task_window.py
|
||||
# OR
|
||||
Alt+F4 (when window has focus)
|
||||
|
||||
# Check extension status
|
||||
gnome-extensions list --enabled | grep deskmeter
|
||||
|
||||
# View extension logs
|
||||
journalctl --user -u org.gnome.Shell@wayland.service -f | grep deskmeter
|
||||
|
||||
# Test API manually
|
||||
curl http://localhost:10001/api/current_task
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
1. **Test the window now** - No logout required, immediate feedback
|
||||
2. **When satisfied with window behavior** - Log out/in to test extension
|
||||
3. **Choose your preference**:
|
||||
- Use window for now (quick to start/stop)
|
||||
- Use extension after logout (cleaner, integrated into panel)
|
||||
- Use both (why not?)
|
||||
|
||||
---
|
||||
|
||||
## File Locations
|
||||
|
||||
```
|
||||
/home/mariano/wdir/dm-gnomeext/
|
||||
├── task_window.py ← Updated window app
|
||||
├── run_task_window.sh ← Helper script (can also use directly)
|
||||
├── gnome-extension/
|
||||
│ └── deskmeter-indicator@local/ ← Source (updated)
|
||||
│ ├── extension.js ✅ Error handling added
|
||||
│ ├── metadata.json ✅ GNOME 49 support
|
||||
│ └── stylesheet.css
|
||||
└── ~/.local/share/gnome-shell/extensions/
|
||||
└── deskmeter-indicator@local/ ← Installed (updated)
|
||||
├── extension.js ✅ Error handling added
|
||||
├── metadata.json ✅ GNOME 49 support
|
||||
└── stylesheet.css
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Documentation
|
||||
|
||||
- `INSTALL_STATUS.md` - Extension installation troubleshooting
|
||||
- `PORT_DETECTION_README.md` - How auto port detection works
|
||||
- `TASK_WINDOW_README.md` - Task window usage guide
|
||||
- `READY_TO_TEST.md` - This file
|
||||
|
||||
---
|
||||
|
||||
**Everything is ready! Start with the window test - it's the quickest way to verify everything works.**
|
||||
|
||||
```bash
|
||||
python3 task_window.py
|
||||
```
|
||||
|
||||
Then when you're ready, log out/in to test the extension.
|
||||
161
docs/TASK_WINDOW_README.md
Normal file
161
docs/TASK_WINDOW_README.md
Normal file
@@ -0,0 +1,161 @@
|
||||
# Deskmeter Task Window - Regular Mode
|
||||
|
||||
A simple GTK4 window that displays your current deskmeter task, with always-on-top and sticky (visible on all workspaces) properties.
|
||||
|
||||
## Why Use This?
|
||||
|
||||
- **Testing**: Test the dmweb API integration without needing to restart GNOME Shell
|
||||
- **Temporary solution**: Use while waiting to log out/in to activate the extension
|
||||
- **Standalone mode**: If you prefer a window instead of a panel indicator
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Python 3 with GTK4 bindings (`python3-gi`)
|
||||
- dmweb server running on `http://localhost:10000`
|
||||
- `wmctrl` installed (for always-on-top functionality)
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Option 1: Using the launcher script (recommended)
|
||||
|
||||
```bash
|
||||
cd /home/mariano/wdir/dm-gnomeext
|
||||
./run_task_window.sh
|
||||
```
|
||||
|
||||
This will:
|
||||
1. Start the task window
|
||||
2. Automatically set it to always-on-top
|
||||
3. Make it visible on all workspaces (sticky)
|
||||
|
||||
### Option 2: Run Python script directly
|
||||
|
||||
```bash
|
||||
cd /home/mariano/wdir/dm-gnomeext
|
||||
python3 task_window.py
|
||||
```
|
||||
|
||||
Then manually set window properties:
|
||||
- Right-click window title bar → "Always on Top"
|
||||
- Right-click window title bar → "Always on Visible Workspace" (if available)
|
||||
|
||||
Or use wmctrl:
|
||||
```bash
|
||||
# After window appears
|
||||
wmctrl -r "Deskmeter Task" -b add,above,sticky
|
||||
```
|
||||
|
||||
## What You'll See
|
||||
|
||||
- **Loading...** - Initial state while fetching first task
|
||||
- **work/default** - Your current task path (updates every 2.2 seconds)
|
||||
- **offline - dmweb not running** (red) - Cannot connect to API
|
||||
- **error - invalid API response** (orange) - API returned invalid JSON
|
||||
- **no task** - Valid response but no current task set
|
||||
|
||||
## Configuration
|
||||
|
||||
Edit `task_window.py` to customize:
|
||||
|
||||
```python
|
||||
UPDATE_INTERVAL = 2200 # Update frequency in milliseconds
|
||||
DESKMETER_API_URL = 'http://localhost:10000/api/current_task' # API endpoint
|
||||
```
|
||||
|
||||
Window appearance (line ~24):
|
||||
```python
|
||||
self.set_default_size(400, 80) # Width x Height
|
||||
```
|
||||
|
||||
Font size and styling (line ~27):
|
||||
```python
|
||||
self.label.set_markup('<span font_desc="14">Loading...</span>')
|
||||
```
|
||||
|
||||
## Stopping the Window
|
||||
|
||||
- Close the window normally (X button)
|
||||
- Or kill the process: `pkill -f task_window.py`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "offline - dmweb not running"
|
||||
|
||||
Start the dmweb server:
|
||||
```bash
|
||||
cd ~/path/to/dm/dmapp/dmweb
|
||||
python3 run.py
|
||||
```
|
||||
|
||||
Test manually:
|
||||
```bash
|
||||
curl http://localhost:10000/api/current_task
|
||||
```
|
||||
|
||||
### Window not staying on top
|
||||
|
||||
```bash
|
||||
# Manually set properties
|
||||
wmctrl -r "Deskmeter Task" -b add,above,sticky
|
||||
|
||||
# Check if wmctrl is installed
|
||||
which wmctrl
|
||||
# If not: sudo apt install wmctrl
|
||||
```
|
||||
|
||||
### GTK4 not found
|
||||
|
||||
```bash
|
||||
# Install GTK4 Python bindings
|
||||
sudo apt install python3-gi gir1.2-gtk-4.0
|
||||
```
|
||||
|
||||
### Window appears on wrong workspace
|
||||
|
||||
Use wmctrl to make it sticky (visible on all workspaces):
|
||||
```bash
|
||||
wmctrl -r "Deskmeter Task" -b add,sticky
|
||||
```
|
||||
|
||||
## Comparison: Window vs Extension
|
||||
|
||||
| Feature | Task Window (this) | GNOME Extension |
|
||||
|---------|-------------------|-----------------|
|
||||
| Always visible | ✅ (when on top) | ✅ (in panel) |
|
||||
| All workspaces | ✅ (sticky) | ✅ (panel always visible) |
|
||||
| Screen space | Takes window space | No extra space |
|
||||
| Setup | Run anytime | Requires logout/login |
|
||||
| Integration | Separate window | Native panel integration |
|
||||
| Restart needed | No | Yes (on Wayland) |
|
||||
|
||||
## Usage Tips
|
||||
|
||||
1. **Position**: Drag to top-right corner of screen for minimal interference
|
||||
2. **Size**: The window can be resized - smaller is less intrusive
|
||||
3. **Transparency**: You can use GNOME Tweaks to make unfocused windows transparent
|
||||
4. **Auto-start**: Add to Startup Applications if you want it to run on login
|
||||
|
||||
## Adding to Startup (Optional)
|
||||
|
||||
```bash
|
||||
# Create desktop entry
|
||||
cat > ~/.config/autostart/deskmeter-task-window.desktop <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Deskmeter Task Window
|
||||
Exec=/home/mariano/wdir/dm-gnomeext/run_task_window.sh
|
||||
Hidden=false
|
||||
NoDisplay=false
|
||||
X-GNOME-Autostart-enabled=true
|
||||
EOF
|
||||
```
|
||||
|
||||
## Files
|
||||
|
||||
- `task_window.py` - Main GTK4 Python application
|
||||
- `run_task_window.sh` - Launcher script with wmctrl integration
|
||||
- `TASK_WINDOW_README.md` - This file
|
||||
|
||||
## Next Steps
|
||||
|
||||
Once you've tested that the API integration works with this window, you can log out/in to test the GNOME extension, which will provide the same information in the panel without taking up window space.
|
||||
Reference in New Issue
Block a user