From 8b5f42d9343e7965ca118a2575872bb31205b522 Mon Sep 17 00:00:00 2001 From: kennypm Date: Tue, 19 Jul 2022 19:27:39 -0400 Subject: [PATCH] remove unnecessary libprocps dependency --- README.md | 6 ------ include/modules/jack.hpp | 2 -- meson.build | 4 +--- meson_options.txt | 2 +- src/modules/jack.cpp | 18 ++---------------- 5 files changed, 4 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 191e3097..248eef01 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,3 @@ -## note: this fork depends on libjack and libprocps as well as the dependencies listed below - - - - - # Waybar [![Licence](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Paypal Donate](https://img.shields.io/badge/Donate-Paypal-2244dd.svg)](https://paypal.me/ARouillard)
![Waybar](https://raw.githubusercontent.com/alexays/waybar/master/preview-2.png) > Highly customizable Wayland bar for Sway and Wlroots based compositors.
diff --git a/include/modules/jack.hpp b/include/modules/jack.hpp index 71753985..4c1921d6 100644 --- a/include/modules/jack.hpp +++ b/include/modules/jack.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include "ALabel.hpp" #include "util/sleeper_thread.hpp" @@ -28,7 +27,6 @@ class JACK : public ALabel { jack_nframes_t samplerate_; unsigned int xruns_; std::string state_; - pthread_t jack_thread_; util::SleeperThread thread_; }; diff --git a/meson.build b/meson.build index c6bdd7e2..f519380e 100644 --- a/meson.build +++ b/meson.build @@ -99,7 +99,6 @@ libevdev = dependency('libevdev', required: get_option('libevdev')) libmpdclient = dependency('libmpdclient', required: get_option('mpd')) xkbregistry = dependency('xkbregistry') libjack = dependency('jack', required: get_option('jack')) -libprocps = dependency('libprocps', required: get_option('jack')) libsndio = compiler.find_library('sndio', required: get_option('sndio')) if libsndio.found() @@ -224,7 +223,7 @@ if libpulse.found() src_files += 'src/modules/pulseaudio.cpp' endif -if libjack.found() and libprocps.found() +if libjack.found() add_project_arguments('-DHAVE_LIBJACK', language: 'cpp') src_files += 'src/modules/jack.cpp' endif @@ -310,7 +309,6 @@ executable( upower_glib, libpulse, libjack, - libprocps, libudev, libepoll, libmpdclient, diff --git a/meson_options.txt b/meson_options.txt index acbcce73..5fd1b7a7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,7 +9,7 @@ option('dbusmenu-gtk', type: 'feature', value: 'auto', description: 'Enable supp option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('mpd', type: 'feature', value: 'auto', description: 'Enable support for the Music Player Daemon') option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk-layer-shell library for popups support') -option('rfkill', type: 'feature', value: 'auto', description: 'Enable support for RFKILL') +option('rfkill', type: 'feature', value: 'enabled', description: 'Enable support for RFKILL') option('sndio', type: 'feature', value: 'auto', description: 'Enable support for sndio') option('logind', type: 'feature', value: 'auto', description: 'Enable support for logind') option('tests', type: 'feature', value: 'auto', description: 'Enable tests') diff --git a/src/modules/jack.cpp b/src/modules/jack.cpp index af4870ed..85268bbe 100644 --- a/src/modules/jack.cpp +++ b/src/modules/jack.cpp @@ -19,25 +19,11 @@ std::string waybar::modules::JACK::JACKState() { if(state_.compare("connected") == 0) return "connected"; - std::string procname; - bool foundJACK = false; - proc_t** proctab = readproctab(PROC_FILLSTAT); - for(int i=0; proctab[i]; i++) { - procname = proctab[i]->cmd; - if(!procname.compare("jackd") || !procname.compare("jackdbus") || - !procname.compare("pipewire")) - foundJACK = true; - freeproc(proctab[i]); - } - free(proctab); - if(!foundJACK) - return "disconnected"; - client_ = jack_client_open("waybar", JackNoStartServer, NULL); if (client_) { - jack_thread_ = jack_client_thread_id(client_); + pthread_t jack_thread = jack_client_thread_id(client_); if(config_["realtime"].isBool() && !config_["realtime"].asBool()) - jack_drop_real_time_scheduling(jack_thread_); + jack_drop_real_time_scheduling(jack_thread); bufsize_ = jack_get_buffer_size(client_); samplerate_ = jack_get_sample_rate(client_);