Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UserConfig
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
UserConfig
Commits
fdbde118
Commit
fdbde118
authored
5 years ago
by
JiriKalvoda
Browse files
Options
Downloads
Patches
Plain Diff
VOLUME Add volue view.
parent
1869ad37
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
volume/init.sh
+7
-0
7 additions, 0 deletions
volume/init.sh
volume/volumeGUI.sh
+1
-0
1 addition, 0 deletions
volume/volumeGUI.sh
volume/volumeInfo.c
+22
-0
22 additions, 0 deletions
volume/volumeInfo.c
with
30 additions
and
0 deletions
volume/init.sh
0 → 100755
+
7
−
0
View file @
fdbde118
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
This diff is collapsed.
Click to expand it.
volume/volumeGUI.sh
0 → 100644
+
1
−
0
View file @
fdbde118
notify-send
"ZVUK"
"
`
volumeInfo
`
"
-h
string:x-canonical-private-synchronous:anything
This diff is collapsed.
Click to expand it.
volume/volumeInfo.c
0 → 100644
+
22
−
0
View file @
fdbde118
#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
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment