You are not logged in.

#1 2014-12-12 04:12:36

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

pulseaudio-ctl makepkg suggestion and advice request

graysky wrote:

Use this little script  to control your pulseaudio volume from within xfce4 or other DE's via mapped keys on the keyboard (mine actually has keys for mute, vol+ and vol-).  Mapping shortcut keys varies from DE to DE.  On xfce4, the you can do this under Settings > Keyboard > Application Shortcuts.

Usage is very simple:
/usr/bin/pulseaudio-ctl mute will toggle status of mute
/usr/bin/pulseaudio-ctl up will increase vol by 5 %
/usr/bin/pulseaudio-ctl down will decrease vol by 5 %

You can map these three actions to three keyboard shortcuts for quick access.  My keyboard actually has discrete buttons for these actions:
http://s19.postimg.org/5lqxulqb7/keyboard.jpg

If you execute the script from the shell, it will output the above and also show the current vol level and mute status:

% pulseaudio-ctl
pulseaudio-ctl v1.45

/usr/bin/pulseaudio-ctl {up,down,mute,mute-input,set,atmost} [n]
Where up and down adjust volume in ±5 % increments.
Where mute toggles the mute status on/off.
Where mute-input toggles the input status on/off.
Where set takes a % value.
Where atmost only takes effect if current volume is higher than this.

Optionally, redefine an upper threshold in /home/facade/.config/pulseaudio-ctl/config

Volume level     : 90 %
Is sink muted    : no
Is source muted  : no
Detected sink    : 1
Detected source  : 1
Pulse version    : 5.0

UPDATE on 03-Nov-2014: Now uses libnotify to show vol level and mute status.

AUR: https://aur.archlinux.org/packages/pulseaudio-ctl
GitHub: https://github.com/graysky2/pulseaudio-ctl

I want to modify it to offer optional pacmd+pactl/amixer+???? control.

-p ==>  Use pulseaudio control backend (default)
-a ==>  Use alsa control backend

This makes the dependencies optional.

I also had a different problem:

sudo qqbuild cflags -Os aura -A pulseaudio-ctl
[sudo] password for quequotion: 
aura >>= Determining dependencies...
aura >>= Repository dependencies:
libpulse
pulseaudio

aura >>= AUR Packages:
pulseaudio-ctl

aura >>= Continue? [Y/n] n
aura >>= Installation manually aborted.

quequotion had alsa-utils installed.

pulseaudio-git's PKGBUILD {provides,conflicts,replaces}(libpulse pulseaudio), without even a version number.

The version number is the problem, but I removed replaces() anyway.

provides=("pulseaudio=$pkgver" "libpulse=$pkgver")
conflicts=("pulseaudio" "libpulse")
[snip]
pkgver() {
	cd "$srcdir/$_pkgname"
	gitver=$(git describe --always | sed "s/-/./g")
	gitver=${gitver:1}
	echo $gitver
}

can this pkgver() be shortened?

This solves dependency problems with pusleaudio-ctl & pulseaudio-git.

Now I can get on to modifying your script smile

EDIT - fixed copypasta type-o; back from work; on to bashing

Last edited by quequotion (2014-12-12 22:34:09)

Offline

#2 2014-12-12 15:27:45

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: pulseaudio-ctl makepkg suggestion and advice request

Not sure how relevant your post is to this script hmm

Offline

#3 2014-12-12 16:38:41

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,701

Re: pulseaudio-ctl makepkg suggestion and advice request

At graysky's request, I have moved this side discussion about the PKGBUILD to its own thread.  Moves to AUR Issue, Discussion and PKGBUILD Requests


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2014-12-12 21:49:50

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: pulseaudio-ctl makepkg suggestion and advice request

graysky wrote:

Not sure how relevant your post is to this script hmm

Not as relevant as I thought. I had in mind that it would be useful if the script supported both alsa and pulse backends (to use the same script in different setups); even though it's not really useful for me. I also have in mind to streamline the various execution calls; and make use of notification ids.

Anyway, I ended up doing nothing for now; I may come back to this later. In fact, gnome-settings-daemon should be managing these hotkeys for me, but it has proven extremely unreliable lately (some features have been moved to gnome-shell or another component without documentation; others just vanished completely).

Offline

Board footer

Powered by FluxBB