<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>maces-net.de &#187; xosd</title>
	<atom:link href="http://maces-net.de/tag/xosd/feed/" rel="self" type="application/rss+xml" />
	<link>http://maces-net.de</link>
	<description>blogging on the geek side of live</description>
	<lastBuildDate>Fri, 01 Oct 2010 14:35:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Lautstärke per Skript ändern</title>
		<link>http://maces-net.de/2008/10/10/lautstarke-per-skript-andern/</link>
		<comments>http://maces-net.de/2008/10/10/lautstarke-per-skript-andern/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 10:20:04 +0000</pubDate>
		<dc:creator>maces</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[alsa]]></category>
		<category><![CDATA[amixer]]></category>
		<category><![CDATA[fluxbox]]></category>
		<category><![CDATA[LXDE]]></category>
		<category><![CDATA[openbox]]></category>
		<category><![CDATA[skript]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[xosd]]></category>

		<guid isPermaLink="false">http://www.maces-net.de/?p=154</guid>
		<description><![CDATA[Hi heute zeige ich euch ein Skript, mit dem man die Lautstärke ändern kann, und die aktuelle Lautstärke mit xosd auf dem Bildschirm anzeigen kann.]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>Nachdem ich mir bereits Tastenkürzel zum lauter und leiser stellen meiner Lautsprecher gebastelt habe, habe ich es jetzt noch mit <a href="http://www.ignavus.net/software.html" target="_blank">xosd</a> optisch verschönert. Um das Skript nutzen zu können muss man es einfach nur mit einem Tastenkürzel verbinden, dazu sehe man in die Dokumentation seines Fenstermanagers. Hier das Skript:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># autor maces</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># script to chnage volume very easy</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># use sound + or sound - to +/- the sound</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#prozent=amixer get Master | grep [[0-9]*] | cut -d &quot; &quot; -f 7 | sed 's/\[//g;s/\]//g;s/\%//g'</span>
<span style="color: #666666; font-style: italic;">#osd_cat -b slider -P ${prozent}  -A center -s 1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Skript aus: http://sidux.com/PNphpBB2-viewtopic-t-12191.html</span>
<span style="color: #666666; font-style: italic;"># vorherigen Lautstärke als Zahlenwert auslesen</span>
<span style="color: #007800;">VOL</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>amixer get Master <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> L<span style="color: #7a0874; font-weight: bold;">&#91;</span>.<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">7</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/\[//;s/\]//;s/\%//'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;"># den Zalenwert als Balken anzeigen und 1sek stehen lassen</span>
osd_cat <span style="color: #660033;">-p</span> middle <span style="color: #660033;">-A</span> center <span style="color: #660033;">-b</span> percentage <span style="color: #660033;">-P</span> <span style="color: #007800;">$VOL</span> <span style="color: #660033;">-T</span> Lautstärke: <span style="color: #660033;">-d</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-c</span> blue <span style="color: #660033;">-s</span> <span style="color: #000000;">8</span> <span style="color: #660033;">-a</span> <span style="color: #000000;">0</span>
<span style="color: #666666; font-style: italic;"># Lautstärke ändern</span>
amixer <span style="color: #660033;">-c</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">set</span> PCM 2dB$<span style="color: #000000;">1</span> unmute
amixer <span style="color: #660033;">-c</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">set</span> Master 2dB$<span style="color: #000000;">1</span> unmute
<span style="color: #666666; font-style: italic;"># jetzige Lautstärke als Zahlenwert auslesen</span>
<span style="color: #007800;">VOL</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>amixer get Master <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> L<span style="color: #7a0874; font-weight: bold;">&#91;</span>.<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">7</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/\[//;s/\]//;s/\%//'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #666666; font-style: italic;"># den Zalenwert als Balken anzeigen und 1sek stehen lassen</span>
osd_cat <span style="color: #660033;">-p</span> middle <span style="color: #660033;">-A</span> center <span style="color: #660033;">-b</span> percentage <span style="color: #660033;">-P</span> <span style="color: #007800;">$VOL</span> <span style="color: #660033;">-T</span> Lautstärke: <span style="color: #660033;">-d</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-c</span> blue <span style="color: #660033;">-s</span> <span style="color: #000000;">8</span> <span style="color: #660033;">-a</span> <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># testing</span>
<span style="color: #666666; font-style: italic;">#echo $0 # print the filename</span>
<span style="color: #666666; font-style: italic;">#echo $1 # print the first parameter</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># end</span></pre></td></tr></table></div>

<p>Um die Lautstärke zu erhöhen, gibt man <strong>sound +</strong> ein, oder um die Lautstärke zu vermindern <strong>sound -</strong>.<br />
Das Skript lässt sich natürlich noch erweitern, viel Spaß dabei <img src='http://maces-net.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Hier noch ein paar Links für die Tastenkürzel der Fenstermanager:</p>
<p>Openbox: <a href="http://wiki.ubuntuusers.de/Openbox#Shortcuts" target="_blank">LINK</a><br />
Fluxbox: <a href="http://wiki.ubuntuusers.de/Fluxbox#Tastenkuerzel" target="_blank">LINK</a><br />
LXDE: <a href="http://wiki.ubuntuusers.de/Openbox#Shortcuts" target="_blank">LINK</a>, Bei LXDE ist die Konfigurationsdatei allerdings: <strong>~/.config/openbox/lxde-rc.xml</strong>.</p>
<p>Die aktuellste Version des Skripts findet ihr auf der <a href="http://www.maces-net.de/projekte/lautstarke-per-skript/" target="_self">Projektseite</a>.</p>
<p>maces</p>
]]></content:encoded>
			<wfw:commentRss>http://maces-net.de/2008/10/10/lautstarke-per-skript-andern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk
Object Caching 238/271 objects using disk

Served from: maces-net.de @ 2012-02-05 19:17:58 -->
