Register a valid shared-mime-info type for *.pos files.
The previous MIME package XML was malformed, so the desktop fell back to text/plain and could not bind double-click to posprint. Co-authored-by: Cursor <cursoragent@cursor.com>
@@ -93,6 +93,28 @@ sudo pacman -S --needed base-devel rust pkgconf openssl libxkbcommon libxcb dbus
93
93
wayland libx11 fontconfig freetype2 libglvnd git rsync
94
94
```
95
95
96
### File association (`.pos` → posprint)
97
98
The package installs:
99
100
- `/usr/share/mime/packages/posprint.xml` → MIME type `application/x-posprint` for `*.pos`
101
- `/usr/share/applications/posprint.desktop` → claims that MIME type
102
103
After `pacman -U`, pacman hooks refresh the MIME and desktop databases. To make posprint the **default** opener (double-click):
104
105
```bash
106
xdg-mime default posprint.desktop application/x-posprint
107
xdg-mime query filetype some.pos # expect: application/x-posprint
108
xdg-mime query default application/x-posprint # expect: posprint.desktop
109
```
110
111
If `query filetype` still says `text/plain`, the MIME package was not installed or the cache is stale:
112
113
```bash
114
sudo update-mime-database /usr/share/mime
115
sudo update-desktop-database /usr/share/applications
116
```
117
96
118
## Tests before release
97
119
98
120
```bash
@@ -93,6 +93,28 @@ sudo pacman -S --needed base-devel rust pkgconf openssl libxkbcommon libxcb dbus93
wayland libx11 fontconfig freetype2 libglvnd git rsync93
wayland libx11 fontconfig freetype2 libglvnd git rsync94
```94
```95
95
96
### File association (`.pos` → posprint)97
98
The package installs:99
100
- `/usr/share/mime/packages/posprint.xml` → MIME type `application/x-posprint` for `*.pos`101
- `/usr/share/applications/posprint.desktop` → claims that MIME type102
103
After `pacman -U`, pacman hooks refresh the MIME and desktop databases. To make posprint the **default** opener (double-click):104
105
```bash106
xdg-mime default posprint.desktop application/x-posprint107
xdg-mime query filetype some.pos # expect: application/x-posprint108
xdg-mime query default application/x-posprint # expect: posprint.desktop109
```110
111
If `query filetype` still says `text/plain`, the MIME package was not installed or the cache is stale:112
113
```bash114
sudo update-mime-database /usr/share/mime115
sudo update-desktop-database /usr/share/applications116
```117
96
## Tests before release118
## Tests before release97
119
98
```bash120
```bash@@ -3,7 +3,8 @@
3
3
A `.pos` file stores a POS print template: metadata (page settings, title) plus the DSL document body as plain text.
4
4
5
5
**Format:** JSON envelope with a `.pos` extension (human-readable, git-friendly).
6
**MIME type (suggested):** `application/vnd.posprint+json`
6
**MIME type:** `application/x-posprint` (registered via `packaging/mime/posprint.xml`; claimed by `*.pos`)
7
7
8
8
9
---
9
10
@@ -3,7 +3,8 @@3
A `.pos` file stores a POS print template: metadata (page settings, title) plus the DSL document body as plain text.3
A `.pos` file stores a POS print template: metadata (page settings, title) plus the DSL document body as plain text.4
4
5
**Format:** JSON envelope with a `.pos` extension (human-readable, git-friendly). 5
**Format:** JSON envelope with a `.pos` extension (human-readable, git-friendly). 6
**MIME type (suggested):** `application/vnd.posprint+json`6
**MIME type:** `application/x-posprint` (registered via `packaging/mime/posprint.xml`; claimed by `*.pos`)7
7
8
8
---9
---9
10
@@ -197,3 +197,10 @@ Receipt: ${DocumentNumber}
197
197
## `.pos` file format
198
198
199
199
JSON with `version`, `metadata`, and `body` (template source).
200
201
**MIME type:** `application/x-posprint` (extension `*.pos`). On Linux, after installing the package, set posprint as the default opener if needed:
202
203
```bash
204
xdg-mime default posprint.desktop application/x-posprint
205
xdg-mime query filetype ~/Templates/receipt.pos # should print application/x-posprint
206
```
@@ -197,3 +197,10 @@ Receipt: ${DocumentNumber}197
## `.pos` file format197
## `.pos` file format198
198
199
JSON with `version`, `metadata`, and `body` (template source).199
JSON with `version`, `metadata`, and `body` (template source).200
201
**MIME type:** `application/x-posprint` (extension `*.pos`). On Linux, after installing the package, set posprint as the default opener if needed:202
203
```bash204
xdg-mime default posprint.desktop application/x-posprint205
xdg-mime query filetype ~/Templates/receipt.pos # should print application/x-posprint206
```@@ -1,6 +1,9 @@
1
1
<?xml version="1.0" encoding="UTF-8"?>
2
<mime-type xmlns="http://www.freedesktop.org/stand-alone/xml-mime-type">
3
<comment>POS print template</comment>
4
<glob pattern="*.pos"/>
5
<icon name="posprint"/>
6
</mime-type>
2
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
3
<mime-type type="application/x-posprint">
4
<comment>POS print template</comment>
5
<comment xml:lang="nl">POS-printsjabloon</comment>
6
<glob pattern="*.pos"/>
7
<icon name="posprint"/>
8
</mime-type>
9
</mime-info>
@@ -1,6 +1,9 @@1
<?xml version="1.0" encoding="UTF-8"?>1
<?xml version="1.0" encoding="UTF-8"?>2
<mime-type xmlns="http://www.freedesktop.org/stand-alone/xml-mime-type">2
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">3
<comment>POS print template</comment>3
<mime-type type="application/x-posprint">4
<glob pattern="*.pos"/>4
<comment>POS print template</comment>5
<icon name="posprint"/>5
<comment xml:lang="nl">POS-printsjabloon</comment>6
</mime-type>6
<glob pattern="*.pos"/>7
<icon name="posprint"/>8
</mime-type>9
</mime-info>