removed debug code
This commit is contained in:
parent
98e633e812
commit
62d613a2bc
@ -3,29 +3,20 @@
|
|||||||
import os, sys, string, subprocess
|
import os, sys, string, subprocess
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
cmd = "xrandr --verbose | grep {} -A 5 | grep Brightness | cut -f 2 -d ' '".format(test())
|
cmd = "xrandr --verbose | grep {} -A 5 | grep Brightness | cut -f 2 -d ' '".format(display())
|
||||||
brightness = float(subprocess.getoutput(cmd))
|
brightness = float(subprocess.getoutput(cmd))
|
||||||
|
|
||||||
if sys.argv[1] == "+" and brightness < 1:
|
if sys.argv[1] == "+" and brightness < 1:
|
||||||
brightness += .25
|
brightness += .25
|
||||||
elif sys.argv[1] == "-" and brightness > 0:
|
elif sys.argv[1] == "-" and brightness > 0:
|
||||||
brightness -= .25
|
brightness -= .25
|
||||||
os.system("xrandr --output {} --brightness {}".format(test(), brightness))
|
os.system("xrandr --output {} --brightness {}".format(display(), brightness))
|
||||||
|
|
||||||
def test():
|
|
||||||
cmd = "xdotool getmouselocation --shell | head -n -3 | sed 's/[^0-9]*//g'"
|
|
||||||
cmd = subprocess.getoutput(cmd)
|
|
||||||
mouse = cmd.split()
|
|
||||||
|
|
||||||
if int(mouse[0]) < 2560:
|
|
||||||
return "DP-1"
|
|
||||||
return "DP-2"
|
|
||||||
|
|
||||||
def display():
|
def display():
|
||||||
cmd = "i3-msg -t get_workspaces | jq '.[] | select(.focused==true).name'"
|
cmd = "xdotool getmouselocation --shell | head -n -3 | sed 's/[^0-9]*//g'"
|
||||||
cmd = subprocess.getoutput(cmd).replace("\"", "")
|
cmd = subprocess.getoutput(cmd)
|
||||||
|
|
||||||
if cmd == "8: ":
|
if int(cmd) < 2560:
|
||||||
return "DP-1"
|
return "DP-1"
|
||||||
return "DP-2"
|
return "DP-2"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user