Skip to content

Commit

Permalink
Add Vis tilgængelighedsfuktioner
Browse files Browse the repository at this point in the history
  • Loading branch information
agnetemoos committed Dec 10, 2024
1 parent 4d6a8ba commit 2fc1b86
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dconf_a11y.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Vis tilgængelighedsfunktioner"
parent: "Desktop"
source: scripts/desktop/dconf_a11y.sh
parameters:
- name: "Aktivér?"
type: "boolean"
default: null
mandatory: false
compatibility:
- "22.04"
- "BorgerPC"
---

## Beskrivelse
Viser en menu for at styre systemets tilgængelighedsfunktioner øverst på skærmen.

Dette script er allerede indbygget i image 5.0.0 og fremover.

Dette script er blevet testet og virker på Ubuntu 22.04.
54 changes: 54 additions & 0 deletions scripts/dconf_a11y.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env sh

# SYNOPSIS
# dconf_policy_a11y.sh [ENFORCE]
#
# DESCRIPTION
# This script installs a policy that forces the Universal Access menu to be
# shown at all times.
#
# Use a boolean to decide whether to enforce or not. An unchecked box will
# remove the policy and a checked one will enforce it.
#
# IMPLEMENTATION
# copyright Copyright 2022, Magenta ApS
# license GNU General Public License

set -x

if get_os2borgerpc_config os2_product | grep --quiet kiosk; then
echo "Dette script er ikke designet til at blive anvendt på en kiosk-maskine."
exit 1
fi

# Change these three to set a different policy to another value
POLICY_PATH="org/gnome/desktop/a11y"
POLICY="always-show-universal-access-status"
POLICY_VALUE="true"

POLICY_FILE="/etc/dconf/db/os2borgerpc.d/00-accessibility"
POLICY_LOCK_FILE="/etc/dconf/db/os2borgerpc.d/locks/00-accessibility"

ACTIVATE=$1

# Delete the previous lock file (its name has changed)
rm --force /etc/dconf/db/os2borgerpc.d/locks/accessibility

if [ "$ACTIVATE" = 'True' ]; then

cat > "$POLICY_FILE" <<-END
[$POLICY_PATH]
$POLICY=$POLICY_VALUE
END

# Tell the system that the values of the dconf keys we've just set can no
# longer be overridden by the user
cat > "$POLICY_LOCK_FILE" <<-END
/$POLICY_PATH/$POLICY
END
else
rm -f "$POLICY_FILE" "$POLICY_LOCK_FILE"
fi

# Incorporate all of the text files we've just created into the system's dconf databases
dconf update

0 comments on commit 2fc1b86

Please sign in to comment.