Code Monkey home page Code Monkey logo

nwg-launchers's Introduction

Hi, I’m Piotr - a middle-aged clerk and after-hours FOSS developer. I’m interested in Linux, Wayland & GTK.

  • I use sway and Hyprland on Arch Linux;
  • I have been working on the GTK shell for sway and Hyprland called nwg-shell;
  • I prefer python to shell scripting and golang to C.

How to reach me:

  • Join the nwg-shell Discussions, or
  • submit an issue on GitHub on the appropriate project page, or
  • find me in the nwg-shell Matrix space, or
  • drop me a line by email.

Do not invite me to a live chat, unless you have diction like sir John Vincent Hurt. I'm quite useless at listening to English.

If you'd like to buy me a coffee, you may use GitHub Sponsors (link in the left column) or Liberapay:

Donate using Liberapay

nwg-launchers's People

Contributors

alebastr avatar ericonr avatar evo221 avatar jbeich avatar jovanlanik avatar markusvolk avatar musikid avatar nwg-piotr avatar santouits avatar scotabroad avatar siborgium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nwg-launchers's Issues

grid: crash when LANG is unset

$ locale
LANG=
LC_CTYPE=en_US.UTF-8
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

$ nwggrid
WM: sway
Process 43828 stopped
* thread #1, name = 'nwggrid', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x00000008017ff58f libc.so.7`strlen(str=0x0000000000000000) at strlen.c:101:8
   98            * boundaries is integral multiple of word size.
   99            */
   100          lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK);
-> 101          va = (*lp - mask01);
   102          vb = ((~*lp) & mask80);
   103          lp++;
   104          if (va & vb)
(lldb) bt
* thread #1, name = 'nwggrid', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x00000008017ff58f libc.so.7`strlen(str=0x0000000000000000) at strlen.c:101:8
    frame #1: 0x000000000023f345 nwggrid`std::__1::char_traits<char>::length(__s=0x0000000000000000) at __string:253:53
    frame #2: 0x0000000000239fe9 nwggrid`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(this="\x13!\0\0\0\0\0\0\0\0\0\0\0\0\0\x7f\0\0\x7f\0\0\x7f\0\0\0\0\0\0\0\0\0\0!\0\0\0\0\0\x80\x7f\0\0\x80\x7f\0\0Y#\0\0\0\0\0\b\0+\0\b\0\0\0\b\x04+\0\b\0\0\0\b\b+\0\b\0\0\0\b\f+\0\b\0\0\0\b +", __s=0x0000000000000000) at string:819:19
    frame #3: 0x0000000000262e24 nwggrid`get_locale() at nwg_tools.cc:84:21
    frame #4: 0x00000000002359d8 nwggrid`main(argc=1, argv=0x00007fffffffe0e0) at grid.cc:200:16
    frame #5: 0x000000000023419f nwggrid`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:75:7

[feature request][dmenu] read list from stdin

This has now a very nice shape (much more responsive than the older python based ones).

Since you provide a command which emulate the old dmenu-run functionality, it would be very cool to see the normal behaviour of dmenu: provide a gui to select an item from a list.
This can help people to substitute rofi and wofi to build their scripts. (the latter is wayland prepared but has a very poor efficiency running at 100% CPU for few seconds for long lists).

In particular dmenu (and rofi and wofi) read a list from stdin, a different approach would be to read a json file from stdin such as the configuration file of nwgbar.

Add more functionality to dmenu

nwgdmenu could:

  • have a working graphical erase button, the current one doesn't seem to do anything
  • launch the first application in the list if you press return inside the search box
  • have an option for displaying desktop applications (only the titles)
  • have an option for case insensitive search
  • be capable of performing fuzzy matching

What do you think of these ideas?

grid: crash when LANG is unset (again, v0.3.3)

Regressed by #83. See #70 for previous discussion.

$ locale
LANG=
LC_CTYPE=en_US.UTF-8
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

$ nwggrid
WM: sway
Process 33697 stopped
* thread #1, name = 'nwggrid', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x000000080160d32f libc.so.7`strlen(str=0x0000000000000000) at strlen.c:101:8
   98            * boundaries is integral multiple of word size.
   99            */
   100          lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK);
