Skip to content
Snippets Groups Projects
Commit fdbde118 authored by JiriKalvoda's avatar JiriKalvoda
Browse files

VOLUME Add volue view.

parent 1869ad37
No related branches found
No related tags found
No related merge requests found
if [[ $(id -u) -ne 0 ]] ; then echo "Please run as root" ; exit 1 ; fi
g++ ./volumeInfo.c -o /usr/bin/volumeInfo
chmod u+s /usr/bin/volumeInfo
cp ./volumeGUI.sh /usr/bin/volumeGUI
chmod o+x /usr/bin/volumeGUI
notify-send "ZVUK" "`volumeInfo`" -h string:x-canonical-private-synchronous:anything
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <math.h>
const char adr [] = "amixer sget Master";
int main(int argc,char ** argv)
{
setuid(0);
FILE * f = popen(adr,"r");
double realAct;
int act;
char str[1000];
fscanf(f,"%[^[][%d%%] [%lf",str,&act,&realAct);
printf("%d%% %.1lfdB\n[",act,realAct);
//printf("%d%%d\n[",int(100*act/log(lightMax)+0.5),realAct);
for(double i=0;i<100;i+=5)
printf("%s",act<=i?"−":"+");
printf("]");
fclose(f);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment