From aed683d1d5066a1ecfa529973bb887b08dfcb893 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Wed, 21 Dec 2022 11:12:32 +0100 Subject: [PATCH 01/16] bib2html.py: Add isbn and note fields --- bib2html.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bib2html.py b/bib2html.py index 72a5771..5db0d07 100755 --- a/bib2html.py +++ b/bib2html.py @@ -65,8 +65,9 @@ def format_details_article(entry): format_field(entry, 'number', pre='(', post=')')) line.append(format_field(entry, 'month', post=' ') + \ format_field(entry, 'year')) - line = filter(lambda l: l != "", line) + line.append(format_field(entry, 'note')) + line = filter(lambda l: l != "", line) return [where, ", ".join(line)] def format_details_inproceedings(entry): @@ -77,6 +78,9 @@ def format_details_inproceedings(entry): line.append(format_field(entry, 'address')) line.append(format_field(entry, 'month', post=' ') + \ format_field(entry, 'year')) + line.append(format_field(entry, 'isbn', pre='ISBN ')) + line.append(format_field(entry, 'note')) + line = filter(lambda l: l != "", line) return [where, ", ".join(line)] @@ -85,6 +89,8 @@ def format_details_thesis(entry): line.append(format_field(entry, 'school')) line.append(format_field(entry, 'month', post=' ') + \ format_field(entry, 'year')) + line.append(format_field(entry, 'note')) + line = filter(lambda l: l != "", line) return [", ".join(line)] @@ -94,6 +100,8 @@ def format_details_book(entry): line.append(format_field(entry, 'isbn', pre='ISBN ')) line.append(format_field(entry, 'month', post=' ') + \ format_field(entry, 'year')) + line.append(format_field(entry, 'note')) + line = filter(lambda l: l != "", line) return [", ".join(line)] -- 2.30.2 From e5a6e77d71096cff4b5d1f4b39b76154842af40f Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 27 Dec 2022 11:29:41 +0100 Subject: [PATCH 02/16] conky: Update and more files --- dotfiles/conky/batteryinfo.sh | 59 +++++++++ dotfiles/conky/conkyrc-euklid | 170 ++++++++++++++------------ dotfiles/conky/dmesg.conkyrc | 37 ++++++ dotfiles/conky/eth0info.sh | 16 +++ dotfiles/conky/hddbar.sh | 3 + dotfiles/conky/hddinfo.sh | 3 + dotfiles/conky/journald.conkyrc | 37 ++++++ dotfiles/conky/showmails.sh | 7 ++ dotfiles/conky/showmounts.sh | 6 +- dotfiles/conky/sysmon-awesome.conkyrc | 106 ++++++++++++++++ dotfiles/conky/tempinfo.sh | 54 ++++++++ dotfiles/conky/todo.conkyrc | 43 +++++++ 12 files changed, 458 insertions(+), 83 deletions(-) create mode 100755 dotfiles/conky/batteryinfo.sh create mode 100644 dotfiles/conky/dmesg.conkyrc create mode 100755 dotfiles/conky/eth0info.sh create mode 100755 dotfiles/conky/hddbar.sh create mode 100755 dotfiles/conky/hddinfo.sh create mode 100644 dotfiles/conky/journald.conkyrc create mode 100755 dotfiles/conky/showmails.sh create mode 100644 dotfiles/conky/sysmon-awesome.conkyrc create mode 100755 dotfiles/conky/tempinfo.sh create mode 100644 dotfiles/conky/todo.conkyrc diff --git a/dotfiles/conky/batteryinfo.sh b/dotfiles/conky/batteryinfo.sh new file mode 100755 index 0000000..6dcc3a6 --- /dev/null +++ b/dotfiles/conky/batteryinfo.sh @@ -0,0 +1,59 @@ +#!/bin/dash +# +# Stefan Huber +# Display battery info for conky + + + +if [ -e /sys/devices/platform/smapi/ ] +then + for b in `find /sys/devices/platform/smapi/ -type d -name BAT?` + do + if [ `cat $b/installed` = "1" ] + then + name=${b##*/} + remcap=`cat $b/remaining_capacity` + remcapper=`cat $b/remaining_percent` + ratenow=`cat $b/power_now` + rateavg=`cat $b/power_avg` + remtime=`cat $b/remaining_running_time` + tempmilli=`cat $b/temperature` + temp=`echo "$tempmilli/1000" | bc` + + if [ "$remtime" = "not_discharging" ]; then + remtime=`cat $b/remaining_charging_time` + fi + if [ "$remtime" = "not_charging" ]; then + remtime="--" + fi + + echo "$name rate: $ratenow mW [~ $rateavg mW]" + echo "rem: $remcap mWh [$remcapper%, $remtime min]" + #echo "$name temp: $temp°C" + fi + done +else + for b in `find /proc/acpi/battery/ -type d -name BAT?` + do + if [ `grep -c -E "^present: *yes" $b/state` = "1" ] + then + name=${b##*/} + fullcap=`grep "last full capacity" $b/info | awk ' { print $4 } '` + remcap=`grep "remaining capacity" $b/state | awk ' { print $3 } '` + rate=`grep "present rate" $b/state | awk ' { print $3 } '` + + if [ $rate = "0" ]; then + remtime="--" + else + remtime=`echo "$remcap*60/$rate" | bc` + fi + + remcapper=`echo "$remcap*100/$fullcap" | bc ` + + echo "$name rate: $rate mW" + echo "$name rem.: $remcap mWh [$remcapper%, $remtime min]" + fi + done +fi + + diff --git a/dotfiles/conky/conkyrc-euklid b/dotfiles/conky/conkyrc-euklid index 9b36acb..a8da076 100644 --- a/dotfiles/conky/conkyrc-euklid +++ b/dotfiles/conky/conkyrc-euklid @@ -1,95 +1,103 @@ -alignment top_left -gap_x 0 -gap_y 35 -maximum_width 200 -#minimum_size 200 - -update_interval 2 -cpu_avg_samples 2 -net_avg_samples 2 - -# for the green bg -#default_color 563 -#color0 221 -#color1 894 -# for the blue bg -default_color bbb -color0 fff -color1 b94 -draw_shades no -use_spacer left -top_name_width 13 -default_bar_size 85 5 - -if_up_strictness address -short_units yes -no_buffers yes - -double_buffer yes -own_window yes -own_window_transparent yes -own_window_type normal -own_window_hints sticky, below, undecorated, skip_taskbar, skip_pager -own_window_colour 082140 - -use_xft yes -xftfont DejaVu Sans Mono:size=7.5 -#xftalpha 0.8 - - - -# Usr ${execi 6 who | cut -d " " -f 1 - | sort -u | wc -l} - - -TEXT -${color0}${font Arial:size=12}Gentoo Linux$font $alignr${kernel}$color -$alignr$acpitemp°C -$color${font DejaVu Sans Mono:bold:size=8}${cpu cpu1}% ${cpu cpu2}% ${cpu cpu3}% ${cpu cpu4}%$alignr$mem ($memperc%)$font -${cpugraph cpu1 20,32} ${cpugraph cpu2 20,32} ${cpugraph cpu3 20,32} ${cpugraph cpu4 20,32} $alignr${color1}${memgraph 20,32}$color - -${color0}${font DejaVu Sans:size=10}eth0: $font${if_up eth0}${addr eth0}$endif ${execi 2 ~/.conky/eth0info.sh} ${hr 3}$color ${if_up eth0} +-- vim: ts=4 sw=4 noet ai cindent syntax=lua + +conky.config = { + alignment = 'top_left', + gap_x = 10, + gap_y = 50, + maximum_width = 340, + + update_interval = 2, + cpu_avg_samples = 2, + net_avg_samples = 2, + + default_color = '444', + color0 = '000', + color1 = '222', + + draw_shades = false, + use_spacer = 'left', + top_name_width = 13, + + if_up_strictness = 'address', + short_units = true, + no_buffers = true, + + double_buffer = true, + own_window = true, + own_window_class = 'Conky', + own_window_type = 'dock', + own_window_hints = 'below,undecorated,below,skip_taskbar,sticky,skip_pager', + own_window_transparent = true, + + use_xft = true, + font = 'Hack:size=8.5', +}; + +conky.text = [[ +${color0}${font Arial:size=14}Gentoo Linux$font $alignr${kernel}$color +$time$alignr$acpitemp°C +$color${cpu cpu1}% ${cpu cpu2}% ${cpu cpu3}% ${cpu cpu4}%$alignr$mem ($memperc%)$font +${cpugraph cpu1 32,40} ${cpugraph cpu2 32,40} ${cpugraph cpu3 32,40} ${cpugraph cpu4 32,40} $alignr${color1}${memgraph 32,40}$color + +${color0}${font DejaVu Sans:size=12}eth0: $font${if_up eth0}${addr eth0}$endif ${execi 2 ~/.conky/eth0info.sh} ${hr 3}$color ${if_up eth0} ${downspeed eth0} ${upspeed eth0} $alignr${color1}Sum$color ${totaldown eth0} ${totalup eth0} -${downspeedgraph eth0 20,90} $alignr${upspeedgraph eth0 20,90} $endif +${downspeedgraph eth0 32,125} $alignr${upspeedgraph eth0 32,125}$endif -${if_up wlan0}${color0}${font DejaVu Sans:size=10}wlan0: $font${addr wlan0} ${hr 3}$color +${if_up wlan0}${color0}${font DejaVu Sans:size=12}wlan0: $font${addr wlan0} ${hr 3}$color $color${wireless_essid wlan0} $alignr${wireless_link_qual_perc wlan0}% ${wireless_bitrate wlan0} ${downspeed wlan0} ${upspeed wlan0} $alignr${color1}Sum$color ${totaldown wlan0} ${totalup wlan0} -${downspeedgraph wlan0 20,90} $alignr${upspeedgraph wlan0 20,90} +${downspeedgraph wlan0 32,125} $alignr${upspeedgraph wlan0 32,125}\ $endif\ -${if_up tun0}${color0}${font DejaVu Sans:size=10}tun0: $font${addr tun0} ${hr 3}$color +${if_up bnep0}${color0}${font DejaVu Sans:size=12}bnep0: $font${addr bnep0} ${hr 3}$color +${downspeed bnep0} ${upspeed bnep0} $alignr${color1}Sum$color ${totaldown bnep0} ${totalup bnep0} +${downspeedgraph bnep0 32,125} $alignr${upspeedgraph bnep0 32,125} + +$endif\ +${if_up wg0}${color0}${font DejaVu Sans:size=12}wg0: $font${addr wg0} ${hr 3}$color +${downspeed wg0} ${upspeed wg0} $alignr${color1}Sum$color ${totaldown wg0} ${totalup wg0} +${downspeedgraph wg0 32,125} $alignr${upspeedgraph wg0 32,125}\ + +$endif\ +${if_up tun0}${color0}${font DejaVu Sans:size=12}tun0: $font${addr tun0} ${hr 3}$color ${downspeed tun0} ${upspeed tun0} $alignr${color1}Sum$color ${totaldown tun0} ${totalup tun0} -${downspeedgraph tun0 20,90} $alignr${upspeedgraph tun0 20,90}\ +${downspeedgraph tun0 32,125} $alignr${upspeedgraph tun0 32,125}\ $endif\ -${if_up dns0}${color0}${font DejaVu Sans:size=10}dns0: $font${addr dns0} ${hr 3}$color -${downspeed dns0} ${upspeed dns0} $alignr${color1}Sum$color ${totaldown dns0} ${totalup dns0} -${downspeedgraph dns0 20,90} $alignr${upspeedgraph dns0 20,90} +${if_up tun1}${color0}${font DejaVu Sans:size=12}tun1: $font${addr tun1} ${hr 3}$color +${downspeed tun1} ${upspeed tun1} $alignr${color1}Sum$color ${totaldown tun1} ${totalup tun1} +${downspeedgraph tun1 32,125} $alignr${upspeedgraph tun1 32,125}\ $endif\ -${color0}${font DejaVu Sans:size=10}FS & Disc ${hr 3}$font$color -${color1}ssd $color${fs_used /} / ${fs_size /} $alignr${fs_bar /} -${if_mounted /media/storage}${color1}hdd $color${execi 60 ~/.conky/hddinfo.sh} $alignr${execibar 60 ~/.conky/hddbar.sh} +${if_up dns0}${color0}${font DejaVu Sans:size=12}dns0: $font${addr dns0} ${hr 3}$color +${downspeed dns0} ${upspeed dns0} $alignr${color1}Sum$color ${totaldown dns0} ${totalup dns0} +${downspeedgraph dns0 32,125} $alignr${upspeedgraph dns0 32,125} + $endif\ -${color1}all $color${diskio_read} ${diskio_write} $alignr${color1}sdb $color${diskio_read sdb} ${diskio_write sdb} -${diskiograph_read 20,42} ${diskiograph_write 20,42} $alignr${diskiograph_read sdb 20,42} ${diskiograph_write sdb 20,42} +${color0}${font DejaVu Sans:size=12}FS & Disc ${hr 3}$font$color +${color1}ssd $color${fs_used /} / ${fs_size /} $alignr${fs_bar 10,100 /} ${execi 5 ~/.conky/showmounts.sh}\ -${color0}${font DejaVu Sans:size=10}Top$font [$uptime_short, $processes] ${hr 3}$color -${top name 1} ${top pid 1}${top cpu 1} ${top mem_res 1} -${top name 2} ${top pid 2}${top cpu 2} ${top mem_res 2} -${top name 3} ${top pid 3}${top cpu 3} ${top mem_res 3} -${top name 4} ${top pid 4}${top cpu 4} ${top mem_res 4} -${color1}By Mem$color -${top_mem name 1} ${top_mem pid 1}${top_mem cpu 1} ${top_mem mem_res 1} -${top_mem name 2} ${top_mem pid 2}${top_mem cpu 2} ${top_mem mem_res 2} -${top_mem name 3} ${top_mem pid 3}${top_mem cpu 3} ${top_mem mem_res 3} -${color1}By IO rd wr$color -${top_io name 1} ${top_io pid 1} ${top_io io_read 1} ${top_io io_write 1} -${top_io name 2} ${top_io pid 2} ${top_io io_read 2} ${top_io io_write 2} -${top_io name 3} ${top_io pid 3} ${top_io io_read 3} ${top_io io_write 3} - -${color0}${font DejaVu Sans:size=10}Battery ${hr 3}$font$color -$color${smapi bat 0 remaining_capacity} mWh (${smapi_bat_perc 0}%) $alignr${smapi_bat_bar 0} - ${smapi bat 0 power_now} mW [${smapi bat 0 power_avg}, ${smapi bat 0 remaining_running_time} min] -#${color1}${execi 6 ~/.conky/tempinfo.sh}$color +${color1}all $color${diskio_read} ${diskio_write} $alignr${color1}sda $color${diskio_read sda} ${diskio_write sda} +${diskiograph_read 32,55} ${diskiograph_write 32,55} $alignr${diskiograph_read sda 32,55} ${diskiograph_write sda 32,55} + +${color0}${font DejaVu Sans:size=12}Top$font [$uptime_short, $processes] ${hr 3}$color + ${top name 1} ${top pid 1}${top cpu 1} ${top mem_res 1} + ${top name 2} ${top pid 2}${top cpu 2} ${top mem_res 2} + ${top name 3} ${top pid 3}${top cpu 3} ${top mem_res 3} + ${top name 4} ${top pid 4}${top cpu 4} ${top mem_res 4} +${color1}Mem:$color + ${top_mem name 1} ${top_mem pid 1}${top_mem cpu 1} ${top_mem mem_res 1} + ${top_mem name 2} ${top_mem pid 2}${top_mem cpu 2} ${top_mem mem_res 2} + ${top_mem name 3} ${top_mem pid 3}${top_mem cpu 3} ${top_mem mem_res 3} +${color1}IO: rd wr$color + ${top_io name 1} ${top_io pid 1} ${top_io io_read 1} ${top_io io_write 1} + ${top_io name 2} ${top_io pid 2} ${top_io io_read 2} ${top_io io_write 2} + ${top_io name 3} ${top_io pid 3} ${top_io io_read 3} ${top_io io_write 3} + +${execi 10 ~/.conky/showmails.sh} +${color0}${font DejaVu Sans:size=12}Battery ${hr 3}$font$color +${execi 3 upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-rate: | awk '{ printf "%4.1f %s", $2, $3}'} | ${execi 600 upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-full: | sed 's/^.*: *\(.*\)$/\1/g'}$alignr${battery_percent BAT0}% ${battery_bar 10,100 BAT0} +${execi 3 upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep energy-rate: | awk '{ printf "%4.1f %s", $2, $3}'} | ${execi 600 upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep energy-full: | sed 's/^.*: *\(.*\)$/\1/g'}$alignr${battery_percent BAT1}% ${battery_bar 10,100 BAT1} +${execi 5 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep 'time to empty:' | awk '{ print $4 " " $5}'}${execi 5 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep 'time to full:' | awk '{ print $4 " " $5}'}$alignr${execi 5 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep percentage: | awk '{ printf "%4.1f", $2}'}% ${execibar 10 10,100 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep percentage: | awk '{ print $2}'} +]]; diff --git a/dotfiles/conky/dmesg.conkyrc b/dotfiles/conky/dmesg.conkyrc new file mode 100644 index 0000000..5e48e97 --- /dev/null +++ b/dotfiles/conky/dmesg.conkyrc @@ -0,0 +1,37 @@ +-- vim: ts=4 sw=4 noet ai cindent syntax=lua + +conky.config = { + alignment = 'bottom_left', + gap_y = 0, + maximum_width = 1600, + + update_interval = 2, + cpu_avg_samples = 2, + net_avg_samples = 2, + + default_color = '444', + color0 = '000', + color1 = '222', + + draw_shades = false, + use_spacer = 'left', + top_name_width = 13, + + if_up_strictness = 'address', + short_units = true, + no_buffers = true, + + double_buffer = true, + own_window = true, + own_window_class = 'Conky', + own_window_type = 'dock', + own_window_hints = 'below,undecorated,below,skip_taskbar,sticky,skip_pager', + own_window_transparent = true, + + use_xft = true, + font = 'Hack:size=8.5', +}; + +conky.text = [[ +${color1}${execi 2 tail -n 14 /tmp/messages}$color +]] diff --git a/dotfiles/conky/eth0info.sh b/dotfiles/conky/eth0info.sh new file mode 100755 index 0000000..1d2db9b --- /dev/null +++ b/dotfiles/conky/eth0info.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if ip link show dev eth0 | grep -q UP ; then + operstate=$(cat /sys/class/net/eth0/operstate | tr -d '\n') + echo -n "[" + if [ "${operstate}" = "up" ]; then + #duplex=$(cat /sys/class/net/eth0/duplex | tr -d '\n') + speed=$(cat /sys/class/net/eth0/speed | tr -d '\n') + echo -n "${speed} Mbit" + else + echo -n "${operstate}" + fi + echo -n "]" +else + echo -n "[power down]" +fi diff --git a/dotfiles/conky/hddbar.sh b/dotfiles/conky/hddbar.sh new file mode 100755 index 0000000..1bcc391 --- /dev/null +++ b/dotfiles/conky/hddbar.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +df -h | grep /media/storage | awk ' { print $5 } ' diff --git a/dotfiles/conky/hddinfo.sh b/dotfiles/conky/hddinfo.sh new file mode 100755 index 0000000..de6198b --- /dev/null +++ b/dotfiles/conky/hddinfo.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +df -h | grep -m 1 /media/storage | awk ' { print $3 " / " $2 } ' diff --git a/dotfiles/conky/journald.conkyrc b/dotfiles/conky/journald.conkyrc new file mode 100644 index 0000000..5b6d01d --- /dev/null +++ b/dotfiles/conky/journald.conkyrc @@ -0,0 +1,37 @@ +-- vim: ts=4 sw=4 noet ai cindent syntax=lua + +conky.config = { + alignment = 'bottom_left', + gap_y = 0, + maximum_width = 1600, + + update_interval = 2, + cpu_avg_samples = 2, + net_avg_samples = 2, + + default_color = '444', + color0 = '000', + color1 = '222', + + draw_shades = false, + use_spacer = 'left', + top_name_width = 13, + + if_up_strictness = 'address', + short_units = true, + no_buffers = true, + + double_buffer = true, + own_window = true, + own_window_class = 'Conky', + own_window_type = 'dock', + own_window_hints = 'below,undecorated,below,skip_taskbar,sticky,skip_pager', + own_window_transparent = true, + + use_xft = true, + font = 'Hack:size=8.5', +}; + +conky.text = [[ +${color1}${execi 2 journalctl -n 14 --no-hostname -q}$color +]] diff --git a/dotfiles/conky/showmails.sh b/dotfiles/conky/showmails.sh new file mode 100755 index 0000000..a530787 --- /dev/null +++ b/dotfiles/conky/showmails.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +for f in `find $HOME/.smailq/data -name "*.eml"`; do + to=`grep To: $f | tail -c +5 | head -c 15` + subj=`grep Subject: $f | tail -c +10` + echo "$to: $subj" +done diff --git a/dotfiles/conky/showmounts.sh b/dotfiles/conky/showmounts.sh index 9365886..ecd3ae5 100755 --- a/dotfiles/conky/showmounts.sh +++ b/dotfiles/conky/showmounts.sh @@ -1,3 +1,5 @@ #!/bin/sh -df -h | grep '/dev/s[rd][c-z0-9]' | awk '{ print $1 "\t" $5 " " $6}' | sed "s_/dev/__" | sort -df -h | grep '/dev/mmc*' | awk '{ print $1 "\t" $5 " " $6}' | sed "s_/dev/__" | sort + +for path in '/dev/s[rd][b-z0-9]' '/dev/mmc' '/dev/mapper/_' '//192' '/media/nas' '/media/fhs' '$HOME/.mount'; do + df -h 2>/dev/null | grep "$path" | awk '{ printf "%-25.25s %4s %4s\n", substr($6, length($6)-24), $4, $5 }' +done diff --git a/dotfiles/conky/sysmon-awesome.conkyrc b/dotfiles/conky/sysmon-awesome.conkyrc new file mode 100644 index 0000000..5edd3ca --- /dev/null +++ b/dotfiles/conky/sysmon-awesome.conkyrc @@ -0,0 +1,106 @@ +-- vim: ts=4 sw=4 noet ai cindent syntax=lua + +conky.config = { + alignment = 'top_left', + gap_x = 10, + gap_y = 50, + maximum_width = 340, + + update_interval = 2, + cpu_avg_samples = 2, + net_avg_samples = 2, + + default_color = 'c0c0c0', + color0 = 'b21818', + color1 = 'ffffff', + + draw_shades = false, + use_spacer = 'left', + top_name_width = 13, + + if_up_strictness = 'address', + short_units = true, + no_buffers = true, + + double_buffer = true, + own_window = true, + --own_window_colour = 'f8ecc7', + own_window_class = 'Conky', + own_window_type = 'desktop', + own_window_hints = 'below,undecorated,below,skip_taskbar,sticky,skip_pager', + --own_window_transparent = true, + own_window_argb_visual = true, + own_window_argb_value = 30, + + use_xft = true, + font = 'Hack:size=8.5', +}; + +conky.text = [[ +${color0}${font Arial:size=14}Gentoo Linux$font $alignr${kernel}$color +$time$alignr$acpitemp°C +$color${cpu cpu1}% ${cpu cpu2}% ${cpu cpu3}% ${cpu cpu4}%$alignr$mem ($memperc%)$font +${cpugraph cpu1 32,40} ${cpugraph cpu2 32,40} ${cpugraph cpu3 32,40} ${cpugraph cpu4 32,40} $alignr${color1}${memgraph 32,40}$color + +${color0}${font DejaVu Sans:size=12}eth0: $font${if_up eth0}${addr eth0}$endif ${execi 2 ~/.conky/eth0info.sh} ${hr 3}$color ${if_up eth0} +${downspeed eth0} ${upspeed eth0} $alignr${color1}Sum$color ${totaldown eth0} ${totalup eth0} +${downspeedgraph eth0 32,125} $alignr${upspeedgraph eth0 32,125}$endif + +${if_up wlan0}${color0}${font DejaVu Sans:size=12}wlan0: $font${addr wlan0} ${hr 3}$color +$color${wireless_essid wlan0} $alignr${wireless_link_qual_perc wlan0}% ${wireless_bitrate wlan0} +${downspeed wlan0} ${upspeed wlan0} $alignr${color1}Sum$color ${totaldown wlan0} ${totalup wlan0} +${downspeedgraph wlan0 32,125} $alignr${upspeedgraph wlan0 32,125}\ + +$endif\ +${if_up bnep0}${color0}${font DejaVu Sans:size=12}bnep0: $font${addr bnep0} ${hr 3}$color +${downspeed bnep0} ${upspeed bnep0} $alignr${color1}Sum$color ${totaldown bnep0} ${totalup bnep0} +${downspeedgraph bnep0 32,125} $alignr${upspeedgraph bnep0 32,125} + +$endif\ +${if_up wg0}${color0}${font DejaVu Sans:size=12}wg0: $font${addr wg0} ${hr 3}$color +${downspeed wg0} ${upspeed wg0} $alignr${color1}Sum$color ${totaldown wg0} ${totalup wg0} +${downspeedgraph wg0 32,125} $alignr${upspeedgraph wg0 32,125}\ + +$endif\ +${if_up tun0}${color0}${font DejaVu Sans:size=12}tun0: $font${addr tun0} ${hr 3}$color +${downspeed tun0} ${upspeed tun0} $alignr${color1}Sum$color ${totaldown tun0} ${totalup tun0} +${downspeedgraph tun0 32,125} $alignr${upspeedgraph tun0 32,125}\ + +$endif\ +${if_up tun1}${color0}${font DejaVu Sans:size=12}tun1: $font${addr tun1} ${hr 3}$color +${downspeed tun1} ${upspeed tun1} $alignr${color1}Sum$color ${totaldown tun1} ${totalup tun1} +${downspeedgraph tun1 32,125} $alignr${upspeedgraph tun1 32,125}\ + +$endif\ +${if_up dns0}${color0}${font DejaVu Sans:size=12}dns0: $font${addr dns0} ${hr 3}$color +${downspeed dns0} ${upspeed dns0} $alignr${color1}Sum$color ${totaldown dns0} ${totalup dns0} +${downspeedgraph dns0 32,125} $alignr${upspeedgraph dns0 32,125} + +$endif\ +${color0}${font DejaVu Sans:size=12}FS & Disc ${hr 3}$font$color +${color1}ssd $color${fs_used /} / ${fs_size /} $alignr${fs_bar 10,100 /} +${execi 5 ~/.conky/showmounts.sh}\ + +${color1}all $color${diskio_read} ${diskio_write} $alignr${color1}sda $color${diskio_read sda} ${diskio_write sda} +${diskiograph_read 32,55} ${diskiograph_write 32,55} $alignr${diskiograph_read sda 32,55} ${diskiograph_write sda 32,55} + +${color0}${font DejaVu Sans:size=12}Top$font [$uptime_short, $processes] ${hr 3}$color + ${top name 1} ${top pid 1}${top cpu 1} ${top mem_res 1} + ${top name 2} ${top pid 2}${top cpu 2} ${top mem_res 2} + ${top name 3} ${top pid 3}${top cpu 3} ${top mem_res 3} + ${top name 4} ${top pid 4}${top cpu 4} ${top mem_res 4} +${color1}Mem:$color + ${top_mem name 1} ${top_mem pid 1}${top_mem cpu 1} ${top_mem mem_res 1} + ${top_mem name 2} ${top_mem pid 2}${top_mem cpu 2} ${top_mem mem_res 2} + ${top_mem name 3} ${top_mem pid 3}${top_mem cpu 3} ${top_mem mem_res 3} +${color1}IO: rd wr$color + ${top_io name 1} ${top_io pid 1} ${top_io io_read 1} ${top_io io_write 1} + ${top_io name 2} ${top_io pid 2} ${top_io io_read 2} ${top_io io_write 2} + ${top_io name 3} ${top_io pid 3} ${top_io io_read 3} ${top_io io_write 3} + +${execi 10 ~/.conky/showmails.sh} +${color0}${font DejaVu Sans:size=12}Battery ${hr 3}$font$color +${execi 3 upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-rate: | awk '{ printf "%4.1f %s", $2, $3}'} | ${execi 600 upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-full: | sed 's/^.*: *\(.*\)$/\1/g'}$alignr${battery_percent BAT0}% ${battery_bar 10,100 BAT0} +${execi 3 upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep energy-rate: | awk '{ printf "%4.1f %s", $2, $3}'} | ${execi 600 upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep energy-full: | sed 's/^.*: *\(.*\)$/\1/g'}$alignr${battery_percent BAT1}% ${battery_bar 10,100 BAT1} +${execi 5 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep 'time to empty:' | awk '{ print $4 " " $5}'}${execi 5 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep 'time to full:' | awk '{ print $4 " " $5}'}$alignr${execi 5 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep percentage: | awk '{ printf "%4.1f", $2}'}% ${execibar 10 10,100 upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep percentage: | awk '{ print $2}'} +]]; diff --git a/dotfiles/conky/tempinfo.sh b/dotfiles/conky/tempinfo.sh new file mode 100755 index 0000000..5c94afb --- /dev/null +++ b/dotfiles/conky/tempinfo.sh @@ -0,0 +1,54 @@ +#!/bin/dash +# +# Stefan Huber +# Displays some temperature info + + +if [ -f /proc/acpi/ibm/thermal ] +then + info=`cat /proc/acpi/ibm/thermal | sed "s/^.*://" ` + + #1 ??, THM0, strongly reacts on heat at the cooling gills. reacts on cpu + #2 DVD: reacts on heat at the dvd drive + #3 express card: 31°C REACTS ON HEAT ON PC-CARD SLOT + #4 agp, gets active when switched to discrete graphics, reacts on load + #5 disappears when bat0 is plugged off --> ~50°C always + #6 thinkwiki thinks this is for bat1 + #7 disappears when bat0 is plugged off --> ~val of bat temp through smapi + #8 thinkwiki thinks this is for bat1 + #9 hdd: 33°C REACTS ON HEAD AT THE HARD DISC AREA + #10 igp, reacts on gtkperf + #11 heatsink? slowly reacts on heat at cooling gill. slowly reacts on cpu + + cpusocket=`echo $info | awk ' { print $1 } '` + dvd=`echo $info | awk ' { print $2 } '` + excard=`echo $info | awk ' { print $3 } '` + atigpu=`echo $info | awk ' { print $4 } '` + hdd=`echo $info | awk ' { print $9 } '` + intelgpu=`echo $info | awk ' { print $10 } '` + heatsink=`echo $info | awk ' { print $11 } '` + + #No equivalent in $info!! Reacts more directly to load than thm0. Due + #to acpi info, this is cpu. + cpu=`cat /sys/devices/virtual/thermal/thermal_zone1/temp | awk ' { print $1/1000 } '` + + echo -n "cpu:$cpu°C cpus:$cpusocket°C" + + if [ $intelgpu != "-1" ]; then + echo -n " igp:$intelgpu°C" + fi + + if [ $atigpu != "-1" ]; then + echo -n " agp:$atigpu°C" + fi + + echo "" + echo "hs:$heatsink°C ec:$excard°C hdd:$hdd°C dvd:$dvd°C" +else + cpu=`cat /sys/devices/virtual/thermal/thermal_zone0/temp | awk ' { print $1/1000 } '` + echo "cpu: $cpu°C" +fi + + + + diff --git a/dotfiles/conky/todo.conkyrc b/dotfiles/conky/todo.conkyrc new file mode 100644 index 0000000..f578e3d --- /dev/null +++ b/dotfiles/conky/todo.conkyrc @@ -0,0 +1,43 @@ +-- vim: ts=4 sw=4 noet ai cindent syntax=lua + +conky.config = { + alignment = 'top_right', + gap_x = 5, + gap_y = 50, + maximum_width = 600, + + update_interval = 2, + cpu_avg_samples = 2, + net_avg_samples = 2, + + default_color = '444', + color0 = '000', + color1 = '222', + + draw_shades = false, + use_spacer = 'left', + top_name_width = 13, + + if_up_strictness = 'address', + short_units = true, + no_buffers = true, + + double_buffer = true, + own_window = true, + own_window_colour = 'f8ecc7', + own_window_class = 'Conky', + own_window_type = 'dock', + own_window_hints = 'below,undecorated,below,skip_taskbar,sticky,skip_pager', + own_window_transparent = false, + + use_xft = true, + font = 'Hack:size=10', +}; + +conky.text = [[ +${color0}${font Arial:size=14}Private$font$color ${hr 3} +${color1}${execi 5 cat ~/.vimwiki/todos.wiki}$color + +${color0}${font Arial:size=14}FHS$font$color ${hr 3} +${color1}${execi 5 cat ~/.vimwiki/FHS/todos.wiki}$color +]] -- 2.30.2 From ba2b41bf0cd3ce4cd33efb2841ec10fd5a3e075a Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 27 Dec 2022 11:30:18 +0100 Subject: [PATCH 03/16] gitconfig: Update --- dotfiles/gitconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dotfiles/gitconfig b/dotfiles/gitconfig index c895618..3ee134e 100644 --- a/dotfiles/gitconfig +++ b/dotfiles/gitconfig @@ -2,6 +2,17 @@ name = Stefan Huber email = me@example.com signingkey = 0123456 +# [sendemail] +# smtpencryption = tls +# smtpserver = xxx +# smtpuser = xxx +# smtppass = xxx +# smtpsslcertpath = /etc/ssl/certs/ca-certificates.crt +# from = xxx +# bcc = xxx +# suppresscc = author +# suppresscc = self +# chainreplyto = true [http] #prxy = http://username:password@192.168.9.10:8080 [color] @@ -25,6 +36,7 @@ wdiff = diff -w --word-diff-regex="[^[:space:]]" wlog = log -w --word-diff-regex="[^[:space:]]" wshow = show -w --word-diff-regex="[^[:space:]]" + fhsprofile = config user.email "xxx@fh-salzburg.ac.at" [log] decorate [diff] @@ -44,3 +56,7 @@ trustExitCode = true [mergetool "nvimdiff"] cmd = "nvim -d \"$LOCAL\" \"$REMOTE\" \"$MERGED\" -c 'wincmd w' -c 'wincmd J'" +[alias] + lab = "!lab" + lab-i = "!lab issue" + li = "!lab issue" -- 2.30.2 From da1c48be65a7d92ff49dc3a01050e586757f14c3 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Mon, 23 Jan 2023 08:38:13 +0100 Subject: [PATCH 04/16] git: Improve output of git-pull-all --- git/git-pull-all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/git-pull-all b/git/git-pull-all index 25252e5..3e709fb 100755 --- a/git/git-pull-all +++ b/git/git-pull-all @@ -93,7 +93,7 @@ for REPODIR in $(find "$@" -name .git -type d 2> /dev/null); do git -C ${REPO} remote update if [ -z "$(git -C ${REPO} status -uno | grep 'Your branch is behind')" ] ; then - echo -e "\e[1;32m Already up to date\e[0m" + echo "\e[1;32m Already up to date\e[0m" else if [ "${optDryRun}" = 1 ]; then echo -e "\e[1;31m Skipping due to dry-run\e[0m" -- 2.30.2 From 71fa4820b859573765bef228365036afeb6ea10e Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Wed, 25 Jan 2023 06:54:46 +0100 Subject: [PATCH 05/16] git: Fix git-pull-all echo again --- git/git-pull-all | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git/git-pull-all b/git/git-pull-all index 3e709fb..d63e73c 100755 --- a/git/git-pull-all +++ b/git/git-pull-all @@ -93,10 +93,10 @@ for REPODIR in $(find "$@" -name .git -type d 2> /dev/null); do git -C ${REPO} remote update if [ -z "$(git -C ${REPO} status -uno | grep 'Your branch is behind')" ] ; then - echo "\e[1;32m Already up to date\e[0m" + /usr/bin/echo -e "\e[1;32m Already up to date\e[0m" else if [ "${optDryRun}" = 1 ]; then - echo -e "\e[1;31m Skipping due to dry-run\e[0m" + /usr/bin/echo -e "\e[1;31m Skipping due to dry-run\e[0m" continue fi git -C ${REPO} pull -- 2.30.2 From 0cc5e4edd3f4fb329c0686b26907f8544e3db371 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sat, 29 Jul 2023 19:51:50 +0200 Subject: [PATCH 06/16] bib2html.py: Add more LaTeX syntax replacement --- bib2html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bib2html.py b/bib2html.py index 5db0d07..f501b85 100755 --- a/bib2html.py +++ b/bib2html.py @@ -37,7 +37,7 @@ import os, sys, getopt, re def format_latex(text): # Get rid of matching dollar signs text = re.sub(r'\$([^\$]*)\$', r'\1', text) - return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '') + return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '').replace('~', ' ').replace('--', '–') def format_field_span(type, value): return "" + format_latex(value) + "" -- 2.30.2 From b19c6ec5b193d142554df1aa43e1827720c84a14 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 1 Aug 2023 09:05:31 +0200 Subject: [PATCH 07/16] bib2html.py: Add [url] to entries --- bib2html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bib2html.py b/bib2html.py index f501b85..dee284e 100755 --- a/bib2html.py +++ b/bib2html.py @@ -109,10 +109,11 @@ def format_links(entry): doi = format_field(entry, 'doi', pre='[DOI]') webpdf = format_field(entry, 'webpdf', pre='[PDF]') weblink = format_field(entry, 'weblink', pre='[link]') + url = format_field(entry, 'url', pre='[url]') webslides = format_field(entry, 'webslides', pre='[slides]') weberrata = format_field(entry, 'weberrata', pre='[errata]') - return " ".join([doi, webpdf, weblink, webslides, weberrata]) + return " ".join([doi, webpdf, weblink, url, webslides, weberrata]) def format_entry(entry): lines = [] -- 2.30.2 From 794b05103d5e742df6b45dd738cc34689c2e93a7 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 1 Aug 2023 09:31:42 +0200 Subject: [PATCH 08/16] bib2html.py: Add umlaut replacement --- bib2html.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/bib2html.py b/bib2html.py index dee284e..5d5b4db 100755 --- a/bib2html.py +++ b/bib2html.py @@ -37,7 +37,25 @@ import os, sys, getopt, re def format_latex(text): # Get rid of matching dollar signs text = re.sub(r'\$([^\$]*)\$', r'\1', text) - return text.replace('\mathcal', '').replace('{', '').replace('}', '').replace('\\', '').replace('~', ' ').replace('--', '–') + + # Replace text + subst = { + '\\"a': 'ä', + '\\"o': 'ö', + '\\"u': 'u', + '\mathcal': '', + '{': '', + '}': '', + '\\': '', + '~': ' ', + '---': '–', + '--': '–', + } + + for a, b in subst.items(): + text = text.replace(a, b) + + return text def format_field_span(type, value): return "" + format_latex(value) + "" -- 2.30.2 From d4d771618824ada5d34f22031e3748de27cd68b5 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 3 Aug 2023 21:15:29 +0200 Subject: [PATCH 09/16] bib2html.py: Make use of date field --- bib2html.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bib2html.py b/bib2html.py index 5d5b4db..a595f42 100755 --- a/bib2html.py +++ b/bib2html.py @@ -32,6 +32,7 @@ __license__ = "MIT" import os, sys, getopt, re +import dateutil.parser def format_latex(text): @@ -159,6 +160,9 @@ def format_entry(entry): def entryDateSortKey(p): k, e = p + if 'date' in e.fields: + return e.fields['date'] + month2num = { 'jan' : '01', 'feb' : '02', 'mar' : '03', \ 'apr' : '04', 'may' : '05', 'jun' : '06', \ 'jul' : '07', 'aug' : '08', 'sep' : '09', \ @@ -176,6 +180,17 @@ def entryDateSortKey(p): return e.fields['year'] + "-" + month +def entryGetYear(e): + if 'year' in e.fields: + return e.fields['year'] + + if 'date' in e.fields: + dt = dateutil.parser.isoparse(e.fields['date']) + return str(dt.year) + + return None + + def usage(): """Print usage text of this program""" @@ -222,7 +237,7 @@ if __name__ == "__main__": bib_data = parser.parse_file(bibfile) entries = bib_data.entries - years = list(set([ b.fields['year'] for b in entries.values() ])) + years = list(set([entryGetYear(e) for e in entries.values()])) years.sort(reverse=True) for year in years: @@ -233,7 +248,7 @@ if __name__ == "__main__": iteritems.sort(key=entryDateSortKey, reverse=True) for key, entry in iteritems: - if entry.fields['year'] != year: + if entryGetYear(entry) != year: continue print("
") -- 2.30.2 From ad936fd7ae65ffc642d2727c7a1e0c9cd8630942 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 3 Aug 2023 21:16:47 +0200 Subject: [PATCH 10/16] bib2html.py: Print entry type --- bib2html.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bib2html.py b/bib2html.py index a595f42..309b6c4 100755 --- a/bib2html.py +++ b/bib2html.py @@ -252,10 +252,8 @@ if __name__ == "__main__": continue print("
") - print("[" + key + "]
") - + print("[{}]
{}
".format(key, key, entry.type)) e = format_entry(entry) print(e) print("
\n") - -- 2.30.2 From 9b52797ddadf989219c0f1677ee4f403a1e31030 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 3 Aug 2023 21:17:05 +0200 Subject: [PATCH 11/16] bib2html.py: Add support for patents --- bib2html.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bib2html.py b/bib2html.py index 309b6c4..b1ba761 100755 --- a/bib2html.py +++ b/bib2html.py @@ -124,6 +124,16 @@ def format_details_book(entry): line = filter(lambda l: l != "", line) return [", ".join(line)] +def format_details_patent(entry): + line = [] + line.append(format_field(entry, 'number', pre='Pat. ')) + line.append(format_field(entry, 'month', post=' ') + \ + format_field(entry, 'year')) + line.append(format_field(entry, 'note')) + + line = filter(lambda l: l != "", line) + return [", ".join(line)] + def format_links(entry): doi = format_field(entry, 'doi', pre='[DOI]') webpdf = format_field(entry, 'webpdf', pre='[PDF]') @@ -145,6 +155,8 @@ def format_entry(entry): lines.extend(format_details_inproceedings(entry)) elif entry.type=='book': lines.extend(format_details_book(entry)) + elif entry.type=='patent': + lines.extend(format_details_patent(entry)) elif entry.type in ['mastersthesis', 'phdthesis']: lines.extend(format_details_thesis(entry)) else: -- 2.30.2 From 336c7c24f3e51c309450450fc2e1304960a14a09 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sun, 17 Dec 2023 10:27:11 +0100 Subject: [PATCH 12/16] X: Add xrandr scripts --- X/xrandr-exttomirror | 19 +++++++++++++++++++ X/xrandr-exttoright | 19 +++++++++++++++++++ X/xrandr-single | 21 +++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100755 X/xrandr-exttomirror create mode 100755 X/xrandr-exttoright create mode 100755 X/xrandr-single diff --git a/X/xrandr-exttomirror b/X/xrandr-exttomirror new file mode 100755 index 0000000..4f1d3ec --- /dev/null +++ b/X/xrandr-exttomirror @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +MAIN=$(xrandr | grep eDP | cut -f1 -d" ") +if [ "${MAIN}" = "" ]; then + echo "Could not find main display." + exit 1 +fi + +OTHER=$(xrandr | grep "\" | grep -v eDP | cut -f1 -d" ") +if [ "${OTHER}" = "" ]; then + echo "Could not find external display." + exit 1 +fi + +echo "Set ${MAIN} as mirror of ${OTHER}" + +xrandr --output ${OTHER} --auto --output ${MAIN} --same-as ${OTHER} --primary diff --git a/X/xrandr-exttoright b/X/xrandr-exttoright new file mode 100755 index 0000000..fca0aa6 --- /dev/null +++ b/X/xrandr-exttoright @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +MAIN=$(xrandr | grep eDP | cut -f1 -d" ") +if [ "${MAIN}" = "" ]; then + echo "Could not find main display." + exit 1 +fi + +OTHER=$(xrandr | grep "\" | grep -v eDP | cut -f1 -d" ") +if [ "${OTHER}" = "" ]; then + echo "Could not find external display." + exit 1 +fi + +echo "Bring ${OTHER} right of ${MAIN}" + +xrandr --output ${MAIN} --auto --primary; xrandr --output ${OTHER} --auto; xrandr --output ${OTHER} --auto --right-of ${MAIN} diff --git a/X/xrandr-single b/X/xrandr-single new file mode 100755 index 0000000..174a0df --- /dev/null +++ b/X/xrandr-single @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +MAIN=$(xrandr | grep eDP | cut -f1 -d" ") +if [ "${MAIN}" = "" ]; then + echo "Could not find main display." + exit 1 +fi + +echo "Set ${MAIN} as primary" +xrandr --output ${MAIN} --auto --primary + +OTHER=$(xrandr | grep "\" | grep -v eDP | cut -f1 -d" ") +if [ "${OTHER}" = "" ]; then + echo "Could not find external display." + exit 1 +fi + +echo "Set ${OTHER} off" +xrandr --output ${OTHER} --off -- 2.30.2 From 11459be7250882eb3328215ec4b200b68dc82077 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sun, 17 Dec 2023 20:25:55 +0100 Subject: [PATCH 13/16] udev: Add xprofile-udevinput-monitor --- udev/input/install.sh | 10 ++++++++++ udev/input/xprofile-udevinput | 7 +++++++ udev/input/xprofile-udevinput-monitor | 10 ++++++++++ udev/input/xprofile-udevinput-monitor.service | 12 ++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 udev/input/install.sh create mode 100755 udev/input/xprofile-udevinput create mode 100755 udev/input/xprofile-udevinput-monitor create mode 100644 udev/input/xprofile-udevinput-monitor.service diff --git a/udev/input/install.sh b/udev/input/install.sh new file mode 100644 index 0000000..59b4c22 --- /dev/null +++ b/udev/input/install.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +cp ./xprofile-udevinput ~/.xprofile-udevinput +echo "You may source ~/.xprofile-udevinput in your ~/.xinitrc or so" + +cp ./xprofile-udevinput-monitor ~/.local/bin/ +cp ./xprofile-udevinput-monitor.service ~/.config/systemd/user/ +systemctl --user daemon-reload + +echo "You may call systemctl --user enable xprofile-udevinput-monitor.service" diff --git a/udev/input/xprofile-udevinput b/udev/input/xprofile-udevinput new file mode 100755 index 0000000..9664326 --- /dev/null +++ b/udev/input/xprofile-udevinput @@ -0,0 +1,7 @@ +#!bin/sh +# Load this script whenever a USB keyboard is attached + +xset r rate 200 60 + +# Barrier needs this on client and server side +setxkbmap -device `xinput list --id-only "Virtual core XTEST keyboard"` de diff --git a/udev/input/xprofile-udevinput-monitor b/udev/input/xprofile-udevinput-monitor new file mode 100755 index 0000000..e48d1ac --- /dev/null +++ b/udev/input/xprofile-udevinput-monitor @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +# For each add-event of input subsystem by udev call ~/.xprofile-keyboard +udevadm monitor -u -s input | grep --line-buffered add | while read line; do + echo ">> $line"; + sh ~/.xprofile-udevinput +done + diff --git a/udev/input/xprofile-udevinput-monitor.service b/udev/input/xprofile-udevinput-monitor.service new file mode 100644 index 0000000..09725fb --- /dev/null +++ b/udev/input/xprofile-udevinput-monitor.service @@ -0,0 +1,12 @@ +[Unit] +Description=xprofile-udevinput-monitor daemon +After=multi-user.target + +[Service] +Environment=DISPLAY=:0 +ExecStart=%h/.local/bin/xprofile-udevinput-monitor +Restart=always +RestartSec=10min + +[Install] +WantedBy=default.target -- 2.30.2 From 9afcdc46f956e1b87f65b5016cd2f7034a1ced36 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sun, 17 Dec 2023 21:08:46 +0100 Subject: [PATCH 14/16] udev: Little update --- udev/input/xprofile-udevinput-monitor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev/input/xprofile-udevinput-monitor b/udev/input/xprofile-udevinput-monitor index e48d1ac..d9204ad 100755 --- a/udev/input/xprofile-udevinput-monitor +++ b/udev/input/xprofile-udevinput-monitor @@ -4,7 +4,7 @@ set -e # For each add-event of input subsystem by udev call ~/.xprofile-keyboard udevadm monitor -u -s input | grep --line-buffered add | while read line; do - echo ">> $line"; + echo ">> $line" sh ~/.xprofile-udevinput done -- 2.30.2 From e7229e669cf3a00180478c57ad60ba07019e670c Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sat, 30 Dec 2023 09:52:31 +0100 Subject: [PATCH 15/16] xsession-daemon: More robust proc detection Test for running process with given PID was instable. Replace with pid-file feature of pgrep. --- xsession-daemon | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/xsession-daemon b/xsession-daemon index f7edb63..247c903 100755 --- a/xsession-daemon +++ b/xsession-daemon @@ -22,33 +22,29 @@ PIDDIR="${PIDFILE%/*}" LOGDIR="${LOGFILE%/*}" mkdir -p $PIDDIR -if [ $? -ne 0 ]; -then +if [ $? -ne 0 ]; then echo "Session daemon PIDDIR not there: $PIDDIR" >&2 exit 2 fi mkdir -p $LOGDIR -if [ $? -ne 0 ]; -then +if [ $? -ne 0 ]; then echo "Session daemon LOGDIR not there: $LOGDIR" >&2 exit 2 fi -if [ -e "$PIDFILE" ] ; -then - echo "Session daemon '$NAME' PIDFILE found: $PIDFILE" - PID=`cat "$PIDFILE"` +if [ -e "$PIDFILE" ] ; then + PID=`cat "$PIDFILE"` echo "Session daemon '$NAME' PID found: $PID" + + if pgrep -F "$PIDFILE" "${NAME}" >/dev/null ; then + echo "Session daemon '$NAME' was already running with PID $PID" >&2 + exit 3 + fi else echo "Session daemon '$NAME' PIDFILE NOT found: $PIDFILE" fi -if [ "$PID" ] && kill -0 "$PID" 2>/dev/null ; -then - echo "Session daemon '$NAME' was already running with PID $PID" >&2 - exit 3 -fi echo "Session daemon running $COMMAND $* > $LOGFILE 2>&1" $COMMAND $* > "$LOGFILE" 2>&1 & @@ -56,8 +52,7 @@ PID=$! ERR=$? sleep 1 -if [ "$PID" ] && [ $ERR == 0 ] && kill -0 "$PID" 2>/dev/null; -then +if [ "$PID" ] && [ $ERR == 0 ] && kill -0 "$PID" 2>/dev/null; then echo -n $PID > "$PIDFILE" echo "Session daemon '$NAME' started with PID $PID" else -- 2.30.2 From f522c7a926a5e7e0b8c7270fda156ba9756be362 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Mon, 26 Feb 2024 14:10:00 +0100 Subject: [PATCH 16/16] bib2html.py: Add incollection bibtype --- bib2html.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bib2html.py b/bib2html.py index b1ba761..7557cce 100755 --- a/bib2html.py +++ b/bib2html.py @@ -103,6 +103,21 @@ def format_details_inproceedings(entry): line = filter(lambda l: l != "", line) return [where, ", ".join(line)] +def format_details_incollection(entry): + where = format_field(entry, 'booktitle') + + line = [] + line.append(format_field(entry, 'publisher')) + line.append(format_field(entry, 'pages', pre='pp. ')) + line.append(format_field(entry, 'address')) + line.append(format_field(entry, 'month', post=' ') + \ + format_field(entry, 'year')) + line.append(format_field(entry, 'isbn', pre='ISBN ')) + line.append(format_field(entry, 'note')) + + line = filter(lambda l: l != "", line) + return [where, ", ".join(line)] + def format_details_thesis(entry): line = [] line.append(format_field(entry, 'school')) @@ -153,6 +168,8 @@ def format_entry(entry): lines.extend(format_details_article(entry)) elif entry.type=='inproceedings': lines.extend(format_details_inproceedings(entry)) + elif entry.type=='incollection': + lines.extend(format_details_incollection(entry)) elif entry.type=='book': lines.extend(format_details_book(entry)) elif entry.type=='patent': -- 2.30.2