Giter Club home page Giter Club logo

apw's Introduction

Be aware that…

…this project is not developed any longer, nor do I use awesome. It still works though \o/. I am willing to merge bug fixes and improvements that do not alter the appearance or behavior. Breaking changes in this sense, I will not merge.

You are welcome to fork APW and I will add a link to it in the README. Currently known feature adding forks:

Awesome Pulseaudio Widget

Awesome Pulseaudio Widget (APW) is a little widget for Awesome WM, using the awful progressbar widget to display default's sink volume and control Pulseaudio.

It's compatible with Awesome 4.0.

First time I'm using Lua so it might be a little bit quirky.

Get it

cd $XDG_CONFIG_HOME/awesome/
git clone https://github.com/mokasin/apw.git

Use it

Just put these line to the appropriate places in $XDG_CONFIG_HOME/awesome/rc.lua.

-- Load the widget.
local APW = require("apw/widget")

-- Example: Add to wibox. Here to the right. Do it the way you like it.
right_layout:add(APW)

-- Configure the hotkeys.
awful.key({ }, "XF86AudioRaiseVolume",  APW.Up),
awful.key({ }, "XF86AudioLowerVolume",  APW.Down),
awful.key({ }, "XF86AudioMute",         APW.ToggleMute),

Customize it

Theme

Important: beautiful.init must be called before you require apw for theming to work.

Add these variables to your Beautiful theme.lua file and set them to whatever colors or gradients you wish:

--{{{ APW
theme.apw_fg_color = {type = 'linear', from = {0, 0}, to={40,0},
	stops={{0, "#CC8888"}, {.4, "#88CC88"}, {.8, "#8888CC"}}}
theme.apw_bg_color = "#333333"
theme.apw_mute_fg_color = "#CC9393"
theme.apw_mute_bg_color = "#663333"
--}}}

Directly edit widget.lua

You also can customize some properties by editing the configuration variables directly in widget.lua (for example to add a margin). It is advisable to customize the source file in a separate branch. This makes it easy to update to a new version of APW via rebasing.

Overriding hidden widget properties without directly editing widget.lua

.pulseBar and .pulse widget properies allowing to directly override some widget behavior or properties which are not customizeable by beautiful theme variables.

  local volume = require("third_party/apw/widget")
  
  -- adjust progress bar step:
  volume.pulseBar.step = 0.02
  
  -- set Scroll Lock LED on keyboard to show Mute status:
  volume.pulse.OrigToggleMute = volume.pulse.ToggleMute
  volume.pulse.ToggleMute = function(self)
      volume.pulse.OrigToggleMute(self)
      if volume.pulse.Mute then
        awful.spawn.spawn('xset led named "Scroll Lock"')
      else
        awful.spawn.spawn('xset -led named "Scroll Lock"')
      end
  end

Mixer

Right-clicking the widget launches a mixer. By default pavucontrol is used, but you may use a different mixer by calling SetMixer() on your APW object:

local APW = require("apw/widget")
APW:SetMixer("mixer_command -whatever")

Tip

In order to track changes to the volume from outside the widget, it is possible to update the widget periodically.

APWTimer = timer({ timeout = 0.5 }) -- set update interval in s
APWTimer:connect_signal("timeout", APW.Update)
APWTimer:start()

Contributing

Fork it and file a pull request. I'll look into it.

apw's People

Contributors

abustany avatar actionless avatar alandmoore avatar balderdash avatar cipherself avatar cmertz avatar goffredo avatar mokasin avatar pltanton avatar vinipsmaker avatar zml2008 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apw's Issues

show_text=true breaks widget

The issue can be reproduced with the following (Awesome 4.1):

  • Start out from the default Awesome rc.lua.
  • Put the APW widget on the wibar (I tried it right after mykeyboardlayout).
  • Set show_text = true (or beautiful.apw_show_text = true).

Without show_text, the widget works fine. If show_text is enabled, then it occupies almost the whole screen and does not update.

Ability to control multiple/all sinks

Hi,

first off, your widget is awesome (… haha -.-)! I could think of one enhancement though, which is the ability to control the volume of multiple sinks at once — possibly and for the ease of use, all at once? I’m using a USB-DAC for HiFi listening, and my mainboards S/PDIF output for all other everyday tasks — and it would be really cool if the keybinds to APW would just control both simultaneously, so i don’t have to spawn pavucontrol for one …

Thanks!
-NebuK!

Not working with awesome 3.4.13-1

Hi I am using awesome on Debian stable:

$ awesome -version
awesome debian/3.4.13-1 (Octopus)
 • Build: Jul 16 2012 13:57:50 for x86_64 by gcc version 4.7.1 (@keller)
 • D-Bus support: ✔

running

require("apw/widget") 

gives

widget.lua:44: attempt to index field 'layout' (a nil value)

Did the awesome API change at some point? What can I do to get this working on my installation? Thanks!

Pull request question

Hi, I've added another little feature to the widget. But I actually committed it before I pulled from the new Beautiful integration. So how do I submit a pull request now? Should I merge it first or just send a pull request and let you merge it manually?

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.