[GH-ISSUE #408] any type of running a command causes an error #138

Closed
opened 2026-05-22 21:51:23 +01:00 by JakeStanger · 1 comment
Owner

Originally created by @JustSimplyKyle on GitHub (Jan 14, 2024).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/408

Describe the bug
any type of running a command causes an error
such as on_scroll_up

To Reproduce
Steps to reproduce the behavior:
$workspace = {
type = "workspaces"
sort = "alphanumeric"
on_scroll_up = "hyprctl dispatch workspace -1"
on_scroll_down = "hyprctl dispatch workspace +1"
}
the config, scroll and you'll see "there is no reactor running, must be called from the context of a Tokio 1.x runtime"

Expected behavior
To it not to crash

System information:
Arch Linux
Hyprland
ironbar 0.14.0-pre

Configuration

Share your bar configuration and stylesheet as applicable:

Config

let {
    $tray = { type = "tray" }
    $custom_clock = {
        type = "custom"
        class = "time"
        on_mouse_enter = "ironbar set clock_state true"
        on_mouse_exit = "ironbar set clock_state false"
        bar = [
            {
                type = "label"
                label = "{{date '+%H:%M'}}"
            }
            {
                type = "label"
                transition_duration = 400
                label = " {{date '+%b %d, %Y'}}"
                class = "clock_date"
                show_if = "#clock_state"
            }
        ]
    }
   
    $window = {
      type = "focused"
      show_icon = true
      show_title = true
      icon_size = 24
      icon_theme = "Paper"
    }
    $cpu_sys = "{cpu_percent}% "
    
    $memory_sys = "{memory_percent}% "
        
    $network_sys = "{net_down:wlp6s0} Mbps"
    
    $SysInfo = { 
      type = "sys_info"
      class = "ram"
      format = [ $memory_sys ]
      tooltip = "{{~/.config/ironbar/scripts/ram_info}} GiB"
    }

    $internet = {
        type = "custom"
        class = "internet"
        on_mouse_enter = "ironbar set wifi_state true"
        on_mouse_exit = "ironbar set wifi_state false"
        bar = [
            {
                type = "label"
                transition_type = "slide_end"
                transition_duration = 350
                label = "{{~/.config/eww/scripts/wifi --ESSID}} "
                show_if = "#wifi_state"
            }
            {
                type = "label"
                label = "{{~/.config/eww/scripts/wifi --ICON}}"
            }
        ]
    }

    
    $expand_sound = {
        type = "script"
        mode = "poll"
        interval = 100
        cmd = "zsh -c 'if [ '$(ironbar get soundbar_state | tail -1)' = 'true' ]; then; echo '';else;echo '';fi'"
        on_click_left = "zsh -c 'if [ '$(ironbar get soundbar_state | tail -1)' = 'true' ]; then; ironbar set soundbar_state false;else;ironbar set soundbar_state true;fi'"
    }

    $cava = {
        transition_type = "slide_end"
        transition_duration = 750
        name = "cava"
        type = "script"
        mode = "watch"
        cmd = "/home/kyle/.config/eww/scripts/cava"
        show_if = "#soundbar_state"
   }

    $volume = {
        transition_type = "slide_end"
        transition_duration = 350
        type = "custom"
        bar = [ 
            {
                type = "slider"
                class = "scale"
                length = 100
                max = 100
                on_change = "!wpctl set-volume @DEFAULT_SINK@ $0%"
                on_scroll_down = "wpctl set-volume @DEFAULT_SINK@ 2%-"
                on_scroll_up = "wpctl set-volume @DEFAULT_SINK@ 2%+"
                on_click_right = "pavucontrol"
                value = "100:/home/kyle/.config/ironbar/scripts/volume"
                show_if = "#soundbar_state"
                tooltip = "{{/home/kyle/.config/ironbar/scripts/volume}}%"
            }
        ]
    }

    $workspace = {
        type = "workspaces"
        sort = "alphanumeric"
        on_scroll_up = "hyprctl dispatch workspace -1"
        on_scroll_down = "hyprctl dispatch workspace +1"
    }

    
    $start = [ $workspace ]
    $center = [ $window ]
    $end = [ $cava $volume $expand_sound $internet $SysInfo $custom_clock $tray ]
}
in {
        position = "top"
        start = $start
        center = $center
        end = $end
}
Styles
.container {
  font-family: cjkFonts;
  font-weight: bold;
  font-size: 23px;
}

#cava {
  font-family: renogare;
}

