Manipulate GSettings arrays.
Project description
GSettings Array Manipulator
Welcome to the GSettings Array Manipulator, a powerful command-line tool designed to simplify and streamline your interactions with GSettings arrays. With this tool, you can perform a variety of tasks, from inserting items into an array to sorting and deduplicating items, all with a few simple commands.
Features
- Insert: Add one or more items to your array at a specified index.
- List: Display all items in your array, each on a new line.
- Sort: Sort all items in your array.
- Deduplicate: Remove duplicate items from your array.
- Pop: Print and remove the item at a specified index.
- Remove: Delete one or more items from your array.
- Clear: Remove all items from your array.
Installation
You can download and make the script executable using the following commands:
wget https://gist.github.com/rindeal/c5786254410028f760ee2351d884a744/raw/gsettings-array.py
chmod +x gsettings-array.py
Usage
The general usage of the GSettings Array Manipulator is as follows:
./gsettings-array.py COMMAND
Replace COMMAND with one of the available commands listed in the Features section.
For detailed usage instructions for each command, use the -h or --help option after the command, like so:
./gsettings-array.py COMMAND -h
Examples
Here are some examples of how to use the various commands:
-
Insert Command:
gsettings-array insert --dedup "org.gnome.desktop.input-sources" "sources" 0 "('xkb', 'us+cz_sk_de')"
This command inserts the tuple
('xkb', 'us+cz_sk_de')at index 0 in thesourcesarray of theorg.gnome.desktop.input-sourcesschema. The--dedupoption ensures that no duplicates will be present in the array. -
List Command:
gsettings-array ls "org.gnome.desktop.input-sources" "sources"
This command lists all items in the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Sort Command:
gsettings-array sort "org.gnome.desktop.input-sources" "sources"
This command sorts all items in the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Deduplicate Command:
gsettings-array dedup "org.gnome.desktop.input-sources" "sources"
This command removes duplicate items from the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Pop Command:
gsettings-array pop "org.gnome.desktop.input-sources" "sources" 0
This command prints and removes the item at index 0 from the
sourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Remove Command:
gsettings-array rm "org.gnome.desktop.input-sources" "sources" "('xkb', 'us+cz_sk_de')"
This command removes the tuple
('xkb', 'us+cz_sk_de')from thesourcesarray of theorg.gnome.desktop.input-sourcesschema. -
Clear Command:
gsettings-array clear "org.gnome.desktop.input-sources" "sources"
This command removes all items from the
sourcesarray of theorg.gnome.desktop.input-sourcesschema.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsettings_array-1.0.1.tar.gz.
File metadata
- Download URL: gsettings_array-1.0.1.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e334b67e3bb99a5b5dd6e053b49f3370393dc8d78c78723977429ebce1783c81
|
|
| MD5 |
20a88ea32885e06b1e75a7050a9d628f
|
|
| BLAKE2b-256 |
c2a46941a86ef41b5cc48cfb3076532f518d3e2083cb977a30d2eb471bbcde80
|
File details
Details for the file gsettings_array-1.0.1-py3-none-any.whl.
File metadata
- Download URL: gsettings_array-1.0.1-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec78fa4daafecf7bdbc6cfaf9b6fb76bfc82572c588be777de8f6d300398635e
|
|
| MD5 |
2f5b1b5c0a13ec4e61e99c2eb946aa35
|
|
| BLAKE2b-256 |
5e78944e46aac1b0f785d908e1cc44c4bcf98e7f1b822b120a5fd86169071d13
|