Commands

The following commands are available in the latest version of Quickonf. Use the field below to filter them.

alternatives.set

Set an alternative

Arguments:

  1. Name of the alternative
  2. Value to set (file path)

No output

Example:

Use Vim
  alternatives.set vi /usr/bin/vim.basic

apt.install

Install a package using apt

Arguments:

  1. Name of the package to install

No output

Example:

Install the "ipcalc" tool
  apt.install ipcalc

apt.key

Add apt key

Arguments:

  1. Local name of the key (simple short text)
  2. Key

No output

Example:

NextDNS
  key = http.get.var https://repo.nextdns.io/nextdns.gpg
  apt.key nextdns <key>

apt.remove

Remove a package using apt

Arguments:

  1. Name of the package to remove

No output

Example:

Remove the "ipcalc" tool
  apt.remove ipcalc

apt.search

Search for a package according to a regexp

Arguments:

  1. Regexp to match the package name

Outputs:

  1. Name of the found package (last one in aphabetical order, if there are multiple matching packages)

Example:

Install the latest NVidia driver
  pkg = apt.search ^nvidia-driver-.*-open$
  apt.install <pkg>

apt.source

Add apt source repository(ies), and update the available packages list if needed

Arguments:

  1. Local name of the source(s) (simple short text)
  2. Source(s)

No output

Example:

NextDNS
  apt.source nextdns "deb https://repo.nextdns.io/deb stable main"

apt.upgrade

Upgrade packages from apt repositories

No arguments

No output

Example:

Upgrade packages
  apt.upgrade

debconf.set

Set a debconf parameter

Arguments:

  1. Package where the parameter belong
  2. Name of the parameter
  3. Value to apply to the parameter

No output

Example:

Install MS fonts
  debconf.set ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula true
  apt.install ttf-mscorefonts-installer

dpkg.install

Install a package using dpkg (does not check the file exists first)

Arguments:

  1. Absolute path to the package file

No output

Example:

Install that awesome package
  dpkg.install <confdir>/my-awesome-stuff.deb

dpkg.reconfigure

Reconfigure an installed dpkg package

Arguments:

  1. Name of the package

No output

Example:

libdvd-pkg
  debconf.set libdvd-pkg libdvd-pkg/first-install .
  debconf.set libdvd-pkg libdvd-pkg/post-invoke_hook-install true
  apt.install libdvd-pkg
  dpkg.reconfigure libdvd-pkg

dpkg.version

Get the version of an installed dpkg package

Arguments:

  1. Name of the package

Outputs:

  1. Version of the package

Example:

Example package version
  version = dpkg.version gnome-shell

file.absent

Make sure a file is absent

Arguments:

  1. Absolute path of the file to remove (including directory with content)

No output

Example:

Make sure there is no "Photos" directory for jack
  file.absent /home/jack/Photos

file.content

Create a file owned by root

Arguments:

  1. Absolute path of the file
  2. Content of the file

No output

Example:

Say hello
  file.content /home/hello.txt "Hello World!"

file.directory

Create a directory (path must be absolute)

Arguments:

  1. Directory path

No output

Example:

Create web root
  file.directory /srv/web

file.extract

Extract a (compressed) archive

Arguments:

  1. Archive format (one of zip, tar.xz)
  2. Archive absolute path
  3. Target absolute path

No output

Example:

Extract something
  file.extract zip /foo/bar.zip /bar

file.move

Move a file or directory to another place (does not fail if the source does not exist)

Arguments:

  1. Souce path
  2. Destination path

No output

Example:

Move previous documents directory for jane
  file.move /home/jane.old/Documents /home/jane/Documents

file.move.nocheck

Move a file or directory to another place (with no check). Necessary if the file does not exist in the check phase (for instance if it is downloaded when applying).

Arguments:

  1. Souce path
  2. Destination path

No output

Example:

Move previous documents directory for jane
  file.move.nocheck /home/jane.old/Documents /home/jane/Documents

file.perm

Change a file permissions

Arguments:

  1. Absolute path of the file
  2. Permissions (000-777)

No output

Example:

Restrict private key
  file.chown /home/alice/.ssh/id_rsa 600

file.read

Read the content of a file

Arguments:

  1. Path of the file

Outputs:

  1. Content of the file

Example:

