couriersud / msigd

MSI Gaming Device control application
GNU General Public License v2.0
55 stars 19 forks source link

Additional functionality #2

Closed Wehin closed 4 years ago

Wehin commented 4 years ago

additional flags: -v result values with description for human -s silent and result some value for scripting

example:

./msigd -s --osd_language
-> 2

or

 ./msigd -v --contrast
-> Contrast: 50  Min:0 Max:100

Updated 0.4:

#!/bin/sh
#
BR_CURRENT=$(./msigd -f brightness | awk -F' : ' '{print $2}') # Hard way with split
BR_MAX=100
BR_MIN=0

yad --title="Brightness" --window-icon="preferences-desktop-display" \
 --skip-taskbar --fixed --sticky --on-top --undecorated --mouse \
 --borders=5 --width=300 --escape-ok --close-on-unfocus --no-buttons \
 --scale --min-value=$BR_MIN --max-value=$BR_MAX --value=$BR_CURRENT --step=1 --print-partial --hide-value | \
while read BR_NEW
do
if [[ "$BR_CURRENT" != "$BR_NEW" ]]; then
BR_CURRENT=$(./msigd --brightness $BR_NEW) # currently no return
#fix no return, we can't use $(./msigd --brightness $BR_NEW -f brightness | awk -F' : ' '{print $2}') it result previous value
BR_CURRENT=$BR_NEW
fi
done
Wehin commented 4 years ago

flags for key_macro e.g. -m check only key_macro without other stuff, return 1 when pressed -w 100 loop wait press key_macro, check every 100ms, exit loop with result 1 when pressed.

couriersud commented 4 years ago
./msigd  -n -f pip
pip : 0

and

./msigd  --wait macro_key=pressed

should address the issues raised here. @Wehin Ok to close?

Wehin commented 4 years ago

how oneshot set and return current set value?

/msigd --brightness 1001; echo $?
msigd: Unknown value <1001> for option brightness
Try 'msigd --help' for more information.
1

ok, code is 1 with message

./msigd --brightness 100; echo $?
0

code is 0 without message

./msigd --brightness 100 -n -f brightness; echo $?
brightness : 10
0

code is 0 with older settings, broken order ?

couriersud commented 4 years ago

Closing. Order was fixed.