项目作者: hastinbe

项目描述 :
Volume control and volume notifications
高级语言: Shell
项目地址: git://github.com/hastinbe/i3-volume.git
创建时间: 2016-03-31T15:55:29Z
项目社区:https://github.com/hastinbe/i3-volume

开源协议:GNU General Public License v2.0

下载


i3-volume

Volume control with on-screen display notifications. Works with any window manager, such as i3wm, bspwm, and KDE, as a standalone script, or with statusbars such as polybar, i3blocks, i3status, and more.

License: GPL v2 build

Installation

Read the installation instructions to get started. For a specific usage:

Usage

Use your keyboard volume keys to increase, decrease, or mute your volume. If you have a volume indicator in your status line it will be updated to reflect the volume change. When notifications are enabled a popup will display the volume level.

On-Screen Notifications

notify-osd dunst xob
notify-osd notifications dunst notifications xob notifications
XOSD herbe volnoti
xosd notifications herbe notifications volnoti notifications
KOSD
kosd notifications

Read about notifications for more information.

Standalone

i3-volume does not require any particular desktop environment and can be used as a standalone script.

Command-line options

  1. Usage: ./volume [<options>] <command> [<args>]
  2. Control volume and related notifications.
  3. Commands:
  4. up <value> increase volume
  5. down <value> decrease volume
  6. set <value> set volume
  7. mute toggle mute
  8. listen listen for changes to a PulseAudio sink
  9. output <format> output volume in a supported format
  10. custom format substitutions:
  11. %v = volume
  12. %s = sink name (PulseAudio only)
  13. %c = card (alsamixer only)
  14. %m = mixer (alsamixer only)
  15. %p = volume progress bar
  16. %i = volume icon/emoji
  17. %P = active port description (PulseAudio only)
  18. examples:
  19. "Volume is %v" = Volume is 50%
  20. "%i %v %p \n" = 奔 50% ██████████
  21. outputs show available output formats
  22. notifications show available notification methods
  23. help display help
  24. Options:
  25. -a use amixer
  26. -n enable notifications
  27. -C use libcanberra for playing event sounds
  28. -P play sound for volume changes
  29. -j <muted,high,low,medium> specify custom volume emojis as a comma separated list
  30. -t <process_name> process name of status bar (requires -u)
  31. -u <signal> signal to update status bar (requires -t)
  32. -x <value> maximum volume
  33. -X <value> maximum amplification; if supported (default: 2)
  34. -h display help
  35. amixer Options:
  36. -c <card> card number to control
  37. -m <mixer> set mixer (default: Master)
  38. PulseAudio Options:
  39. -s <sink> symbolic name of sink
  40. -A <port:alias> specify an alias for a port name (e.g., -A "Speakers:Living Room")
  41. Notification Options:
  42. -N <method> notification method (default: libnotify)
  43. -p enable progress bar
  44. -L <placement> progress bar placement (default: summary; requires -p)
  45. placements:
  46. body
  47. summary
  48. -e <expires> expiration time of notifications in ms
  49. -l use fullcolor instead of symbolic icons
  50. -S <suffix> append suffix to symbolic icon names
  51. -y use dunstify (default: notify-send)
  52. Environment Variables:
  53. XOSD_PATH path to osd_cat
  54. HERBE_PATH path to herbe
  55. VOLNOTI_PATH path to volnoti-show
  56. CANBERRA_PATH path to canberra-gtk-play
  57. NOTIFY_PATH path to command that sends notifications
  58. NO_NOTIFY_COLOR flag to disable colors in notifications
  59. USE_NOTIFY_SEND_PY flag to use notify-send.py instead of notify-send

Configuration

i3-volume also looks for a configuration file located at either ~/.config/i3-volume/config, or $XDG_CONFIG_HOME/i3-volume/config. You can use this file to set any variables that are not set in the command line. For example, if you want to always display notifications using dunst. You can add the following to your config file:

  1. NOTIFICATION_METHOD="dunst"
  2. DISPLAY_NOTIFICATIONS=true

Or if using i3blocks as your statusline and dunst for notifications, aliasing the analog-output-speaker port to Speaker and using fullcolor icons:

  1. STATUSLINE="i3blocks"
  2. SIGNAL="SIGRTMIN+10"
  3. NOTIFICATION_METHOD="dunst"
  4. USE_DUNSTIFY=true
  5. DISPLAY_NOTIFICATIONS=true
  6. USE_FULLCOLOR_ICONS=true
  7. PORT_ALIASES[analog-output-speaker]=Speaker

Now every invocation of the script will use these settings, unless overridden by command line options. To find more variables, check the source code of the parse_opts and main functions.

Migrating

Version 2.x to 3.x

Version 3 introduces commands which makes it incompatible with previous versions. Your command-line usage and/or configured hotkeys need to be updated to reflect this.

Change v2 v3
-d is now the down command volume -d 5 volume down 5
-i is now the up command volume -i 5 volume up 5
-m is now the mute command volume -m volume mute
-o is now the output command volume -o i3blocks volume output i3blocks
-v is now the set command volume -v 5 volume set 5
-L is now the listen command volume -L volume listen
-M is now the -m option volume -M Master volume -m Master

Interoperability

i3-volume is capable of working with many other programs. The following lists a few with examples:

Program Note
i3blocks See our example blocklet
i3status-rust See our example custom block
xob Requires extra steps for notifications. Guide
XOSD Notifications require the -N xosd option. Example
herbe Notifications require the -N herbe option. Example
volnoti Notifications require the -N volnoti option. Example
KOSD Notifications require the -N kosd option. Example
sxhkd For keybindings with or without i3wm, often used with bspwm. Example

Help

Having a problem? Try reading our common issues or open an issue.

License

i3-volume is released under GNU General Public License v2

Copyright (C) 1989, 1991 Free Software Foundation, Inc.