Package Details: goober 0.1.2-3

Git Clone URL: https://aur.archlinux.org/goober.git (read-only, click to copy)
Package Base: goober
Description: Workspace module generator for eww.
Upstream URL: https://bitbucket.org/troutcobbler/goober
Licenses: MIT
Submitter: cog
Maintainer: cog
Last Packager: cog
Votes: 0
Popularity: 0.000000
First Submitted: 2023-05-02 06:39 (UTC)
Last Updated: 2023-05-11 21:23 (UTC)

Dependencies (3)

Required by (0)

Sources (1)

Latest Comments

1 2 Next › Last »

cog commented on 2023-07-16 05:08 (UTC)

@eclairevoyant cool. Hit me up on the https://aur.archlinux.org/packages/eww comments if you’re interested.

eclairevoyant commented on 2023-07-16 05:03 (UTC)

Nix on Arch. I'll probably not switch to NixOS on my primary machine for a while due to some dealbreakers, and Arch is serving me fine atm.

cog commented on 2023-07-16 05:00 (UTC)

@eclairevoyant thanks for the feedback. I’ll need to get back into the source code on goober next week as I’ve been playing with hyprland on my hatchery Linux distro. Will take a look at it. BTW, have you gone fully to nixos or just nixpkgs? If you’re still maintaining your arch eww packages I’m willing to transfer maintainership of the “eww” AUR package to you if you’re interested. :)

eclairevoyant commented on 2023-07-16 04:39 (UTC) (edited on 2023-07-16 04:41 (UTC) by eclairevoyant)

Looks like I have to set Workspaces to 5 or lower to prevent the error when using your config, which results in the following output:

(box :orientation "v" :class "workspaces" :space-evenly true :halign "center" :valign "center" :vexpand true  (button :class "empty" :onclick "swaymsg workspace 1" "1") (button :class "empty" :onclick "swaymsg workspace 3" "3") (button :class "empty" :onclick "swaymsg workspace 5" "5") (button :class "empty" :onclick "swaymsg workspace 7" "7") (button :class "empty" :onclick "swaymsg workspace 9" "9"))

Guessing there's some double-incrementing happening in some loop in the code, or maybe some issue parsing the conf, since it's skipping every other workspace.

eclairevoyant commented on 2023-07-16 04:19 (UTC) (edited on 2023-07-16 04:19 (UTC) by eclairevoyant)

I ended up switching to using nix to manage my config, since I use it already for other purposes, and it's a full-on programming language. But either way, with the conf you provided, it continues to fail with the same error as mentioned before.

panic: runtime error: index out of range [10] with length 10

goroutine 1 [running]:
goober/src.Readline()
    goober/src/shared.go:66 +0xb85
goober/src.Swaysub()
    goober/src/sway.go:73 +0x33
main.main()
    goober/main.go:39 +0x28d

I'd suggest removing the Workspaces setting from the config entirely and just checking the length of the Icons array, assuming it's present.

cog commented on 2023-05-11 05:46 (UTC) (edited on 2023-05-11 21:39 (UTC) by cog)

@eclairevoyant I removed the -t flags from lines 23 and 24, good catch.

As far as your error about index out of range is concerened:

It appears to happen when you have a mismatch of number of workspaces and icons. I was only able to reproduce it when setting workspaces to 10 and having 9 icons or 11 and having 10 icons.

The Workspaces number in the config only pertains to sway and i3 as they don't really have a particular number of workspaces like other window managers. A workspace doesn't really exist unless it is focused or occupied.

Please try the following config as a test and let me know if it's still acting weird for you.

{

"Icons": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],

"Workspaces": 10,

"HideUnoccupied": false

}

eclairevoyant commented on 2023-05-11 05:29 (UTC)

Thanks for looking into this. Few points:

  • If you use -t, that refers to the target directory, so you'll want to fix lines 23 and 24 to just be the directory names. As is, it installs to /usr/bin/goober/goober instead of /usr/bin/goober, same issue with the license

  • I don't program in go, so I don't know the difference between go vs cgo, but I'm not sure I buy the argument that LDFLAGS "do not work" here. namcap currently complains about lacking full RELRO; with the flags from the wiki it does not (you can see the default LDFLAGS specified in makepkg.conf). readelf -d (or checksec if you prefer) will confirm the same.

  • Re: the two points above, I would always run namcap on the output package before uploading, helps catch any issues; namcap can also be run on PKGBUILDs as well.

  • I heard (maybe incorrectly) that true static binaries are impossible on Linux with Go, and we always need libc, hence I had added that dep as well... but I guess ldd seems to disagree with me :)

  • Running goober -wm sway after populating ~/.config/goober/goober.conf always crashes immediately with

    panic: runtime error: index out of range [10] with length 10

    (I have 10 workspaces so I put 10 icons, but the number in the error changes accordingly depending on the number of entries in Icons, and Workspaces seems to be ignored here.)

Anyway I was curious about this project, since I was surprised to see a package depending on eww (I maintain eww-git), and I haven't bothered to put together a workspace config for eww yet so figured I would check this out. I'm interested to see how this turns out in the future.

cog commented on 2023-05-11 02:26 (UTC)

@eclairevoyant Thanks for the input. Honestly I only had made this package as a favor for a friend to use it on arch as I use it on my distro hatcherylinux. Happy to see some other interest in it! You helped to remind me to clean up the PKGBUILD as I had authored it kind of hastily. I added a .install file to help you get started using goober. I wrote goober in pure go and it doesn't utilize cgo at all, so your LDFLAGS do not work and glibc is not required. Check the git repo as I'll add more help and info on it as goober matures and gains new features. Cheers.

eclairevoyant commented on 2023-05-10 19:56 (UTC)

Also updated it per https://wiki.archlinux.org/title/Go_package_guidelines, second patch is added to the gist below.