merge
This commit is contained in:
commit
60ee7b0866
13
gputemp.py
13
gputemp.py
|
@ -2,6 +2,7 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import logging
|
import logging
|
||||||
|
import subprocess
|
||||||
from subprocess import check_output
|
from subprocess import check_output
|
||||||
|
|
||||||
FORMAT = "%(asctime)s %(levelname)s %(message)s"
|
FORMAT = "%(asctime)s %(levelname)s %(message)s"
|
||||||
|
@ -14,13 +15,17 @@ aticonfig_available = is_exe("/usr/bin/aticonfig")
|
||||||
sensors_available = is_exe("/usr/bin/sensors")
|
sensors_available = is_exe("/usr/bin/sensors")
|
||||||
|
|
||||||
if sensors_available:
|
if sensors_available:
|
||||||
commands = ["sensors radeon-pci-* | grep temp1", "sensors thinkpad-isa-* | grep ATI"]
|
commands = ["sensors radeon-pci-* | grep temp1", "sensors thinkpad-isa-0000 | grep ATI"]
|
||||||
|
|
||||||
for try_command in commands:
|
for try_command in commands:
|
||||||
command = try_command
|
command = try_command
|
||||||
return_command = check_output(command, shell=True)
|
try:
|
||||||
if return_command is not None:
|
return_command = check_output(command, stderr=subprocess.STDOUT, shell=True)
|
||||||
break
|
if return_command is not None:
|
||||||
|
break
|
||||||
|
except subprocess.CalledProcessError as commandexc:
|
||||||
|
continue
|
||||||
|
|
||||||
if aticonfig_available:
|
if aticonfig_available:
|
||||||
command = "aticonfig --odgt"
|
command = "aticonfig --odgt"
|
||||||
|
|
||||||
|
|
15
lastpass.sh
15
lastpass.sh
|
@ -1,3 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
lpass ls | grep $1 | awk '{ if (match($0,/\[id: (.*)?\]/,m)) print m[1] }' | xargs lpass show
|
|
||||||
# --color=always --format="%ai %au %ap" # buggy lpass shit
|
# First check if lastpass is correctly initialized
|
||||||
|
if lpass ls 1>/dev/null 2>&1; then
|
||||||
|
# success
|
||||||
|
lpass ls | grep $1 | awk '{ if (match($0,/\[id: (.*)?\]/,m)) print m[1] }' | xargs lpass show
|
||||||
|
# --color=always --format="%ai %au %ap" # unable to use because lpass is buggy with the formatting
|
||||||
|
else
|
||||||
|
# failure
|
||||||
|
echo -n "Enter login name: "
|
||||||
|
read loginname
|
||||||
|
lpass login $loginname
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user