gnunn1 / tilix

A tiling terminal emulator for Linux using GTK+ 3
https://gnunn1.github.io/tilix-web
Mozilla Public License 2.0
5.36k stars 293 forks source link

Is there a way to edit the default profile inside dconf without knowing its ID? #2168

Open lowgos opened 1 year ago

lowgos commented 1 year ago

Hey ! This is more of a question but I saw in a previous issue of this project that editing the profiles/default key should work but I guess that nowadays the default profile uses a random ID.

I'm currently using nixOS and I try to declaratively configure Tilix to use a custom font by using dconf but because it's declarative nothing is initiated yet and I cannot read/dump the Tilix configuration beforehand. Which means I cannot fetch the default profile ID.

I would like to access the profile keys without knowing the ID beforehand. Is it possible?

237dmitry commented 1 year ago

I think the default profile is the first one in the list of profiles (not sure). Get a profile not by id, but by name:

#!/bin/bash

for i in $(dconf list /com/gexperts/Tilix/profiles/ | grep -v 'list'); do

    name=$(dconf read /com/gexperts/Tilix/profiles/${i}visible-name)

    if [ "$name" == "'bash'" ]; then

        # List parameters of profile with name 'bash'

        dconf list /com/gexperts/Tilix/profiles/${i}

        # Read parameter, font for example:

        dconf read /com/gexperts/Tilix/profiles/${i}font
    fi

done
chrisadamsonmcri commented 10 months ago

I want to be able to do this too in order to set login-shell=true as a default value for any profile for all users. Is there a way to do this?