camping summer
This commit is contained in:
@@ -5,11 +5,13 @@
|
|||||||
|
|
||||||
BATTERY=/sys/class/power_supply/BAT0
|
BATTERY=/sys/class/power_supply/BAT0
|
||||||
|
|
||||||
REM=`grep "POWER_SUPPLY_CHARGE_NOW" $BATTERY/uevent | awk -F= '{ print $2 }'`
|
# REM=`grep "POWER_SUPPLY_CHARGE_NOW" $BATTERY/uevent | awk -F= '{ print $2 }'`
|
||||||
FULL=`grep "POWER_SUPPLY_CHARGE_FULL_DESIGN" $BATTERY/uevent | awk -F= '{ print $2 }'`
|
# FULL=`grep "POWER_SUPPLY_CHARGE_FULL_DESIGN" $BATTERY/uevent | awk -F= '{ print $2 }'`
|
||||||
|
REM=`grep -i "charge_now" $BATTERY/uevent | awk -F= '{ print $2 }'`
|
||||||
|
FULL=`grep -i "charge_full_design" $BATTERY/uevent | awk -F= '{ print $2 }'`
|
||||||
PERCENT=`echo $(( $REM * 100 / $FULL ))`
|
PERCENT=`echo $(( $REM * 100 / $FULL ))`
|
||||||
|
|
||||||
if [ $PERCENT -le "33" ]; then
|
if [ $PERCENT -le "11" ]; then
|
||||||
#/usr/bin/i3-nagbar -m "Low battery"
|
#/usr/bin/i3-nagbar -m "Low battery"
|
||||||
#echo 'low battery '$PERCENT
|
#echo 'low battery '$PERCENT
|
||||||
notify-send --urgency=critical "Low battery $PERCENT%"
|
notify-send --urgency=critical "Low battery $PERCENT%"
|
||||||
|
|||||||
1
sbib
1
sbib
@@ -22,6 +22,7 @@ if [ "$1" == "-h" ] ; then
|
|||||||
zathura (or other fast pdf viewer)
|
zathura (or other fast pdf viewer)
|
||||||
echo
|
echo
|
||||||
wl-copy
|
wl-copy
|
||||||
|
jq
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
Set the required default file locations (csl file, bib file)
|
Set the required default file locations (csl file, bib file)
|
||||||
|
|||||||
12
sdoi.sh
12
sdoi.sh
@@ -8,7 +8,7 @@ if [ "$1" == "-h" ] ; then
|
|||||||
sdoi.sh 'doi' download.pdf
|
sdoi.sh 'doi' download.pdf
|
||||||
|
|
||||||
depends:
|
depends:
|
||||||
xsltproc - xml processor, from GNOME project
|
xsltproc, xmllint - xml processing programs from libxml
|
||||||
pubmed2bibtex.xsl - xml processor stylesheet
|
pubmed2bibtex.xsl - xml processor stylesheet
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -57,14 +57,13 @@ fetchBib_doiDotOrg() {
|
|||||||
extract_name() {
|
extract_name() {
|
||||||
#extract some strings to make a nice filename for the pdf
|
#extract some strings to make a nice filename for the pdf
|
||||||
key="LastName";
|
key="LastName";
|
||||||
author=$(grep $key --max-count=1 $tmpBib.xml | sed -E "s|\W*<$key>(.+)</$key>\W*|\1|" | tr -d " ")
|
author=$(xmllint --xpath "string(//$key)" $tmpBib.xml)
|
||||||
|
|
||||||
key="MedlineTA";
|
key="MedlineTA";
|
||||||
journal=$(grep $key --max-count=1 $tmpBib.xml | sed -E "s|\W*<$key>(.+)</$key>\W*|\1|" | tr -d " ")
|
journal=$(xmllint --xpath "string(//$key)" $tmpBib.xml)
|
||||||
|
|
||||||
key1="PubDate";
|
|
||||||
key2="Year"; year=$(awk "/<$key1>/,/<\/$key1>/" $tmpBib.xml | grep $key2 | sed -E "s|\W*<$key2>(.+)</$key2>\W*|\1|")
|
|
||||||
|
|
||||||
|
key="Year";
|
||||||
|
year=$(xmllint --xpath "string(//$key)" $tmpBib.xml)
|
||||||
}
|
}
|
||||||
|
|
||||||
append_bibfile() {
|
append_bibfile() {
|
||||||
@@ -81,6 +80,7 @@ append_bibfile() {
|
|||||||
|
|
||||||
append_pdf() {
|
append_pdf() {
|
||||||
fn2=${author}_${journal}$year-$uid.pdf
|
fn2=${author}_${journal}$year-$uid.pdf
|
||||||
|
echo $fn2
|
||||||
#move pdf file to papers repository, add file name to bibtex url field
|
#move pdf file to papers repository, add file name to bibtex url field
|
||||||
mv $fn $pdfPathOut/$fn2
|
mv $fn $pdfPathOut/$fn2
|
||||||
echo "moved to $pdfPathOut/$fn2"
|
echo "moved to $pdfPathOut/$fn2"
|
||||||
|
|||||||
14
spdf.sh
14
spdf.sh
@@ -8,7 +8,7 @@ if [ "$1" == "-h" ] ; then
|
|||||||
|
|
||||||
depends:
|
depends:
|
||||||
pdftotext - from ghostscript or poppler or texlive ?
|
pdftotext - from ghostscript or poppler or texlive ?
|
||||||
xsltproc - xml processor, from GNOME project
|
xsltproc, xmllint - xml programs from libxml
|
||||||
pubmed2bibtex.xsl - xml processor stylesheet
|
pubmed2bibtex.xsl - xml processor stylesheet
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -26,26 +26,14 @@ fn=$1
|
|||||||
|
|
||||||
#try to extract doi from pdf and retrieve a pubmed id
|
#try to extract doi from pdf and retrieve a pubmed id
|
||||||
#for 'DOI:' syntax
|
#for 'DOI:' syntax
|
||||||
# doi=$(pdftotext -q -f 1 -l 1 $fn - | grep -i "doi:" --max-count=1 | tr [:upper:] [:lower:] | sed -E "s|doi:(.+)|\1|")
|
|
||||||
|
|
||||||
# search for doi string between first page last page 10
|
# search for doi string between first page last page 10
|
||||||
doi=$(pdftotext -q -f 1 -l 10 $fn - | grep -iE "doi:? ?/?10\." --max-count=1 | tr [:upper:] [:lower:] | sed -E "s|.*doi:? ?/?(10.+)|\1|")
|
doi=$(pdftotext -q -f 1 -l 10 $fn - | grep -iE "doi:? ?/?10\." --max-count=1 | tr [:upper:] [:lower:] | sed -E "s|.*doi:? ?/?(10.+)|\1|")
|
||||||
|
|
||||||
|
|
||||||
#for 'https://doi.org' syntax
|
#for 'https://doi.org' syntax
|
||||||
if [ -z "$doi" ]; then
|
if [ -z "$doi" ]; then
|
||||||
doi=$(pdftotext -q -f 1 -l 1 $fn - | grep -iE "doi\.org/10\." --max-count=1 | tr [:upper:] [:lower:] | sed -E "s|.+doi\.org/(10.+)|\1|")
|
doi=$(pdftotext -q -f 1 -l 1 $fn - | grep -iE "doi\.org/10\." --max-count=1 | tr [:upper:] [:lower:] | sed -E "s|.+doi\.org/(10.+)|\1|")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# for 'https://doi.org' syntax
|
|
||||||
# if [ -z "$doi" ]; then
|
|
||||||
# doi=$(pdftotext -q -f 1 -l 1 $fn - | grep -i "doi.org/" --max-count=1 | tr [:upper:] [:lower:] | sed -E "s|.+doi\.org\/(.+)|\1|")
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# if [ -z "$doi" ]; then
|
|
||||||
# doi=$(pdftotext -q -f 1 -l 1 $fn - | grep -iE "doi ?" --max-count=1 | tr [:upper:] [:lower:] | sed -E "s|doi ?(.+)|\1|")
|
|
||||||
# fi
|
|
||||||
|
|
||||||
if [ -z "$doi" ]; then
|
if [ -z "$doi" ]; then
|
||||||
echo "doi not found"
|
echo "doi not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
12
spmid.sh
12
spmid.sh
@@ -6,9 +6,6 @@ if [ "$1" == "-h" ] ; then
|
|||||||
spmid.sh '12345678'
|
spmid.sh '12345678'
|
||||||
spmid.sh '12345678' download.pdf
|
spmid.sh '12345678' download.pdf
|
||||||
|
|
||||||
depends:
|
|
||||||
sdoi.sh
|
|
||||||
|
|
||||||
"
|
"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -55,14 +52,13 @@ fetchBib_doiDotOrg() {
|
|||||||
extract_name() {
|
extract_name() {
|
||||||
#extract some strings to make a nice filename for the pdf
|
#extract some strings to make a nice filename for the pdf
|
||||||
key="LastName";
|
key="LastName";
|
||||||
author=$(grep $key --max-count=1 $tmpBib.xml | sed -E "s|\W*<$key>(.+)</$key>\W*|\1|" | tr -d " ")
|
author=$(xmllint --xpath "string(//$key)" $tmpBib.xml)
|
||||||
|
|
||||||
key="MedlineTA";
|
key="MedlineTA";
|
||||||
journal=$(grep $key --max-count=1 $tmpBib.xml | sed -E "s|\W*<$key>(.+)</$key>\W*|\1|" | tr -d " ")
|
journal=$(xmllint --xpath "string(//$key)" $tmpBib.xml)
|
||||||
|
|
||||||
key1="PubDate";
|
|
||||||
key2="Year"; year=$(awk "/<$key1>/,/<\/$key1>/" $tmpBib.xml | grep $key2 | sed -E "s|\W*<$key2>(.+)</$key2>\W*|\1|")
|
|
||||||
|
|
||||||
|
key="Year";
|
||||||
|
year=$(xmllint --xpath "string(//$key)" $tmpBib.xml)
|
||||||
}
|
}
|
||||||
|
|
||||||
append_bibfile() {
|
append_bibfile() {
|
||||||
|
|||||||
@@ -6,13 +6,6 @@ if [ "$1" == "-h" ] ; then
|
|||||||
usage:
|
usage:
|
||||||
spubmed.sh 'kaas' 'trends+neurosci' '1995'
|
spubmed.sh 'kaas' 'trends+neurosci' '1995'
|
||||||
spubmed.sh 'rakic' 'j+comp+neurol' '1972'
|
spubmed.sh 'rakic' 'j+comp+neurol' '1972'
|
||||||
|
|
||||||
depends:
|
|
||||||
xsltproc - xml processor, from GNOME project
|
|
||||||
pubmed2bibtex.xsl - xml processor stylesheet
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
Set the three required default file locations (xsl file, bib file, pdf directory)
|
|
||||||
|
|
||||||
"
|
"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user