.time {
  font-size: 23px;
  font-weight: normal;
  padding: 0px 10px 0px 10px;
  background: linear-gradient(45deg, rgb(254, 240, 224) 0%, rgb(244, 169, 158) 50%, rgb(238, 214, 215) 100%);
  background-size: 300% 300%;
  animation: gradient 5s ease infinite;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377);
  box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
  border-radius: 16px;
  margin: 10px 10px 10px 10px;
  font-family: Renogare;
}

.clock_date {
  font-family: Renogare;
  font-weight: normal;
  font-size: 18;
  color: rgb(49, 50, 68);
}


.background {
  background-color: rgba(0, 0, 0, 0)
}

.popup-clock {
  font-weight: bolder;
  background: rgb(36, 39, 58);
}

.popup-pwr {
  background: rgb(234, 153, 156);
  color: rgb(48, 52, 70);
  background: rgb(238, 190, 190);
  background: linear-gradient(45deg, rgb(129, 200, 190) 0%, rgb(244, 184, 228) 43%, rgb(153, 209, 219) 80%, rgb(202, 158, 230) 100%);
  background-size: 300% 300%;
  animation: gradient 10s ease infinite;
  border: none;
}

#power-btn {
  padding: 0px 20px 0px 20px;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-right: 15px;
  margin-left: 0px;
  border-radius: 15px;
  background: rgb(238, 190, 190);
  background: linear-gradient(45deg, rgb(129, 200, 190) 0%, rgb(244, 184, 228) 43%, rgb(153, 209, 219) 80%, rgb(202, 158, 230) 100%);
  background-size: 300% 300%;
  animation: gradient 10s ease infinite;
  border: none;
  font-weight: bolder;
  box-shadow: rgba(0, 0, 0, 0.25) 2px 2px 5px 2px;
}

#shutdown {
  background: rgb(238, 190, 190);
}

#reboot {
  background: rgb(140, 170, 238);
}

#hibernation {
  box-shadow: rgba(0, 0, 0, 0.35) 2px 2px 5px 2px;
  background: rgb(153, 209, 219);
}

/* base */
.sysinfo .item,
.script,
.tray {
  padding: 0px 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-right: 10px;
  border-radius: 15px;
  background: #cdd6f4;
  color: #516079;
  box-shadow: rgba(0, 0, 0, 0.116) 2px 2px 5px 2px;
}

.scale,
.internet,
.script {
  transition: all 0.5s cubic-bezier(0.5, 1, 0.89, 1);
  margin-top: 10px;
  margin-bottom: 10px;
  margin-right: 10px;
  padding-right: 20px;
  padding-left: 20px;
  padding-bottom: 3px;
  box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377);
  border-radius: 15px;
  background: rgb(202, 158, 230);
  background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%);
  background-size: 300% 300%;
  animation: gradient 5s ease infinite;
  color: #fff;
}


scale trough {
  border-radius: 16px;
  background-color: #E7D4CB;
  box-shadow: 0 2px 3px 2px rgba(00, 00, 00, 0.4);
  min-height: 10px;
  min-width: 70px;
  margin: 0px 5px 10px 10px;
}

scale value {
  color: #77a5bf;
  font-size: 0px;
}

scale trough highlight {
  background-image: linear-gradient(to right, #afcee0 30%, #92B6F4 50%, #77a5bf 100%);
  border-radius: 10px;
  background-color: #afcee0;
}

.focused {
  color: rgb(84, 111, 175);
  font-size: 20px;
  padding: 0px 10px 0px 10px;
  margin: 10px 10px 10px 0px;
  background: rgb(238, 190, 190);
  background: linear-gradient(45deg, rgb(244, 219, 214) 0%, rgb(223, 221, 238) 43%, rgb(245, 208, 225) 100%);
  background-size: 300% 300%;
  animation: gradient 5s ease infinite;
  border-radius: 16px;
}


/* cpu */
.sysinfo .item:nth-child(1) {
  background: rgb(180, 190, 254);
  background: linear-gradient(52deg, rgba(180, 190, 254, 1) 0%, rgba(137, 220, 235, 1) 32%, rgba(137, 180, 250, 1) 72%, rgba(166, 227, 161, 1) 100%);
  background-size: 300% 300%;
  animation: gradient 20s ease infinite;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377);
  /* background-color: #b4befe; */
  color: #fff;
}