-> 101          va = (*lp - mask01);
   102          vb = ((~*lp) & mask80);
   103          lp++;
   104          if (va & vb)
(lldb) bt
* thread #1, name = 'nwggrid', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x000000080160d32f libc.so.7`strlen(str=0x0000000000000000) at strlen.c:101:8
    frame #1: 0x000000000023fcd5 nwggrid`std::__1::char_traits<char>::length(__s=0x0000000000000000) at __string:370:53
    frame #2: 0x000000000023e454 nwggrid`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(this=Summary Unavailable, __s=0x0000000000000000) at string:818:19
    frame #3: 0x0000000000265173 nwggrid`get_locale() at nwg_tools.cc:175:23
    frame #4: 0x000000000023baea nwggrid`main(argc=1, argv=0x00007fffffffe0f8) at grid.cc:192:16
    frame #5: 0x000000000023a68f nwggrid`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:75:7
(lldb) f 3
frame #3: 0x0000000000265173 nwggrid`get_locale() at nwg_tools.cc:175:23
   172   * Returns current locale
   173   * */
   174  std::string get_locale() {
-> 175      std::string loc = getenv("LANG");
   176      if (!loc.empty()) {
   177          auto idx = loc.find_first_of("_");
   178          if (idx != std::string::npos) {

Zoom icon does not show.

The AUR package zoom-system-qt stores it's icon in /usr/share/pixmaps. Wofi's drunner finds this icon, but nwggrid does not. If it doesn't already, consider also searching in /usr/share/pixmaps?

Pressing enter for the first result in nwgdmenu isn't working with 0.4.3

If I have one or more available results in nwgdmenu, I can't just press enter to select it (it doesn't do anything), I have to press the down arrow key (which doesn't actually move the selection box) and then I can press enter. If I narrow down the search enough so that there is a single result, then pressing enter without any arrows works.

I can try to track this down, just wanted to make it known.

nwggrid: flatpaks are not listed

As the title says. sgtk-grid does list flatpaks, maybe it's something you want to implement.

By the way, very nice suite of apps, I'm really enjoying using them. Keep it up!

Nwggrid doesn't sort .desktop files with names longer than 27 characters

Whenever you create a .desktop file with a name which nwggrid shortens, the sorting gets botched up.

To reproduce this bug, just create a few .desktop files with name fields more than 27 characters long, and add numbers at the end respectively like this:

File 1: "name that is more than 27 chars long 01"
File 2: "name that is more than 27 chars long 02"
File 3: "name that is more than 27 chars long 03"
File 4: "name that is more than 27 chars long 04"
and so on
Normally file 1 should be displayed before file 2, but since the application doesn't seem to parse characters after the 27 char limit, the files aren't in alphanumeric order.

Using nwggrid 0.4.0 latest from aur.

nwggrid shows no result

When I run nwggrid I don't see any apps. Even if I wait. There a 0 count at the bottom.

I wonder if I'm missing an icon theme or something.

nwg-launchers 0.2.0
sway
NixOS unstable

❯ nwggrid
WM: sway
Locale: fr
91 .desktop entries found
/home/bbigras/.config/nwg-launchers/nwggrid/style.css
Focused display: 0, 0, 1600, 900
Time: 104

Fails to build with Clang

Regressed by af54c04 (#83)

../grid/grid_tools.cc:204:22: error: 'dest' in capture list does not name a variable
                    [dest, pos, &view](nop_t) { *dest = view.substr(pos); },
                     ^
../grid/grid_tools.cc:204:28: error: 'pos' in capture list does not name a variable
                    [dest, pos, &view](nop_t) { *dest = view.substr(pos); },
                           ^
../grid/grid_tools.cc:204:50: error: reference to local binding 'dest' declared in enclosing function 'desktop_entry'
                    [dest, pos, &view](nop_t) { *dest = view.substr(pos); },
                                                 ^
../grid/grid_tools.cc:200:29: note: 'dest' declared here
        for (auto& [prefix, dest, tag] : matches) {
                            ^
../grid/grid_tools.cc:204:69: error: reference to local binding 'pos' declared in enclosing function 'desktop_entry'
                    [dest, pos, &view](nop_t) { *dest = view.substr(pos); },
                                                                    ^
../grid/grid_tools.cc:201:23: note: 'pos' declared here
            auto [ok, pos] = try_strip_prefix(prefix);
                      ^
../grid/grid_tools.cc:205:22: error: 'dest' in capture list does not name a variable
                    [dest, pos, &view](cut_t) {
                     ^
../grid/grid_tools.cc:205:28: error: 'pos' in capture list does not name a variable
                    [dest, pos, &view](cut_t) {
                           ^
../grid/grid_tools.cc:206:52: error: reference to local binding 'pos' declared in enclosing function 'desktop_entry'
                        auto idx = view.find(" %", pos);
                                                   ^
../grid/grid_tools.cc:201:23: note: 'pos' declared here
            auto [ok, pos] = try_strip_prefix(prefix);
                      ^
../grid/grid_tools.cc:210:26: error: reference to local binding 'dest' declared in enclosing function 'desktop_entry'
                        *dest = view.substr(pos, idx - pos);
                         ^
../grid/grid_tools.cc:200:29: note: 'dest' declared here
        for (auto& [prefix, dest, tag] : matches) {
                            ^
../grid/grid_tools.cc:210:45: error: reference to local binding 'pos' declared in enclosing function 'desktop_entry'
                        *dest = view.substr(pos, idx - pos);
                                            ^
../grid/grid_tools.cc:201:23: note: 'pos' declared here
            auto [ok, pos] = try_strip_prefix(prefix);
                      ^
../grid/grid_tools.cc:210:56: error: reference to local binding 'pos' declared in enclosing function 'desktop_entry'
                        *dest = view.substr(pos, idx - pos);
                                                       ^
../grid/grid_tools.cc:201:23: note: 'pos' declared here
            auto [ok, pos] = try_strip_prefix(prefix);
                      ^
10 errors generated.

Core dump on fresh install: key 'focused' not found

Compiled latest master via on Fedora 32:

$ meson build -Dbuildtype=release
$ ninja -C build
$ sudo ninja -C build install
$ nwggrid -h
GTK application grid: nwggrid 0.2.0 (c) Piotr Miller 2020 & Contributors

Options:
-h            show this help message and exit
-f            display favourites (most used entries)
-p            display pinned entries
-o <opacity>  background opacity (0.0 - 1.0, default 0.9)
-n <col>      number of grid columns (default: 6)
-s <size>     button image size (default: 72)
-c <name>     css file name (default: style.css)
-l <ln>       force use of <ln> language
-wm <wmname>  window manager name (if can not be detected)

$ nwggrid
WM: sway
Locale: en
604 .desktop entries found
/home/schroeter/.config/nwg-launchers/nwggrid/style.css
terminate called after throwing an instance of 'nlohmann::detail::out_of_range'
  what():  [json.exception.out_of_range.403] key 'focused' not found
Aborted (core dumped)

Keep Makefiles

Would you like to keep the Makefiles as a way of building the individual tools, or would you like to fully remove them?

Dont depend on git

[    4s] The Meson build system
[    4s] Version: 0.55.1
[    4s] Source dir: /home/abuild/rpmbuild/BUILD/nwg-launchers-0.3.2
[    4s] Build dir: /home/abuild/rpmbuild/BUILD/nwg-launchers-0.3.2/build
[    4s] Build type: native build
[    4s] Using 'PKG_CONFIG_PATH' from environment with value: ':/usr/lib64/pkgconfig:/usr/share/pkgconfig'
[    4s] Using 'PKG_CONFIG_PATH' from environment with value: ':/usr/lib64/pkgconfig:/usr/share/pkgconfig'
[    4s] Project name: nwg-launchers
[    4s] Project version: 0.3.2
[    4s] Using 'CXXFLAGS' from environment with value: '-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g'
[    4s] Using 'CXXFLAGS' from environment with value: '-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g'
[    4s] C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (SUSE Linux) 10.2.1 20200805 [revision dda1e9d08434def88ed86557d08b23251332c5aa]")
[    4s] C++ linker for the host machine: c++ ld.bfd 2.34.0.20200325-1
[    4s] Host machine cpu family: x86_64
[    4s] Host machine cpu: x86_64
[    4s] Compiler for C++ supports link arguments -lc++fs: NO 
[    4s] Compiler for C++ supports link arguments -lstdc++fs: YES 
[    4s] Found pkg-config: /usr/bin/pkg-config (1.7.3)
[    4s] Using 'PKG_CONFIG_PATH' from environment with value: ':/usr/lib64/pkgconfig:/usr/share/pkgconfig'
[    4s] Run-time dependency gtkmm-3.0 found: YES 3.24.2
[    4s] Did not find CMake 'cmake'
[    4s] Found CMake: NO
[    4s] Run-time dependency nlohmann_json found: NO (tried pkgconfig and cmake)
[    4s] 
[    4s] meson.build:26:1: ERROR: Git program not found.

Plenty of build systems won't have a network connection available.
Git should only be optional.

Do you need it to download nlohmann_json in case it wasn't downloaded as subpackage? If yes then the README should be changed because the readme states that it is optional. If no, then why do you hard depend on git?

Portability tracker

Let's track here what has to be done to make the launchers more portable to different systems.

We discussed some things in the other PR:

The wrapper scripts inside /usr/lib/nwg* folders should be removed and the launchers will reside inside the bin directory, in whatever prefix we install them. Let's say that we install them to prefix /usr. That means the files will be:

/usr/bin/nwgbar
/usr/bin/nwgdmenu
/usr/bin/nwgdmenu_run // a wrapper script that executes nwgdmenu manually
/usr/bin/nwggrid

Also there are many paths that are hardcoded inside the code like

 fs::copy_file("/usr/share/nwgbar/style.css", target, fs::copy_options::overwrite_existing);

Output the selected item in nwgdmenu

In nwgdmenu, it is possible to select an item with the arrow keys. However, after pressing the return key, it outputs the first item in the list, rather than the highlighted item.

Okular not showing in Nwggrid

When comparing the output of Wofi's drun and nwggrid, Wofi shows the application Okular, while Nwggrid does not.

Looking at the output of ls in my /usr/share/applications folder I think I can see why:

 /usr/share/applications ❯ ls                                                                 08:41:34
Alacritty.desktop		     org.kde.isoimagewriter.desktop
avahi-discover.desktop		     org.kde.kded5.desktop
bssh.desktop			     org.kde.mobile.okular_chm.desktop
bvnc.desktop			     org.kde.mobile.okular_comicbook.desktop
cmake-gui.desktop		     org.kde.mobile.okular_djvu.desktop
discord.desktop			     org.kde.mobile.okular_dvi.desktop
electron.desktop		     org.kde.mobile.okular_epub.desktop
firefox.desktop			     org.kde.mobile.okular_fax.desktop
gcr-prompter.desktop		     org.kde.mobile.okular_fb.desktop
gcr-viewer.desktop		     org.kde.mobile.okular_ghostview.desktop
gtk3-demo.desktop		     org.kde.mobile.okular_kimgio.desktop
gtk3-icon-browser.desktop	     org.kde.mobile.okular_md.desktop
gtk3-widget-factory.desktop	     org.kde.mobile.okular_mobi.desktop
htop.desktop			     org.kde.mobile.okular_ooo.desktop
ktelnetservice5.desktop		     org.kde.mobile.okular_pdf.desktop
mimeinfo.cache			     org.kde.mobile.okular_plucker.desktop
okularApplication_chm.desktop	     org.kde.mobile.okular_tiff.desktop
okularApplication_comicbook.desktop  org.kde.mobile.okular_txt.desktop
okularApplication_djvu.desktop	     org.kde.mobile.okular_xps.desktop
okularApplication_dvi.desktop	     org.kde.okular.desktop
okularApplication_epub.desktop	     org.nomacs.ImageLounge.desktop
okularApplication_fax.desktop	     pavucontrol.desktop
okularApplication_fb.desktop	     pcmanfm-qt.desktop
okularApplication_ghostview.desktop  pcmanfm-qt-desktop-pref.desktop
okularApplication_kimgio.desktop     polkit-gnome-authentication-agent-1.desktop
okularApplication_md.desktop	     qt5ct.desktop
okularApplication_mobi.desktop	     qv4l2.desktop
okularApplication_ooo.desktop	     qvidcap.desktop
okularApplication_pdf.desktop	     signon-ui.desktop
okularApplication_plucker.desktop    slack.desktop
okularApplication_tiff.desktop	     vim.desktop
okularApplication_txt.desktop	     wire-desktop.desktop
okularApplication_xps.desktop	     xdvi.desktop

It seems okular has very many .desktop files. org.kde.okular.desktop seems to be the correct one (that's the one recognized by Wofi)

Nwggrid mode to pin programs in any place you like

As I have not found a worthy replacement for https://github.com/Zren/plasma-applet-tiledmenu that isn't applet I want to suggest a feature for nwggrid. It's an expansion to favourites, I do not need tiles, groups, sidebar search or other features from that project.

It could be two modes. nwggrid -m default is just like today .

nwggrid -m fixed could start the menu as a full screen blank grid (until you pin programs) with the same search bar. The important distinction here is that you have freedom to move and pin programs in any place of the entire screen grid. I pin more than 50 programs and scripts, with icon size 48, called from .desktop. When you start typing it search the entire program list, not just from pins.
I once tried to make wayland grid with Python and drag operations crashed my computer or window manager. It was ugly. So could pin with right click no problem or just text file. Changing icon size might mess up the position of saved items.

Good job on the grid, it opens instantly on high number of programs even without daemon.

Makefile from nwgdmenu does not properly clean

The "clean" part in the nwgdmenu Makefile tries to remove "dmenu" instead of "nwgdmenu". I think there is a typo ;)
Original dmenu/Makefile:

clean:
        rm -rf *.o dmenu

Should be

clean:
        rm -rf *.o nwgdmenu

[request] Integration with Wayfire

I am using these with Wayfire on Gentoo and these are really awesome!

I was wondering if it was possible to make the nwgbar integrate with wayfire as currently it doesn't support the logout button.

Thanks a lot.

Fails to build with Clang

I can't use GCC on FreeBSD because gtkmm is built against libc++ but GCC defaults to libstdc++. Also, libstdc++fs shouldn't be necessary since GCC 9. libc++ dropped its equivalent in llvm/llvm-project@cc37af7a3631.

$ c++ --version
FreeBSD clang version 10.0.1 ([email protected]:llvm/llvm-project.git llvmorg-10.0.1-rc2-0-g77d76b71d7d)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin

$ meson _build && ninja -C _build
[...]
../bar/bar.cc:112:25: error: invalid suffix 'd' on floating constant
            if (o >= 0.0d && o <= 1.0d) {
                        ^
../bar/bar.cc:112:38: error: invalid suffix 'd' on floating constant
            if (o >= 0.0d && o <= 1.0d) {
                                     ^
../dmenu/dmenu.cc:136:25: error: invalid suffix 'd' on floating constant
            if (o >= 0.0d && o <= 1.0d) {
                        ^
../dmenu/dmenu.cc:136:38: error: invalid suffix 'd' on floating constant
            if (o >= 0.0d && o <= 1.0d) {
                                     ^
../grid/grid.cc:115:25: error: invalid suffix 'd' on floating constant
            if (o >= 0.0d && o <= 1.0d) {
                        ^
../grid/grid.cc:115:38: error: invalid suffix 'd' on floating constant
            if (o >= 0.0d && o <= 1.0d) {
                                     ^
ld: error: unable to find library -lstdc++fs
c++: error: linker command failed with exit code 1 (use -v to see invocation)

$ CC=gcc10 CXX=g++10 meson _build && ninja -C _build
/usr/bin/ld: grid/nwggrid.p/grid.cc.o: in function `main':
_build/../grid/grid.cc:301: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: _build/../grid/grid.cc:301: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: _build/../grid/grid.cc:311: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/bin/ld: _build/../grid/grid.cc:319: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: _build/../grid/grid.cc:319: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: _build/../grid/grid.cc:330: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: _build/../grid/grid.cc:347: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: _build/../grid/grid.cc:347: undefined reference to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: grid/nwggrid.p/grid.cc.o:/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:108: more undefined references to `Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' follow
/usr/bin/ld: grid/nwggrid.p/grid_tools.cc.o: in function `app_image(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
_build/../grid/grid_tools.cc:283: undefined reference to `Gdk::Pixbuf::create_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, bool)'
/usr/bin/ld: _build/../grid/grid_tools.cc:279: undefined reference to `Gdk::Pixbuf::create_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, bool)'
/usr/bin/ld: _build/../grid/grid_tools.cc:285: undefined reference to `Gdk::Pixbuf::create_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, bool)'
/usr/bin/ld: common/libnwg.a(nwg_classes.cc.o): in function `AppBox::AppBox(Glib::ustring, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, Glib::ustring)':
_build/../common/nwg_classes.cc:44: undefined reference to `Glib::ustring::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: common/libnwg.a(nwg_classes.cc.o): in function `AppBox::AppBox(Glib::ustring, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, Glib::ustring)':
_build/../common/nwg_classes.cc:44: undefined reference to `Glib::ustring::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status

nwggrid randomly opens apps in terminal

I found that nwggrid randomly opens some apps in a terminal even if the desktop file does not specify

Terminal=true

This seems to be because of an uninitialised variable. A fix that works for me is at #131

C++ vs Python menus

Which one would be the one getting more support into the future?

I want to package both for gentoo and would love to know which one to give a preference to.

Check $TERMINAL and/or $TERMCMD

Regarding get_term function: I advise you to check $TERMINAL and/or $TERMCMD first, and only if this fails, fallback to config/predefined values. Although the variables are not standard, they are widely used, as noted in this discussion.

nwgdmenu leaves PID file behind.

It certainly doesn't take up too much space, but it's a bit ugly. Is it necessary for the file to live beyond the application? I'm messing around in that code right now, so if you have an idea of what you'd like to do, I can implement it.

'nwggrid' terminated by signal SIGABRT

I installed nwg-launchers from the AUR

when i launch nwggrid, it doesn't launch and it outputs this error

WM: sway
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
fish: 'nwggrid' terminated by signal SIGABRT (Abort)

tried building from master, the issue still persists.
nwgbar and nwgdmenu work as intended.

[Request] WLR Layer Shell protocol support?

This way, the bar/grid/dmenu can have animations disabled.

Currently, on wayfire, the bar and grid have animation effects (fire animation) just like rest of the windows.

Potentially, we don't want the bar and grid to have animations, and can probably put them in the overlay layer so that they are on top?

Standardize Makefiles

Hey there! I just packaged sgtk-menu for Void (which it seems you also use?) and was looking to package nwg-launchers as well, because I wanted to give them a test drive before making actual PRs for them.

Do you think it would be possible to make the Makefiles more standard? Furthermore, having to manually run each one is a pain for packaging in Void, but I fixed that part with a simple script:

#!/usr/bin/env bash

for dir in bar dmenu grid
do
	cd $dir
	make "$@"
	cd ..
done

However, using CC set to g++ is a bit of an anti-pattern, as well as the way you're outputing pkg-config stuff. As it stands, the only one that built cleanly without any patching was the bar one. Would you be open to PRs for fixing some of these issues? I'd also be interested in adding a toplevel makefile, because a script feels a little flimsy.

Broken i3 and Openbox compatibility

As mentioned before, on the current master branch we have several X11-related issues:

  1. MainWindow 100% opaque in both i3 and Openbox (hopefully fixed here).
  2. Detection of i3 is as much essential, as in the case of sway: we cant go fullscreen() in both of them; the current way is insufficient, as it fails detecting i3 if we dont use a DM or use ly, as myself lately; I added one more case in std::string detect_wm().
  3. Improper screen geometry detection on multi-headed setup (x and y always = 0 both on i3 and Openbox); this takes no effect on Openbox, but on i3 opens launchers always on the same screen. Not yet resolved. Partially resolved by adding a separate detection method for i3. #104
  4. nwgdmenu on Openbox, when started from a key binding or a Tint2 button, shows up empty. Behaves correctly if started from terminal. No idea at the moment. Not a bug. Just needed -run argument.

fatal error: ../nwgconfig.h: No such file or directory

I've just wanted to try out your launcher/grid, but following your instructions from the README.md file I get a fatal error.

I am on Fedora 32 and here's what I did:

sudo dnf -y install gtkmm30-devel json-devel
git clone [email protected]:nwg-piotr/nwg-launchers.git
cd nwg-launchers/grid
sudo make clean install

And the last command (make) output is as follows:

$ sudo make clean install
rm -rf *.o nwggrid
g++ -c -Wall -O2 -std=c++17 grid.cc -o grid.o `pkg-config gtkmm-3.0 --libs --cflags`
In file included from grid.cc:10:
grid.h:9:10: fatal error: ../nwgconfig.h: No such file or directory
    9 | #include "../nwgconfig.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:15: grid.o] Error 1

There is no such file as nwgconfig.h in the repo root.

For the repo looks like it should be built with meson and not with make, I did the following:

sudo dnf -y install gtkmm30-devel json-devel meson ninja
git clone [email protected]:nwg-piotr/nwg-launchers.git
cd nwg-launchers
meson build
ninja -C build
sudo ninja -C build install

And this successfully installed all three programs: nwgbar, nwgdmenu, nwggrid.

I might be a good idea to update the instructions in README.md. 😃

What `PATH` does the `nwgdmenu` search?

I have the following PATH set on my system: /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/opt/bin:/usr/lib64/qt4/bin:/usr/lib64/qt5/bin:/usr/share/Modules/bin.

I have installed Firefox Nightly to /opt/ff_nightly and symlinked /opt/ff_nightly/firefox to /opt/bin/ff_nightly, so with the PATH above I can run ff_nightly to open Firefox Nightly.

Now, nwgdmenu does not show it up. I tried to insert a slash (/) in order to provide absolute path of the (symlinked) binary, but it is not inserted (why would you disable input of any characters? I know there are other special characters that won't be input).

How do I change the background color?

I'd like to make nwggrid and nwgbar fit with a light theme and I can't seem to find how to change the background color. The icons of my light theme look terrible with the default black background.

Starting nwggrid in sway with tilling mode crashes the application

When i try to start nwggrid with "for_window [title="~nwg"] floating disable" (which for some reason was the default for my config) just makes nwggrid unresponsive and crashes after a while.
The same behavior i can observe with sgtk-grid but in this case it just becomes unresponsive without crashing.

i don't think its a big issue but you might want to warn users using sway to just put in there config file "for_window [title="~nwg"] floating enable" so nwg-launchers work as expected.

I'm using arch Linux, installed both from the aur.

Slow start up

Hi! First of all, I like this project. Both nwggrid and nwgbar are useful tools. However, when I launch nwggrid, it takes about 2 seconds to show something on the screen, making a somewhat poor user experience.

Do you experience the same issue? Or perhaps there's something wrong with my configuration?

I'm using Sway on Manjaro.

Thanks!

Two issues with terminal selection.

  1. Although common, it seems that the -e option for a terminal to run a command is not universal.
    I discovered this after opening an issue for the foot terminal emulator. See
    https://codeberg.org/dnkl/foot/issues/184

  2. The code that calls "command -v" redirects the output to /dev/null with "&>/dev/null". While this will work for bash, for other shells such as dash (default on Debian) this redirection will not work and as a quite unfortunate side effect the call to std::system() will return 0 even if the exit status for "command -v foo" is non-zero.

I prepared a pull request for this. The branch has thee commits. The first two fix the issues above and the third
adds the foot terminal emulator to the list of terminals to try. See #136

1.0.0 roadmap

I used to plan on 1.0.0 release after the fourth launcher - the sgtk-menu counterpart - is developed. However, the menu overflow issue on sway remains unresolved, and coding the insane workaround I used in python again in C++ would be a nightmare to me. Moreover, the menu looks well, but I don't use it at all since the grid appeared. That's why I thought to go ahead with the 1.0.0 release, and leave the menu for an undefined future - if any.

IMO we could find this project 1.0.0-ready as soon as the changes @ericonr is going to make are done.

Let me know what you think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.