APT sources
  aptsrc = file.read <confdir>/sources.list
  file.content /etc/apt/sources.list <aptsrc>

flatpak.install

Install a package using flatpak

Arguments:

  1. Application ID of the package to install

No output

Example:

Install "anydesk"
  flatpak.install com.anydesk.Anydesk

git.clone

Clone a git repository (if the repository already exists locally, pull the last commit) and switch to the requested reference (branch, tag...)

Arguments:

  1. Remote repository URI
  2. Clone target (absolute path)
  3. Reference (branch, tag...)

No output

Example:

Temporarily clone git repository
  tmp = temppath
  git.clone https://www.example.com/foobar.git <tmp> main

git.config

Set a git configuration parameter in the system

Arguments:

  1. Name (in the form "x.y")
  2. Value

No output

Example:

Git parameter
  git.config branch.autosetuprebase always

git.hash

Get the latest hash for a reference (generally branch or tag) in a git repository

Arguments:

  1. Git repository URI
  2. Reference (generally, branch or tag)

Outputs:

  1. Commit hash

Example:

Pop Shell
  pophash = git.hash https://github.com/pop-os/shell.git master

github.latest

Check the latest release from a GitHub repository

Arguments:

  1. GitHub repository name
  2. Pattern to match an asset

Outputs:

  1. Release name
  2. Asset URL

Example:

Kmonad
  release url = github.latest kmonad/kmonad kmonad-*-linux

github.latest.stable

Check the latest stable release from a GitHub repository

Arguments:

  1. GitHub repository name
  2. Pattern to match an asset

Outputs:

  1. Release name
  2. Asset URL

Example:

Kmonad
  release url = github.latest.stable kmonad/kmonad kmonad-*-linux

gnome.extension.install

Install a GNOME Shell extension from extensions.gnome.org

Arguments:

  1. Extension UUID

No output

Example:

Dash to dock
  gnome.extension.install dash-to-dock@micxgx.gmail.com
  gnome.extension.enable dash-to-dock@micxgx.gmail.com

http.get.file

Download a file with a HTTP GET request (URI is downloaded when applying)

Arguments:

  1. URI of the file to download
  2. Path of the destination file

No output

Example:

Download example
  http.get.file http://www.example.com /opt/example

http.get.var

Download content with a HTTP GET request (URI is downloaded when checking)

Arguments:

  1. URI of the content to download

Outputs:

  1. Downloaded content

Example:

Download example
  foobar = http.get.var http://www.example.com

http.post.var

Send content with a HTTP POST request (data is sent when checking)

Arguments:

  1. URI of the content to download
  2. Body (payload)
  3. Content type

Outputs:

  1. Downloaded content

Example:

Download example
  foobar = http.post.var http://www.example.com "example data" "application/octet-stream"

json.get

Get a JSON value from a variable

Arguments:

  1. Variable containing the JSON object
  2. Path of the value to get

Outputs:

  1. Value

Example:

Get a value
  val = json.get "{\"download\":{\"url\":\"http://www.example.com/\"}}" download.url

make

Execute the make command

Arguments:

  1. Directory where to execute the command
  2. Make target

No output

Example:

Compile foobar
  make /tmp/foobar compile

nm.hotspot

Setup a wifi access point (hotspot) - only one can be configured

Arguments:

  1. Network Interface name
  2. SSID of the hotspot
  3. PSK of the hotspot (password)
  4. Autoconnect (one of: 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False)

No output

Example:

Share connection
  nm.hotspot wlp4s0 mynetwork n0tSecureP4ssw0rd true

nm.import

Import a VPN configuration in NetworkManager

Arguments:

  1. Type of the VPN
  2. Path of the configuration file to import

No output

Example:

Import my VPN configuration
  nm.import openvpn /opt/openvpn.conf

nm.wifi

Have knowledge of a wifi network

Arguments:

  1. SSID of the wifi network
  2. PSK of the wifi network (password)

No output

Example:

My own wifi network
  nm.wifi mynetwork n0tSecureP4ssw0rd

pip.install

Install a Python package using pip3

Arguments:

  1. Name of the package to install

No output

Example:

Pip Passlib
  pip.install passlib

regexp.submatch

Find submatches using a regexp

Arguments:

  1. Regexp
  2. Source string

Outputs:

  1. First submatch
  2. Second submatch
  3. ...