.clock {
  margin-top: 10px;
  margin-bottom: 10px;
  margin-right: 10px;
  padding-right: 20px;
  padding-left: 20px;
  padding-bottom: 3px;
  box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px;
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377);
  border: none;
  border-radius: 15px;
  font-size: 24px;
  background: rgb(202, 158, 230);
  background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%);
  background-size: 300% 300%;
  animation: gradient 10s ease infinite;
  color: #fff;
}

.tray {
  color: rgb(84, 111, 175);
  font-size: 15px;
  padding: 0px 10px 0px 10px;
  margin: 10px 10px 10px 0px;
  background: rgb(238, 190, 190);
  background: linear-gradient(45deg, rgb(244, 219, 214) 0%, rgb(223, 221, 238) 43%, rgb(245, 208, 225) 100%);
  background-size: 300% 300%;
  animation: gradient 5s ease infinite;
  border-radius: 16px;
}

.tray>.passive {
  -gtk-icon-effect: dim;
}

.tray>.needs-attention {
  -gtk-icon-effect: highlight;
  background-color: #eb4d4b;
}

.workspaces {
  font-family: Renogare;
  font-weight: normal;
  font-size: 25px;
  font-weight: normal;
  margin: 10px 0px 0px 20px;
  border-radius: 16px;
}

.workspaces .item {
  box-shadow: rgba(0, 0, 0, 0.116) 2 2 5 2px;
  border: unset;
  background: #fff;
  border-radius: 15px;
  margin: 10px 10px 15px 0px;
  padding: 5px 20px 5px 20px;
  color: #cba6f7;
}

.workspaces .item.focused {
  border: unset;
  font-size: 25px;
  transition: all 0.5s cubic-bezier(0.5, 1, 0.89, 1);
  box-shadow: rgba(0, 0, 0, 0.288) 2 2 5 2px;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.377);
  padding: 5px 10px 5px 10px;
  border-radius: 16px;
  margin: 10px 10px 15px 0px;
  background: rgb(202, 158, 230);
  background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%);
  background-size: 300% 300%;
  animation: gradient 10s ease infinite;
  color: #fff;
}


@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}


tooltip.background {
  background-color: rgba(00, 00, 00, 0.5);
  font-size: 18;
  border-radius: 10px;
  color: #FDFDFD;
}

tooltip * {
  padding: 4px;
  background-color: transparent;
  color: white;
}

