Pass terminal value to autostart.sh

67 views
Skip to first unread message

Eduardo Queiroz

unread,
Aug 16, 2022, 7:56:52 AM8/16/22
to qtile-dev
Hi guys,

I would like to know if it is possible to pass a variable value from the qtile config file to autostart.sh. The main thing is I use kitty in one system and alacritty and another system and if could pass the value of terminal=guess_terminal() to the bash script it would simplify things to share configs between the machines.

Thanks,

Eduardo 

Popescu Ervin

unread,
Aug 16, 2022, 8:19:24 AM8/16/22
to qtile-dev
I use the `qtile.test_data` variable which allows for anything(lists,dicts etc). You could do `qtile.test_data=terminal` and in autostart.sh do `qtile cmd-obj -o cmd -f eval -a "self.test_data" ` and extract the second value from the tuple which is returned `(True/False, your_terminal)` , however you'd want to do that.

Justine Smithies

unread,
Aug 16, 2022, 10:20:01 AM8/16/22
to qtil...@googlegroups.com
Would doing the following in you config.py not work ?

Export value for shell with 
d["GUESSED_TERMINAL"] = terminal

Then in your autostart script read $GUESSED_TERMINAL 



--
You received this message because you are subscribed to the Google Groups "qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qtile-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qtile-dev/f296c93b-8a6a-424b-b124-f00d2f011822n%40googlegroups.com.

Eduardo Queiroz

unread,
Aug 16, 2022, 9:51:13 PM8/16/22
to qtile-dev
I tried Justine's solution and ended up with a broken setup (default qtile was loaded). The solution that worked for me was:
config.py
import os
terminal = guess_terminal()
os.environ["shell_var"] = terminal

and then in the autostart.sh
$shell_var &

Sebastian Heiden

unread,
Aug 27, 2022, 7:23:55 AM8/27/22
to qtile-dev
Is there a script/tool to set/change default themes/rices for the
bar/windows in qtile?

So far I have hard coded the colors.

Eduardo Queiroz

unread,
Aug 28, 2022, 2:09:42 AM8/28/22
to qtile-dev
So I wouldn't call a script but to make it easier to change the themes a created a file called cSchemes.py in the same folder of config.py.
The colorschemes need to be 2D arrays. Then I imported cSchemes.py into config.py and made a variable that would get the colorscheme.
Anywhere when i needed a color I called this variable with the array position I wanted.

Hope that helps

Jacob Hilker

unread,
Aug 28, 2022, 11:20:28 AM8/28/22
to qtil...@googlegroups.com
I'm currently using Nix-colors for maintaining my colorscheme and home-manager for managing my config files, and so I currently have this file for setting up my color-scheme and wallpaper.

--
You received this message because you are subscribed to the Google Groups "qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qtile-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages