krathalan / wtwitch

Terminal user interface for Twitch
GNU General Public License v3.0
68 stars 9 forks source link

[BUG] No output outside a terminal #13

Open Locorock opened 2 years ago

Locorock commented 2 years ago

Describe the bug No output is produced when any command is executed outside a terminal

To Reproduce wtwitch c | rofi -dmenu, executed with an i3 keybind

Expected behavior I expected rofi to show me all the rows of wtwitch c as options, but i got nothing

Logs/system info (please complete the following information):

Additional context Having the command be executed within a terminal solves the issue (but doing so opens a new window)

Locorock commented 2 years ago

ok yeah apparently the script checks terminal width to cut titles and such, so when a terminal isn't actually there nothing works because there is no terminal width. Managed to fix it by just removing title-cutting from the code but there should be a way to have it only affect instances not run in a terminal.

falsified commented 2 years ago

had the same issue when I was calling from dmenu, workaround was to make a script call a terminal, execute, spit output , run another script,

Otherwise, excellent light weight script!

Locorock commented 2 years ago

that's one way of solving it i guess, really convoluted tho

falsified commented 2 years ago

yeah, not too bad, tweaked it to get it working right, so it'll exit out of the terminal called

dmenu -> script1 script:1 call term executing script2 script2: wtwitch c >tmpfile, grep, sed, into dmenu dialog -> select streamer and hit enter -> launches streamlnk with mpv via nohup, so parent terminal doesnt close out new spawn, bonus, set tray icon sleep and script1 exits spawned term

Lemme know if you'd want the code, it would only take a tiny bit of modifications

Locorock commented 2 years ago

yeah, not too bad, tweaked it to get it working right, so it'll exit out of the terminal called

dmenu -> script1 script:1 call term executing script2 script2: wtwitch c >tmpfile, grep, sed, into dmenu dialog -> select streamer and hit enter -> launches streamlnk with mpv via nohup, so parent terminal doesnt close out new spawn, bonus, set tray icon sleep and script1 exits spawned term

Lemme know if you'd want the code, it would only take a tiny bit of modifications

Yeah i already edited the code of wtwitch by simply removing the line that cuts text short. Should probably add a config for that and fork this repo