Git Product home page Git Product logo

Comments (15)

ricardomv avatar ricardomv commented on June 26, 2024

hi, i am trying to port this to compile with autotools, later today i can send you a pull request

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

Thanks, that sounds great!

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

@ricardo-vieira Do you know if it's possible/easy to implement a way to pass DISABLE_[widget] flags to gcc and make this configurable by the user? E.g. running ./configure --without-widget_weather passes -DDISABLE_WEATHER to gcc to disable the entire weather widget.

from candybar.

ricardomv avatar ricardomv commented on June 26, 2024

yes that was the next thing i was adding to the build system. autotools has a system you set a default (enable/disable) and it defines a symbol in config.h (not your config.h witch you should think in removing) and then you just do an #ifdef of that symbol. and you can disable it in configure with --disable-widget_weather or --enable-widget_weather.
but i can't do it now it will have to wait until the weekend :|

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

Allright, no rush, I'll see if I can get it to work in the meantime.

The plan is to remove config.h soon, but I'm not sure if I want to use a JSON config file or command-line arguments. I'm thinking about going for a JSON config file in e.g. $XDG_CONFIG_HOME/wkline/config.json. With a JSON config file we could possible reuse the config loading functionality for reloading the configuration when drag/dropping a theme from a website.

from candybar.

ricardomv avatar ricardomv commented on June 26, 2024

Do you realize the dnd function is already implemented? you can try it right now. I don't think you need to reload the config you just need to open a popup asking "Set as default? " and if yes just save it. you only need a function to load the config file, just make it reusable an use dynamic memory

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

I tried dropping an URI onto the statusline, but it didn't do anything, what do you do to make it work?

from candybar.

ricardomv avatar ricardomv commented on June 26, 2024

It does not work as well as i thought it would. I think the widgets crash in the process. Are you selecting the text and dragging? just drag the url http://lokaltog.github.io/wkline-theme-default/

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

Yep, I tried dragging it from chrome and from a text box, still doesn't work for me unfortunately. Maybe dropping is handled differently in various WMs. I'm guessing the WebView provides a signal for dropping that can be used to handle this properly.

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

btw, found this, trying to implement it now.

from candybar.

ricardomv avatar ricardomv commented on June 26, 2024

Yes that's what i was talking about.

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

Man this is frustrating. I've managed to register the command-line argument, but it fails to build if a library is missing, because it still tries to build all the files in the source array in Makefile.am. Here's what I've got so far:

diff --git a/configure.ac b/configure.ac
index 5fc0839..ee26f33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,6 +3,17 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
 AC_PROG_CC
 AC_CONFIG_HEADERS([config.h])

+AC_ARG_WITH([mpd], AS_HELP_STRING([--without-mpd], [compile without libmpdclient support]))
+
+AS_IF([test "x$with_mpd" != "xno"],
+      [PKG_CHECK_MODULES([MPD], [libmpdclient], [have_libmpdclient=yes], [have_libmpdclient=no])],
+      [have_libmpdclient=no])
+
+AS_IF([test "x$have_libmpdclient" = "xyes"], [], [
+      AC_DEFINE([DISABLE_WIDGET_NOW_PLAYING_MPD], [], [disable libmpdclient])
+      AS_IF([test "x$with_mpd" = "xyes"], [AC_MSG_ERROR([libmpdclient requested but not found])])
+      ])
+
 # Remove if you wish to see full compiler command lines
 AM_SILENT_RULES([yes])

@@ -14,7 +25,6 @@ PKG_CHECK_MODULES([XCB], [xcb-util xcb-ewmh xcb-icccm])
 PKG_CHECK_MODULES([JSON_GLIB], [jansson])
 PKG_CHECK_MODULES([CURL], [libcurl])
 PKG_CHECK_MODULES([ALSA], [alsa])
-PKG_CHECK_MODULES([MPD], [libmpdclient])

 AC_CONFIG_FILES([
  Makefile

We only need to find a way to remove src/widgets/now_playing_mpd.c from the sources array in makefile.am for this to work.

Would it be possible to remove the widgets from the source array and do something like this instead in widgets.h?

#ifndef DISABLE_WIDGET_NOW_PLAYING_MPD
#include "now_playing_mpd.c"
#endif

I know you mentioned #including .c files was bad practice, do you have any suggestions to resolve this issue?

from candybar.

ricardomv avatar ricardomv commented on June 26, 2024

Use _SOURCES += file.c add one at a time

from candybar.

ricardomv avatar ricardomv commented on June 26, 2024

Did you get it? Im on the phone i cant see the diff

from candybar.

Lokaltog avatar Lokaltog commented on June 26, 2024

Yep, I'm on it, almost done with the patch now.

from candybar.

Related Issues (20)

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.