dobu-run: Implement /dev/input access
This commit is contained in:
parent
0ea062b5e4
commit
27eb066260
|
@ -3,3 +3,6 @@ HOMEDIR_STORAGE=$HOME/.local/share/dobu/homedir
|
|||
# Whether btrfs subvolumes should be used for homes instead of
|
||||
# normal subdirectories
|
||||
HOMEDIR_IS_BTRFS=false
|
||||
|
||||
# Array of containers that are granted full /dev/input access
|
||||
DEV_INPUT_ALLOWLIST=()
|
||||
|
|
10
dobu-run.sh
10
dobu-run.sh
|
@ -41,6 +41,14 @@ if [ ! -d "$home_path" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
extra_args=""
|
||||
|
||||
# Check if we should allow /dev/input access
|
||||
if is_in_array "$1" "${DEV_INPUT_ALLOWLIST[@]}"; then
|
||||
log "Granting full /dev/input access"
|
||||
extra_args="$extra_args -v /dev/input:/dev/input"
|
||||
fi
|
||||
|
||||
# The fun part: start the container!
|
||||
# Don't detach like we did with Sommelier, though
|
||||
podman run --rm --userns=keep-id:uid=1100,gid=1100 \
|
||||
|
@ -71,4 +79,4 @@ podman run --rm --userns=keep-id:uid=1100,gid=1100 \
|
|||
-e QT_SCALE_FACTOR="$QT_SCALE_FACTOR" \
|
||||
-e QT_SCREEN_SCALE_FACTORS="$QT_SCREEN_SCALE_FACTORS" \
|
||||
-e QT_AUTO_SCREEN_SCALE_FACTOR="$QT_AUTO_SCREEN_SCALE_FACTOR" \
|
||||
"$image_name"
|
||||
$extra_args "$image_name"
|
||||
|
|
|
@ -23,6 +23,13 @@ log() {
|
|||
echo "[$(date +%Y-%m-%dT%H:%M:%S)][dobu] $1"
|
||||
}
|
||||
|
||||
is_in_array() {
|
||||
local e match="$1"
|
||||
shift
|
||||
for e; do [[ "$e" == "$match" ]] && return 0; done
|
||||
return 1
|
||||
}
|
||||
|
||||
path_to_image_name() {
|
||||
local context_path="$1"
|
||||
|
||||
|
|
Loading…
Reference in a new issue