2023-01-29 22:18:22 +01:00
---
title: Variables References
---
## XDG directories
### User directories
2024-10-01 23:26:58 +02:00
< figure markdown >
2024-06-14 06:40:09 +02:00
| Description | Name | Default Value(s) |
2024-10-01 23:26:58 +02:00
|-------------|------|------------------|
2023-01-29 22:18:22 +01:00
| Desktop | `@{XDG_DESKTOP_DIR}` | `Desktop` |
| Documents | `@{XDG_DOCUMENTS_DIR}` | `Documents` |
2024-06-14 19:54:35 +02:00
| Downloads | `@{XDG_DOWNLOAD_DIR}` | `Downloads` |
2023-01-29 22:18:22 +01:00
| Music | `@{XDG_MUSIC_DIR}` | `Music` |
| Pictures | `@{XDG_PICTURES_DIR}` | `Pictures` |
2024-06-14 19:54:35 +02:00
| Videos | `@{XDG_VIDEOS_DIR}` | `Videos` |
2023-01-29 22:18:22 +01:00
| Screenshots | `@{XDG_SCREENSHOTS_DIR}` | `@{XDG_PICTURES_DIR}/Screenshots` |
2024-06-14 19:54:35 +02:00
| Wallpapers | `@{XDG_WALLPAPERS_DIR}` | `@{XDG_PICTURES_DIR}/Wallpapers` |
| Books | `@{XDG_BOOKS_DIR}` | `Books` |
| Games | `@{XDG_GAMES_DIR}` | `.games` |
2024-06-14 06:40:09 +02:00
| Templates | `@{XDG_TEMPLATES_DIR}` | `Templates` |
2024-06-14 19:54:35 +02:00
| Public | `@{XDG_PUBLICSHARE_DIR}` | `Public` |
| Projects | `@{XDG_PROJECTS_DIR}` | `Projects` |
2024-06-14 20:40:45 +02:00
| Private | `@{XDG_PRIVATE_DIR}` | `.{p,P}rivate {p,P}rivate` |
| Work | `@{XDG_WORK_DIR}` | `Work` |
| Mail | `@{XDG_MAIL_DIR}` | `Mail .{m,M}ail` |
2024-06-14 19:54:35 +02:00
| Sync | `@{XDG_SYNC_DIR}` | `Sync` |
2023-01-29 22:18:22 +01:00
| Torrents | `@{XDG_TORRENTS_DIR}` | `Torrents` |
2024-08-30 21:38:30 +02:00
| Vm | `@{XDG_VM_DIR}` | `.vm` |
2024-11-21 21:59:06 +01:00
| Vm Shares | `@{XDG_VMSHARE_DIR}` | `VM_Shares` |
2024-06-14 19:54:35 +02:00
| Disk images | `@{XDG_IMG_DIR}` | `images` |
2024-08-30 21:38:30 +02:00
| Games Studio | `@{XDG_GAMESSTUDIO_DIR}` | `.unity3d` |
2023-01-29 22:18:22 +01:00
2024-10-01 23:26:58 +02:00
< / figure >
2023-01-29 22:18:22 +01:00
### Dotfiles
2024-10-01 23:26:58 +02:00
< figure markdown >
2024-06-14 06:40:09 +02:00
| Description | Name | Default Value(s) |
2024-10-01 23:26:58 +02:00
|-------------|------|------------------|
2023-08-17 20:28:10 +02:00
| Cache | ` @{XDG_CACHE_DIR}` | `.cache` |
| Config | `@{XDG_CONFIG_DIR}` | `.config` |
| Data | `@{XDG_DATA_DIR}` | `.local/share` |
2024-06-14 19:54:35 +02:00
| State | `@{XDG_STATE_DIR}` | `.local/state` |
| Bin | `@{XDG_BIN_DIR}` | `.local/bin` |
2023-08-17 20:28:10 +02:00
| Lib | `@{XDG_LIB_DIR}` | `.local/lib` |
2024-06-14 19:54:35 +02:00
| GPG | `@{XDG_GPG_DIR}` | `.gnupg` |
2024-06-14 06:40:09 +02:00
| SSH | `@{XDG_SSH_DIR}` | `.ssh` |
2024-06-14 20:40:45 +02:00
| Private | `@{XDG_PRIVATE_DIR}` | `.{p,P}rivate {p,P}rivate` |
2024-06-14 19:54:35 +02:00
| Passwords | `@{XDG_PASSWORD_STORE_DIR}` | `.password-store` |
2024-10-01 23:26:58 +02:00
< / figure >
2023-01-29 22:18:22 +01:00
### Full configuration path
2024-10-01 23:26:58 +02:00
< figure markdown >
2024-06-14 06:40:09 +02:00
| Description | Name | Default Value(s) |
2024-10-01 23:26:58 +02:00
|-------------|------|------------------|
2023-08-17 20:28:10 +02:00
| Cache | `@{user_cache_dirs}` | `@{HOME}/@{XDG_CACHE_DIR}` |
| Config | `@{user_config_dirs}` | `@{HOME}/@{XDG_CONFIG_DIR}` |
2024-06-14 19:54:35 +02:00
| Bin | `@{user_bin_dirs}` | `@{HOME}/@{XDG_BIN_DIR}` |
2024-06-14 06:40:09 +02:00
| Lib | `@{user_lib_dirs}` | `@{HOME}/@{XDG_LIB_DIR}` |
2023-08-17 20:28:10 +02:00
| Share | `@{user_share_dirs}` | ` @{HOME}/@{XDG_DATA_DIR}` |
| State | `@{user_state_dirs}` | ` @{HOME}/@{XDG_STATE_DIR}` |
2024-10-01 23:26:58 +02:00
| Build | `@{user_build_dirs}` | `/tmp/build/` |
2024-06-14 19:54:35 +02:00
| Packages | `@{user_pkg_dirs}` | `/tmp/pkg/` |
2023-01-29 22:18:22 +01:00
2024-10-01 23:26:58 +02:00
< / figure >
2023-01-29 22:18:22 +01:00
### Full user path
2024-10-01 23:26:58 +02:00
< figure markdown >
2024-06-14 06:40:09 +02:00
| Description | Name | Default Value(s) |
2024-10-01 23:26:58 +02:00
|-------------|------|------------------|
2023-01-29 22:18:22 +01:00
| Documents | `@{user_documents_dirs}` | `@{HOME}/@{XDG_DOCUMENTS_DIR} @{MOUNTS}/@{XDG_DOCUMENTS_DIR}` |
2024-06-14 19:54:35 +02:00
| Downloads | `@{user_download_dirs}` | `@{HOME}/@{XDG_DOWNLOAD_DIR} @{MOUNTS}/@{XDG_DOWNLOAD_DIR}` |
2023-01-29 22:18:22 +01:00
| Music | `@{user_music_dirs}` | `@{HOME}/@{XDG_MUSIC_DIR} @{MOUNTS}/@{XDG_MUSIC_DIR}` |
| Pictures | `@{user_pictures_dirs}` | `@{HOME}/@{XDG_PICTURES_DIR} @{MOUNTS}/@{XDG_PICTURES_DIR}` |
2024-06-14 19:54:35 +02:00
| Videos | `@{user_videos_dirs}` | `@{HOME}/@{XDG_VIDEOS_DIR} @{MOUNTS}/@{XDG_VIDEOS_DIR}` |
| Books | `@{user_books_dirs}` | `@{HOME}/@{XDG_BOOKS_DIR} @{MOUNTS}/@{XDG_BOOKS_DIR}` |
| Games | `@{user_games_dirs}` | `@{HOME}/@{XDG_GAMES_DIR} @{MOUNTS}/@{XDG_GAMES_DIR}` |
2024-06-14 20:40:45 +02:00
| Private | `@{user_private_dirs}` | `@{HOME}/@{XDG_PRIVATE_DIR} @{MOUNTS}/@{XDG_PRIVATE_DIR}` |
2024-11-21 21:59:06 +01:00
| Passwords | `@{user_passwordstore_dirs}` | `@{HOME}/@{XDG_PASSWORD_STORE_DIR} @{MOUNTS}/@{XDG_PASSWORD_STORE_DIR}` |
2024-06-14 20:40:45 +02:00
| Work | `@{user_work_dirs}` | `@{HOME}/@{XDG_WORK_DIR} @{MOUNTS}/@{XDG_WORK_DIR}` |
| Mail | `@{user_mail_dirs}` | `@{HOME}/@{XDG_MAIL_DIR} @{MOUNTS}/@{XDG_MAIL_DIR}` |
2023-01-29 22:18:22 +01:00
| Projects | `@{user_projects_dirs}` | `@{HOME}/@{XDG_PROJECTS_DIR} @{MOUNTS}/@{XDG_PROJECTS_DIR}` |
| Public | `@{user_publicshare_dirs}` | `@{HOME}/@{XDG_PUBLICSHARE_DIR} @{MOUNTS}/@{XDG_PUBLICSHARE_DIR}` |
| Templates | `@{user_templates_dirs}` | `@{HOME}/@{XDG_TEMPLATES_DIR} @{MOUNTS}/@{XDG_TEMPLATES_DIR}` |
| Torrents | `@{user_torrents_dirs}` | `@{HOME}/@{XDG_TORRENTS_DIR} @{MOUNTS}/@{XDG_TORRENTS_DIR}` |
2024-06-14 19:54:35 +02:00
| Sync | `@{user_sync_dirs}` | `@{HOME}/@{XDG_SYNC_DIR} @{MOUNTS}/*/@{XDG_SYNC_DIR}` |
2024-08-30 21:38:30 +02:00
| Vm | `@{user_vm_dirs}` | `@{HOME}/@{XDG_VM_DIR} @{MOUNTS}/@{XDG_VM_DIR}` |
2024-11-21 21:59:06 +01:00
| Vm Shares | `@{user_vmshare_dirs}` | `@{HOME}/@{XDG_VMSHARE_DIR} @{MOUNTS}/@{XDG_VMSHARE_DIR}` |
2024-08-30 21:38:30 +02:00
| Disk images | `@{user_img_dirs}` | `@{HOME}/@{XDG_IMG_DIR} @{MOUNTS}/@{XDG_IMG_DIR}` |
2023-01-29 22:18:22 +01:00
2024-10-01 23:26:58 +02:00
< / figure >
2023-01-29 22:18:22 +01:00
## System variables
2024-10-01 23:26:58 +02:00
!!! danger
2023-01-29 22:18:22 +01:00
Do not modify these variables unless you know what you are doing
2024-10-01 23:26:58 +02:00
#### Base variables
< figure markdown >
2023-08-19 15:32:08 +02:00
2024-06-14 06:40:09 +02:00
| Description | Name | Default Value(s) |
2024-10-01 23:26:58 +02:00
|-------------|------|------------------|
| Any digit | `@{d}` | `[0-9]` |
| Any letter | `@{l}` | `[a-zA-Z]` |
2024-06-14 06:40:09 +02:00
| Single alphanumeric character | `@{c}` | `[0-9a-zA-Z]` |
2024-10-01 23:26:58 +02:00
| Word character: matches any letter, digit or underscore. | `@{w}` | `[0-9a-zA-Z_]` |
| Single hexadecimal character | `@{h}` | `[0-9a-fA-F]` |
| Integer up to 10 digits (0-9999999999) | `@{int}` | `@{d}{@{d},}{@{d},}{@{d},}{@{d},}{@{d},}{@{d},}{@{d},}{@{d},}{@{d},}` |
| Unsigned integer over 8 bits (0-255) | `@{u8}` | `[0-9]{[0-9],} 1[0-9][0-9] 2[0-4][0-9] 25[0-5]` |
| Unsigned integer over 16 bits (0-65535, 5 digits) | `@{u16}` | `@{d}{@{d},}{@{d},}{@{d},}{@{d},}` |
| Hexadecimal up to 64 characters | `@{hex}` | |
| Alphanumeric up to 64 characters | `@{rand}` | |
| Word up to 64 characters | `@{word}` | |
< / figure >
#### Basic variables of a given length
< figure markdown >
2023-08-19 15:32:08 +02:00
2024-10-01 23:26:58 +02:00
| Description | Name |
|-------------|------|
| Any x digits characters | `@{int2}` `@{int4}` `@{int6}` `@{int8}` `@{int9}` `@{int10}` `@{int12}` `@{int15}` `@{int16}` `@{int32}` `@{int64}` |
| Any x hexadecimal characters | `@{hex2}` `@{hex4}` `@{hex6}` `@{hex8}` `@{hex9}` `@{hex10}` `@{hex12}` `@{hex15}` `@{hex16}` `@{hex32}` `@{hex38}` `@{hex64}` |
| Any x alphanumeric characters | `@{rand2}` `@{rand4}` `@{rand6}` `@{rand8}` `@{rand9}` `@{rand10}` `@{rand12}` `@{rand15}` `@{rand16}` `@{rand32}` `@{rand64}` |
| Any x word characters | `@{word2}` `@{word4}` `@{word6}` `@{word8}` `@{word9}` `@{word10}` `@{word12}` `@{word15}` `@{word16}` `@{word32}` `@{word64}` |
< / figure >
#### System Variables
< figure markdown >
2023-08-19 15:32:08 +02:00
2024-06-14 06:40:09 +02:00
| Description | Name | Default Value(s) |
2024-10-01 23:26:58 +02:00
|-------------|------|------------------|
| Common architecture names | `@{arch}` | `x86_64 amd64 i386 i686` |
| Dbus unique name | `@{busname}` | `:1.@{u16} :not.active.yet` |
| Universally unique identifier | `@{uuid}` | `@{h}@{h}@{h}@{h}@{h}@{h}@{h}@{h}[-_]@{h}@{h}@{h}@{h}[-_]@{h}@{h}@{h}@{h}[-_]@{h}@{h}@{h}@{h}[-_]@{h}@{h}@{h}@{h}@{h}@{h}@{h}@{h}@{h}@{h}@{h}@{h}` |
| Username valid characters | `@{user}` | `[a-zA-Z_]{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}{@{w},}` |
| Group valid characters | `@{group}` | `@{user}` |
| Semantic version | `@{version}` | `@{int}{.@{int},}{.@{int},}{-@{rand},}` |
| Current Process Id | `@{pid}` | `{[1-9],[1-9][0-9],[1-9][0-9][0-9],[1-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9][0-9],[1-4][0-9][0-9][0-9][0-9][0-9][0-9]}` |
| Processes Ids | `@{pids}` | `@{pid}` |
| Thread Id | `@{tid}` | `@{pid}` |
| User Id (equivalent to `@{int}` ) | `@{uid}` | `{[0-9],[1-9][0-9],[1-9][0-9][0-9],[1-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9],[1-4][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]}` |
< / figure >
#### System Paths
< figure markdown >
| Description | Name | Default Value(s) |
|-------------|------|------------------|
2024-06-14 19:54:35 +02:00
| Root Home | `@{HOMEDIRS}` | `/home/` |
2024-06-14 06:40:09 +02:00
| Home directories | `@{HOME}` | `@{HOMEDIRS}/*/ /root/` |
2024-10-01 23:26:58 +02:00
| Root Mountpoints | `@{MOUNTDIRS}` | `/media/ @{run}/media/@{user}/ /mnt/` |
| Mountpoints directories | `@{MOUNTS}` | `@{MOUNTDIRS}/*/ @{run}/user/@{uid}/gvfs/` |
2024-06-14 19:54:35 +02:00
| Bin | `@{bin}` | `/{usr/,}{s,}bin` |
| Lib | `@{lib}` | `/{usr/,}lib{,exec,32,64}` |
2024-06-14 06:40:09 +02:00
| multi-arch library | `@{multiarch}` | `*-linux-gnu*` |
2024-06-14 19:54:35 +02:00
| Proc | `@{PROC}` | `/proc/` |
2023-01-29 22:18:22 +01:00
| Run | `@{run}` | `/run/ /var/run/` |
| Sys | `@{sys}` | `/sys/` |
| System wide share | `@{system_share_dirs}` | `/{usr,usr/local,var/lib/@{flatpak_exports_root}}/share` |
2024-06-14 19:54:35 +02:00
| Flatpak export | `@{flatpak_exports_root}` | `{flatpak/exports,flatpak/{app,runtime}/*/*/*/*/export}` |
2024-01-27 20:54:13 +01:00
2024-10-01 23:26:58 +02:00
< / figure >
#### System Internal
2024-01-27 20:54:13 +01:00
2024-06-14 06:40:09 +02:00
| Description | Name | Default Value(s) |
2024-10-01 23:26:58 +02:00
|-------------|------|------------------|
| PCI Devices | `@{pci}` | `@{pci_bus}/**/` |
| PCI Bus | `@{pci_bus}` | `pci@{h}@{h}@{h}@{h}:@{h}@{h}` |
| PCI Id | `@{pci_id}` | `@{h}@{h}@{h}@{h}:@{h}@{h}:@{h}@{h}.@{h}` |
| HCI devices | `@{hci_id}` | `dev_@{c}@{c}_@{c}@{c}_@{c}@{c}_@{c}@{c}_@{c}@{c}_@{c}@{c}` |
| Udev data dynamic assignment ranges (234 to 254 then 384 to 511) | `@{dynamic}` | `23[4-9] 24[0-9] 25[0-4] 38[4-9] 39[0-9] 4[0-9][0-9] 50[0-9] 51[0-1]` |
#### Program paths
< figure markdown >
| Description | Name | Default Value(s) |
|-------------|------|------------------|
2024-01-27 20:54:13 +01:00
| All the shells | `@{shells}` | `sh zsh bash dash fish rbash ksh tcsh csh` |
2024-06-14 19:54:35 +02:00
| Shells path | `@{shells_path}` | `@{bin}/@{shells}` |
2024-01-27 20:54:13 +01:00
| Coreutils programs that should not have dedicated profile | `@{coreutils}` | See [tunables/multiarch.d/paths ](https://github.com/roddhjav/apparmor.d/blob/c2d88c9bffc626fcf7d9b15b42b50706afb29562/apparmor.d/tunables/multiarch.d/paths#L46 ) |
| Coreutils paths | `@{coreutils_path}` | `@{bin}/@{coreutils}` |
2024-09-05 15:05:35 +02:00
| Launcher paths | `@{open_path}` | `@{bin}/exo-open @{bin}/xdg-open @{lib}/@{multiarch}/glib-@{version}/gio-launch-desktop @{lib}/gio-launch-desktop`
2024-06-14 19:54:35 +02:00
| All browser paths | `@{*_path}` | See [tunables/multiarch.d/paths ](https://github.com/roddhjav/apparmor.d/blob/c2d88c9bffc626fcf7d9b15b42b50706afb29562/apparmor.d/tunables/multiarch.d/paths#L11 )
2024-10-01 23:26:58 +02:00
< / figure >