.host tooltip {
  background-color: rgba(255, 00, 00, 0.5);
}
Originally created by @JustSimplyKyle on GitHub (Jan 14, 2024). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/408 **Describe the bug** any type of running a command causes an error such as `on_scroll_up` **To Reproduce** Steps to reproduce the behavior: $workspace = { type = "workspaces" sort = "alphanumeric" on_scroll_up = "hyprctl dispatch workspace -1" on_scroll_down = "hyprctl dispatch workspace +1" } the config, scroll and you'll see "there is no reactor running, must be called from the context of a Tokio 1.x runtime" **Expected behavior** To it not to crash **System information:** Arch Linux Hyprland ironbar 0.14.0-pre **Configuration** > Share your bar configuration and stylesheet as applicable: <details><summary>Config</summary> ``` let { $tray = { type = "tray" } $custom_clock = { type = "custom" class = "time" on_mouse_enter = "ironbar set clock_state true" on_mouse_exit = "ironbar set clock_state false" bar = [ { type = "label" label = "{{date '+%H:%M'}}" } { type = "label" transition_duration = 400 label = " {{date '+%b %d, %Y'}}" class = "clock_date" show_if = "#clock_state" } ] } $window = { type = "focused" show_icon = true show_title = true icon_size = 24 icon_theme = "Paper" } $cpu_sys = "{cpu_percent}% " $memory_sys = "{memory_percent}% " $network_sys = "{net_down:wlp6s0} Mbps" $SysInfo = { type = "sys_info" class = "ram" format = [ $memory_sys ] tooltip = "{{~/.config/ironbar/scripts/ram_info}} GiB" } $internet = { type = "custom" class = "internet" on_mouse_enter = "ironbar set wifi_state true" on_mouse_exit = "ironbar set wifi_state false" bar = [ { type = "label" transition_type = "slide_end" transition_duration = 350 label = "{{~/.config/eww/scripts/wifi --ESSID}} " show_if = "#wifi_state" } { type = "label" label = "{{~/.config/eww/scripts/wifi --ICON}}" } ] } $expand_sound = { type = "script" mode = "poll" interval = 100 cmd = "zsh -c 'if [ '$(ironbar get soundbar_state | tail -1)' = 'true' ]; then; echo '';else;echo '';fi'" on_click_left = "zsh -c 'if [ '$(ironbar get soundbar_state | tail -1)' = 'true' ]; then; ironbar set soundbar_state false;else;ironbar set soundbar_state true;fi'" } $cava = { transition_type = "slide_end" transition_duration = 750 name = "cava" type = "script" mode = "watch" cmd = "/home/kyle/.config/eww/scripts/cava" show_if = "#soundbar_state" } $volume = { transition_type = "slide_end" transition_duration = 350 type = "custom" bar = [ { type = "slider" class = "scale" length = 100 max = 100 on_change = "!wpctl set-volume @DEFAULT_SINK@ $0%" on_scroll_down = "wpctl set-volume @DEFAULT_SINK@ 2%-" on_scroll_up = "wpctl set-volume @DEFAULT_SINK@ 2%+" on_click_right = "pavucontrol" value = "100:/home/kyle/.config/ironbar/scripts/volume" show_if = "#soundbar_state" tooltip = "{{/home/kyle/.config/ironbar/scripts/volume}}%" } ] } $workspace = { type = "workspaces" sort = "alphanumeric" on_scroll_up = "hyprctl dispatch workspace -1" on_scroll_down = "hyprctl dispatch workspace +1" } $start = [ $workspace ] $center = [ $window ] $end = [ $cava $volume $expand_sound $internet $SysInfo $custom_clock $tray ] } in { position = "top" start = $start center = $center end = $end } ``` </details> <details><summary>Styles</summary> ```css .container { font-family: cjkFonts; font-weight: bold; font-size: 23px; } #cava { font-family: renogare; } .time { font-size: 23px; font-weight: normal; padding: 0px 10px 0px 10px; background: linear-gradient(45deg, rgb(254, 240, 224) 0%, rgb(244, 169, 158) 50%, rgb(238, 214, 215) 100%); background-size: 300% 300%; animation: gradient 5s ease infinite; text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px; border-radius: 16px; margin: 10px 10px 10px 10px; font-family: Renogare; } .clock_date { font-family: Renogare; font-weight: normal; font-size: 18; color: rgb(49, 50, 68); } .background { background-color: rgba(0, 0, 0, 0) } .popup-clock { font-weight: bolder; background: rgb(36, 39, 58); } .popup-pwr { background: rgb(234, 153, 156); color: rgb(48, 52, 70); background: rgb(238, 190, 190); background: linear-gradient(45deg, rgb(129, 200, 190) 0%, rgb(244, 184, 228) 43%, rgb(153, 209, 219) 80%, rgb(202, 158, 230) 100%); background-size: 300% 300%; animation: gradient 10s ease infinite; border: none; } #power-btn { padding: 0px 20px 0px 20px; margin-top: 10px; margin-bottom: 10px; margin-right: 15px; margin-left: 0px; border-radius: 15px; background: rgb(238, 190, 190); background: linear-gradient(45deg, rgb(129, 200, 190) 0%, rgb(244, 184, 228) 43%, rgb(153, 209, 219) 80%, rgb(202, 158, 230) 100%); background-size: 300% 300%; animation: gradient 10s ease infinite; border: none; font-weight: bolder; box-shadow: rgba(0, 0, 0, 0.25) 2px 2px 5px 2px; } #shutdown { background: rgb(238, 190, 190); } #reboot { background: rgb(140, 170, 238); } #hibernation { box-shadow: rgba(0, 0, 0, 0.35) 2px 2px 5px 2px; background: rgb(153, 209, 219); } /* base */ .sysinfo .item, .script, .tray { padding: 0px 10px; margin-top: 10px; margin-bottom: 10px; margin-right: 10px; border-radius: 15px; background: #cdd6f4; color: #516079; box-shadow: rgba(0, 0, 0, 0.116) 2px 2px 5px 2px; } .scale, .internet, .script { transition: all 0.5s cubic-bezier(0.5, 1, 0.89, 1); margin-top: 10px; margin-bottom: 10px; margin-right: 10px; padding-right: 20px; padding-left: 20px; padding-bottom: 3px; box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px; text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); border-radius: 15px; background: rgb(202, 158, 230); background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%); background-size: 300% 300%; animation: gradient 5s ease infinite; color: #fff; } scale trough { border-radius: 16px; background-color: #E7D4CB; box-shadow: 0 2px 3px 2px rgba(00, 00, 00, 0.4); min-height: 10px; min-width: 70px; margin: 0px 5px 10px 10px; } scale value { color: #77a5bf; font-size: 0px; } scale trough highlight { background-image: linear-gradient(to right, #afcee0 30%, #92B6F4 50%, #77a5bf 100%); border-radius: 10px; background-color: #afcee0; } .focused { color: rgb(84, 111, 175); font-size: 20px; padding: 0px 10px 0px 10px; margin: 10px 10px 10px 0px; background: rgb(238, 190, 190); background: linear-gradient(45deg, rgb(244, 219, 214) 0%, rgb(223, 221, 238) 43%, rgb(245, 208, 225) 100%); background-size: 300% 300%; animation: gradient 5s ease infinite; border-radius: 16px; } /* cpu */ .sysinfo .item:nth-child(1) { background: rgb(180, 190, 254); background: linear-gradient(52deg, rgba(180, 190, 254, 1) 0%, rgba(137, 220, 235, 1) 32%, rgba(137, 180, 250, 1) 72%, rgba(166, 227, 161, 1) 100%); background-size: 300% 300%; animation: gradient 20s ease infinite; text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); /* background-color: #b4befe; */ color: #fff; } .clock { margin-top: 10px; margin-bottom: 10px; margin-right: 10px; padding-right: 20px; padding-left: 20px; padding-bottom: 3px; box-shadow: rgba(0, 0, 0, 0.288) 2px 2px 5px 2px; text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.377); border: none; border-radius: 15px; font-size: 24px; background: rgb(202, 158, 230); background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%); background-size: 300% 300%; animation: gradient 10s ease infinite; color: #fff; } .tray { color: rgb(84, 111, 175); font-size: 15px; padding: 0px 10px 0px 10px; margin: 10px 10px 10px 0px; background: rgb(238, 190, 190); background: linear-gradient(45deg, rgb(244, 219, 214) 0%, rgb(223, 221, 238) 43%, rgb(245, 208, 225) 100%); background-size: 300% 300%; animation: gradient 5s ease infinite; border-radius: 16px; } .tray>.passive { -gtk-icon-effect: dim; } .tray>.needs-attention { -gtk-icon-effect: highlight; background-color: #eb4d4b; } .workspaces { font-family: Renogare; font-weight: normal; font-size: 25px; font-weight: normal; margin: 10px 0px 0px 20px; border-radius: 16px; } .workspaces .item { box-shadow: rgba(0, 0, 0, 0.116) 2 2 5 2px; border: unset; background: #fff; border-radius: 15px; margin: 10px 10px 15px 0px; padding: 5px 20px 5px 20px; color: #cba6f7; } .workspaces .item.focused { border: unset; font-size: 25px; transition: all 0.5s cubic-bezier(0.5, 1, 0.89, 1); box-shadow: rgba(0, 0, 0, 0.288) 2 2 5 2px; text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); padding: 5px 10px 5px 10px; border-radius: 16px; margin: 10px 10px 15px 0px; background: rgb(202, 158, 230); background: linear-gradient(45deg, rgba(202, 158, 230, 1) 0%, rgba(245, 194, 231, 1) 43%, rgba(180, 190, 254, 1) 80%, rgba(137, 180, 250, 1) 100%); background-size: 300% 300%; animation: gradient 10s ease infinite; color: #fff; } @keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } tooltip.background { background-color: rgba(00, 00, 00, 0.5); font-size: 18; border-radius: 10px; color: #FDFDFD; } tooltip * { padding: 4px; background-color: transparent; color: white; } .host tooltip { background-color: rgba(255, 00, 00, 0.5); } ``` </details>
JakeStanger 2026-05-22 21:51:23 +01:00
  • closed this issue
  • added the
    T:Bug
    label
Author
Owner

@JakeStanger commented on GitHub (Jan 14, 2024):

Looks like one spawn import snuck through when I did the GTK refactor

<!-- gh-comment-id:1890986971 --> @JakeStanger commented on GitHub (Jan 14, 2024): Looks like one `spawn` import snuck through when I did the GTK refactor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#138
No description provided.