Example:

Find src
  webpage = http.get.var http://www.example.com
  src = regexp.submatch "<script .*src=(.*)>" <webpage>
  ...

snap.install

Install a package using snap

Arguments:

  1. Name of the package to install
  2. Options, comma-separated, at least one of: stable, candidate, edge, beta, classic, dangerous

No output

Example:

Install node
  snap.install node stable

snap.version

Get the version of an installed snap package

Arguments:

  1. Name of the package

Outputs:

  1. Version of the package

Example:

Example package version
  version = snap.version obsidian

stack.install

Execute the stack command (from Haskell)

Arguments:

  1. Directory where to execute the command

No output

Example:

Install foobar
  stack.install /tmp/foobar

systemd.enable

Enable and start a systemd service

Arguments:

  1. Name of the service to enable

No output

Example:

Enable nextdns
  systemd.enable nextdns

tempdir

Create a temporary directory (directory is automatically deleted when closing the application)

No arguments

Outputs:

  1. Path of the created directory

Example:

Temporarily clone git repository
  tmp = tempdir
  git.clone https://www.example.com/foobar.git <tmp>

user.dconf.set

Set a dconf parameter

Arguments:

  1. Username
  2. Key (in the form "/x/y/z")
  3. Value

No output

Example:

Show date in GNOME
  user.dconf.set /org/gnome/desktop/interface/clock-show-date true

user.file.content

Create a file owned by a user (if path is relative, it is relative to the user's home directory)

Arguments:

  1. Username
  2. Path of the file
  3. Content of the file

No output

Example:

Say hello in /home/alice/hello.txt
  user.file.content alice hello.txt "Hello World!"

user.file.directory

Create a directory belonging to the given user (if path is relative, it is relative to the user's home directory

Arguments:

  1. Username
  2. Directory path

No output

Example:

Create Picz photos for alice
  user.file.directory alice Picz

user.git.clone

Clone a git repository as provided user (if the repository already exists locally, pull the last commit) and switch to the requested reference (branch, tag...)

Arguments:

  1. Username
  2. Remote repository URI
  3. Clone target (if path is relative, it is relative to the user's nome directory)
  4. Reference (branch, tag...)

No output

Example:

Oh My Bash
  user.git.clone alice https://github.com/ohmybash/oh-my-bash.git .oh-my-bash master

user.git.config

Set a git configuration parameter for a user

Arguments:

  1. Username
  2. Name (in the form "x.y")
  3. Value

No output

Example:

Git parameter
  user.git.config alice branch.autosetuprebase always

user.gnome.extension.enable

Enable a GNOME Shell extension

Arguments:

  1. Username
  2. UUID of the extension

No output

Example:

Dash to dock
  gnome.extension.install dash-to-dock@micxgx.gmail.com
  user.gnome.extension.enable alice dash-to-dock@micxgx.gmail.com

user.go.env

Set a Go environment variable

Arguments:

  1. Username
  2. Variable name (automatically changed to uppercase)
  3. Value

No output

Example:

Go path
  user.go.env alice gopath /home/alice/GO

user.group

Add the user to the group (if the group does not exist, it is created)

Arguments:

  1. Username
  2. Groupname

No output

Example:

Allow alice to dial with a modem
  user.group alice dialout

user.systemd.enable

Enable and start a systemd user service

Arguments:

  1. Username
  2. Name of the service to enable

No output

Example:

Enable syncthing
  systemd.enable alice syncthing

user.vscode.extension.install

Install a VSCode extension

Arguments:

  1. Username
  2. Extension identifier

No output

Example:

VSCode with go
  snap.install code classic
  user.vscode.extension.install alice golang.go

user.xdg.userdir

Set a XDG user dir

Arguments:

  1. Username
  2. Directory name (one of DESKTOP, DOWNLOAD, TEMPLATES, PUBLICSHARE, DOCUMENTS, MUSIC, PICTURES, VIDEOS, case-insensitive)
  3. Directory path

No output

Example:

Change downloads directory for john
  user.file.directory john Downs
  user.xdg.userdir john DOWNLOAD Downs

xdg.mimedefault

Set the default application for a mimetype

Arguments:

  1. Mimetype
  2. Name of the application

No output

Example:

Use Chromium
  xdg.mimedefault text/html chromium_chromium