From 5d49df89159224e3efad40562f9886a9b10e79da Mon Sep 17 00:00:00 2001 From: tiyn Date: Wed, 5 Apr 2023 01:35:54 +0200 Subject: [PATCH] audio: added and linked playerctl and sxhkd --- wiki/audio.md | 5 +++++ wiki/linux/audio.md | 11 +++++++++++ wiki/linux/playerctl.md | 37 +++++++++++++++++++++++++++++++++++ wiki/linux/sxhkd.md | 43 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 wiki/linux/playerctl.md create mode 100644 wiki/linux/sxhkd.md diff --git a/wiki/audio.md b/wiki/audio.md index a5b42f4..369ce7f 100644 --- a/wiki/audio.md +++ b/wiki/audio.md @@ -8,6 +8,8 @@ Music and Audiobooks can be obtained by buying the digital files or by [extracting them off of a CD](#extract-audio-files-from-cds). Podcasts need a so called Podcatcher. A Podcatcher is used to subscribe to podcasts and download them automatically. +For Linux specific music software navigate to the corresponding +[wiki entry](/wiki/linux/audio.md). ## Media Software @@ -17,6 +19,9 @@ There are differences depending on your preffered software interface. ### Software for Music/Podcasts/Audiobooks +The following is a list of server software, that is featured in this wiki. +The corresponding client software is handled in the server softwares wiki entry. + - [Subsonic](./subsonic.md) is a media streamer for music, podcasts and audiobooks. Subsonic is self-hostable. diff --git a/wiki/linux/audio.md b/wiki/linux/audio.md index afcb414..fde01d6 100644 --- a/wiki/linux/audio.md +++ b/wiki/linux/audio.md @@ -1,6 +1,8 @@ # Audio Audio is an important point in a linux desktop environment +For non-Linux specific audio software navigate to the corresponding +[wiki article](/wiki/audio.md). ## Sound Server @@ -23,3 +25,12 @@ installed. Belonging to the latter option noise cancellation can be easily achieved by installing [Noisetorch](https://github.com/lawl/NoiseTorch). After the installation modify the `Voice Activation Threshhold` to your needs. + +## Control Audio from Command Line/by Hotkey + +Audio from many different clients can be controlled (started, stopped, skipped) +using the command line with [PlayerCTL](/wiki/linux/playerctl.md). +With additional software it can also be used to control audio/music by pressing +hotkeys. +This is explained in the +[PlayerCTL entry](/wiki/linux/playerctl.md#using-hotkeys). diff --git a/wiki/linux/playerctl.md b/wiki/linux/playerctl.md new file mode 100644 index 0000000..6bfeaa6 --- /dev/null +++ b/wiki/linux/playerctl.md @@ -0,0 +1,37 @@ +# PlayerCTL + +[PlayerCTL](https://github.com/altdesktop/playerctl) is a MPRIS (Media Player +Remote Interfacing Specification) [media player](/wiki/audio.md#media-software) +command-line controller for Spotify, [Sonixd](/wiki/subsonic.md#client), MPV and +many other different media clients aswell as [browser](/wiki/browser.md). + +## Setup + +On most linux distributions PlayerCTL can be installed with the `playerctl` +package. +Alternatively it can be installed via +[Github](https://github.com/altdesktop/playerctl). + +## Usage + +## Basic Commands + +For starting, stopping the music the commans are simple and very intuitive. +The following commands show how to control music. +The commands are quite self-explaining. + +```sh +playerctl play +playerctl pause +playerctl play-pause +playerctl stop +playerctl next +playerctl previous +``` + +## Using Hotkeys + +Hotkeys can be more accessible than typing the commands to start or stop music +in the terminal. +With [SXHKD](/wiki/linux/sxhkd.md#setting-a-hotkey) commands from the CLI can +be set to a hotkey. diff --git a/wiki/linux/sxhkd.md b/wiki/linux/sxhkd.md new file mode 100644 index 0000000..b3a576e --- /dev/null +++ b/wiki/linux/sxhkd.md @@ -0,0 +1,43 @@ +# SXHKD + +[SXHKD](https://github.com/baskerville/sxhkd) - short for Simple +[X](/wiki/linux/x_window_system.md) hotkey daemon - is a program to set hotkeys. + +## Setup + +On most linux distributions SXHKD can be installed with the `sxhkd` +package. +Alternatively it can be installed via +[Github](https://github.com/baskerville/sxhkd). + +## Usage + +### Setting a Hotkey + +Configuration for setting hotkeys is done in the file `~/.config/sxhkd/sxhkdrc`. +A hotkey corresponds to typically two, sometimes more lines within this +configuration file. +The first line describes the keys that act as hotkeys and the second line +describes the commands that are run on pressing the hotkey. + +There are simple hotkeys using only one key (in this case the Launch Button). + +```txt +XF86LaunchB + xdotool selectwindow | xsel -bi +``` + +And some commands use modifier keys or multiple keys. + +```txt +super + shift + equal + sxiv -rt "$HOME/image" +``` + +When using similar commands it can be useful to map multiple hotkeys in one +entry. + +```txt +super + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} +```