Coder Social home page Coder Social logo

Volume display on OpenBSD about dwmblocks HOT 5 CLOSED

torrinfail avatar torrinfail commented on July 28, 2024
Volume display on OpenBSD

from dwmblocks.

Comments (5)

swindlesmccoop avatar swindlesmccoop commented on July 28, 2024

I did a bit of investigating and realized that I was using signals wrong...anyways, what I figured out is that I needed my script to actually send the signal to the dwmblocks process. The only problem is that all of the blocks to the right of the block where the signal is defined as 1 are truncated. I have attached my blocks.h file for debugging if that's helpful.
blocks.h

from dwmblocks.

zamoranos avatar zamoranos commented on July 28, 2024

There are two user-defined signals for POSIX Standard signals, SIGUSR1 and SIGUSR2
https://dsa.cs.tsinghua.edu.cn/oj/static/unix_signal.html
https://man.openbsd.org/signal.3
https://www.gnu.org/software/libc/manual/html_node/Miscellaneous-Signals.html

I also use OpenBSD btw.
For volume control, My dwm/config.h has something like this:
{ MODKEY, XK_equal, spawn, SHCMD("sndioctl output.level=+0.05; pkill -SIGUSR1 dwmblocks") },

In dwmblocks:
{"", "sb-volume", 0, 1},

from dwmblocks.

swindlesmccoop avatar swindlesmccoop commented on July 28, 2024

That looks like it would work. Do you know how to bind the actual media keys like on a laptop (in my case the ThinkPad T420) in config.h so that they can run that command instead of whatever arbitrary command its running?

from dwmblocks.

zamoranos avatar zamoranos commented on July 28, 2024

I think this will do:
{ 0, XF86XK_AudioMute, spawn, SHCMD("pkill -SIGUSR1 dwmblocks") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pkill -SIGUSR1 dwmblocks") },
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pkill -SIGUSR1 dwmblocks") },

from dwmblocks.

swindlesmccoop avatar swindlesmccoop commented on July 28, 2024

Thank you! This is quite literally the exact thing I was looking for. In case anyone finds this on Google or something, in order to fix the error: use of undeclared identifier 'XF86XK_AudioRaiseVolume' error, you need to add a line above all of the keybinds with #include <X11/XF86keysym.h>

from dwmblocks.

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.