Skip to main content

Manipulate GSettings arrays.

Project description

GSettings Array Manipulator

Codecov

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:

  1. 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 the sources array of the org.gnome.desktop.input-sources schema. The --dedup option ensures that no duplicates will be present in the array.

  2. List Command:

    gsettings-array ls "org.gnome.desktop.input-sources" "sources"
    

    This command lists all items in the sources array of the org.gnome.desktop.input-sources schema.

  3. Sort Command:

    gsettings-array sort "org.gnome.desktop.input-sources" "sources"
    

    This command sorts all items in the sources array of the org.gnome.desktop.input-sources schema.

  4. Deduplicate Command:

    gsettings-array dedup "org.gnome.desktop.input-sources" "sources"
    

    This command removes duplicate items from the sources array of the org.gnome.desktop.input-sources schema.

  5. Pop Command:

    gsettings-array pop "org.gnome.desktop.input-sources" "sources" 0
    

    This command prints and removes the item at index 0 from the sources array of the org.gnome.desktop.input-sources schema.

  6. 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 the sources array of the org.gnome.desktop.input-sources schema.

  7. Clear Command:

    gsettings-array clear "org.gnome.desktop.input-sources" "sources"
    

    This command removes all items from the sources array of the org.gnome.desktop.input-sources schema.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsettings_array-1.0.1.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gsettings_array-1.0.1-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

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

Hashes for gsettings_array-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e334b67e3bb99a5b5dd6e053b49f3370393dc8d78c78723977429ebce1783c81
MD5 20a88ea32885e06b1e75a7050a9d628f
BLAKE2b-256 c2a46941a86ef41b5cc48cfb3076532f518d3e2083cb977a30d2eb471bbcde80

See more details on using hashes here.

File details

Details for the file gsettings_array-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gsettings_array-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec78fa4daafecf7bdbc6cfaf9b6fb76bfc82572c588be777de8f6d300398635e
MD5 2f5b1b5c0a13ec4e61e99c2eb946aa35
BLAKE2b-256 5e78944e46aac1b0f785d908e1cc44c4bcf98e7f1b822b120a5fd86169071d13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page