I found this guys talking about using functions  
https://groups.google.com/g/qtile-dev/c/0qxpUWjx62U 
But I think i need some documentation to use that anyway 

idk i can figure something like this:
@lazy.fun1
def _bash(arg):
    return Popen(
        arg,
        shell=True,
        stdout=PIPE
    ).communicate()[0].decode('utf-8').strip()


def bash_script(path):
    return _bash(os.path.expanduser(path))


def bash_command(command):
    return _bash(command)

keys = [
    Key(["mod1","shift"], "x", 
lazy.fun1.bash_script(~/.config/qtile/script1.py)),
....

On Sunday, August 23, 2020 at 6:37:05 PM UTC+2 [email protected] wrote:

> U can actually. I wrote a helper function to run string commands hope it 
> helps.
>
> ```
> import os
>
> def _bash(arg):
>     return Popen(
>         arg,
>         shell=True,
>         stdout=PIPE
>     ).communicate()[0].decode('utf-8').strip()
>
>
> def bash_script(path):
>     return _bash(os.path.expanduser(path))
>
>
> def bash_command(command):
>     return _bash(command)
>
> ```
>
> On Monday, 24 August 2020 at 00:30:36 UTC+8 [email protected] wrote:
>
>> I had tried with Dmenu(dmenu_command="#thing_to_do"), i can open 
>> aplications but i cant run string commands on it, maybe can i create 
>> scripts and run it with a Key?
>>
>> On Sunday, August 23, 2020 at 5:52:47 AM UTC+2 [email protected] wrote:
>>
>>> There is a built-in extension for dmenu in qtile. Check out the 
>>> extension section in the docs.
>>>
>>> On Sunday, August 23, 2020 at 9:40:50 AM UTC+8 [email protected] wrote:
>>>
>>>> I want to to set a key to run terminal“s command (setsetxkbmap 
>>>> #keyboardlayout), i thought using dmenu but not sure how can i do it 
>>>> correctly.
>>>>
>>>> Key(["mod1", "shift"], "x", lazy.spawn("dmenu_run -p 'Run:'  
>>>> dmenu_prompt "setxkbmap latam""),       
>>>>     desc='Dmenu Run Launcher'),
>>>>
>>>> An more directly way would be great
>>>>
>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qtile-dev/c51adb1b-311e-4587-a614-652f9446b600n%40googlegroups.com.

Reply via email to