Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle env var globbing/splitting #33

Closed
kojq opened this issue Mar 20, 2024 · 8 comments
Closed

handle env var globbing/splitting #33

kojq opened this issue Mar 20, 2024 · 8 comments

Comments

@kojq
Copy link

kojq commented Mar 20, 2024

From hyprwm/Hyprland/issues/5172, we should handle env var globbing/splitting.

@kojq
Copy link
Author

kojq commented Mar 20, 2024

Description:

We will use the bind = WIN, N, togglespecialworkspace, hi throughout this.

input:

workspace = special:hi, on-created-empty:foot -H echo $HOSTNAME $TERM

output:

arch linux

input:

workspace = special:hi, on-created-empty:foot -H echo $TERM$HOSTNAME

output:

linuxarch

input:

workspace = special:hi, on-created-empty:foot -H echo $TERMINAL

output:

linuxINAL

input:

workspace = special:hi, on-created-empty:foot -H echo $HOSTNAME$TERM

output:


Now, with definitions in config.

input:

$HI=hello
workspace = special:hi, on-created-empty:foot -H echo $HI

output:

hello

input:

$TERMINAL=foot
workspace = special:hi, on-created-empty:foot -H echo $TERMINAL

output:

foot
  1. The problem are we facing in Nested/recursive variable expansion broke somewhere after v0.35.0 Hyprland#5172 is when we set a var to something that is or contains another hyprlang var, we now interpret global var (with globbing/splitting) having priority over a hyprlang var.

  2. Feature request: include variable expansion in source command. #32 wants to pass this info into the source keyword without defining (error occurs)

# this is a comment: $HOSTNAME=laptop
source=~/.config/hypr/$HOSTNAME.conf

@vaxerski
Copy link
Member

odd, these seem to work on my end.

image

image

@vaxerski
Copy link
Member

workspace = special:hi, on-created-empty:foot -H echo $TERMINAL

if $TERM is defined, but $TERMINAL isn't, the output of linuxINAL is expected, documented and just how it always has been

@kojq
Copy link
Author

kojq commented Mar 20, 2024

When defined, yeah. The issue is it is no longer considered defined when doing recursive vars.

@vaxerski
Copy link
Member

please give a minimal reproducible example.

@kojq
Copy link
Author

kojq commented Mar 20, 2024

from hyprwm/Hyprland/issues/5172:

$TERMINAL = alacritty
$comms = [workspace special:hyprake] $TERMINAL --class hyprake
workspace = special:hyprake, on-created-empty:$comms

@kojq
Copy link
Author

kojq commented Mar 20, 2024

bind = WIN, N, togglespecialworkspace, hyprake

result is no terminal

@kojq
Copy link
Author

kojq commented Mar 20, 2024

This should help you see what is happening (linuxINAL):

$TERMINAL = foot
$comms = $TERMINAL
workspace = special:hyprake, on-created-empty:foot -H echo $comms
bind = WIN, N, togglespecialworkspace, hyprake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants