From e1096db47d332f2e4bfb4f38d262bb94e69d9ad5 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Mon, 13 Dec 2021 17:23:42 -0500 Subject: set exec and stuff --- bin/Internet.m3u.sh | 33 --- bin/copyright.awk | 122 ---------- bin/do_blue.sh | 3 - bin/do_dac.sh | 19 -- bin/do_speakers.sh | 13 -- bin/executable_Internet.m3u.sh | 33 +++ bin/executable_copyright.awk | 122 ++++++++++ bin/executable_do_blue.sh | 3 + bin/executable_do_dac.sh | 19 ++ bin/executable_do_speakers.sh | 13 ++ bin/executable_icd | 102 +++++++++ bin/executable_lbdb-fetchaddr-wrapper | 3 + bin/executable_mailx-alias | 13 ++ bin/executable_mice.sh | 25 ++ bin/executable_mpd_only.sh | 2 + bin/executable_mpd_others.sh | 5 + bin/executable_mutt | 7 + bin/executable_mutt-fetchbug | 161 +++++++++++++ bin/executable_mutt_bgrun | 115 ++++++++++ bin/executable_mutt_oauth2.py | 419 ++++++++++++++++++++++++++++++++++ bin/executable_ptmp | 50 ++++ bin/executable_startaudio | 3 + bin/executable_tmcg | 24 ++ bin/executable_wd-bak | 14 ++ bin/executable_wd-mount | 19 ++ bin/executable_wd-umount | 7 + bin/icd | 102 --------- bin/lbdb-fetchaddr-wrapper | 3 - bin/mailx-alias | 13 -- bin/mice.sh | 25 -- bin/mpd_only.sh | 2 - bin/mpd_others.sh | 5 - bin/mutt | 7 - bin/mutt-fetchbug | 161 ------------- bin/mutt_bgrun | 115 ---------- bin/mutt_oauth2.py | 419 ---------------------------------- bin/ptmp | 50 ---- bin/startaudio | 3 - bin/tmcg | 24 -- bin/wd-bak | 14 -- bin/wd-mount | 19 -- bin/wd-umount | 7 - 42 files changed, 1159 insertions(+), 1159 deletions(-) delete mode 100755 bin/Internet.m3u.sh delete mode 100755 bin/copyright.awk delete mode 100755 bin/do_blue.sh delete mode 100755 bin/do_dac.sh delete mode 100755 bin/do_speakers.sh create mode 100755 bin/executable_Internet.m3u.sh create mode 100755 bin/executable_copyright.awk create mode 100755 bin/executable_do_blue.sh create mode 100755 bin/executable_do_dac.sh create mode 100755 bin/executable_do_speakers.sh create mode 100755 bin/executable_icd create mode 100755 bin/executable_lbdb-fetchaddr-wrapper create mode 100755 bin/executable_mailx-alias create mode 100755 bin/executable_mice.sh create mode 100755 bin/executable_mpd_only.sh create mode 100755 bin/executable_mpd_others.sh create mode 100755 bin/executable_mutt create mode 100755 bin/executable_mutt-fetchbug create mode 100755 bin/executable_mutt_bgrun create mode 100755 bin/executable_mutt_oauth2.py create mode 100755 bin/executable_ptmp create mode 100755 bin/executable_startaudio create mode 100755 bin/executable_tmcg create mode 100755 bin/executable_wd-bak create mode 100755 bin/executable_wd-mount create mode 100755 bin/executable_wd-umount delete mode 100755 bin/icd delete mode 100755 bin/lbdb-fetchaddr-wrapper delete mode 100755 bin/mailx-alias delete mode 100755 bin/mice.sh delete mode 100755 bin/mpd_only.sh delete mode 100755 bin/mpd_others.sh delete mode 100755 bin/mutt delete mode 100755 bin/mutt-fetchbug delete mode 100755 bin/mutt_bgrun delete mode 100755 bin/mutt_oauth2.py delete mode 100755 bin/ptmp delete mode 100755 bin/startaudio delete mode 100755 bin/tmcg delete mode 100755 bin/wd-bak delete mode 100755 bin/wd-mount delete mode 100755 bin/wd-umount (limited to 'bin') diff --git a/bin/Internet.m3u.sh b/bin/Internet.m3u.sh deleted file mode 100755 index 6f35d85..0000000 --- a/bin/Internet.m3u.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# Updates the internet radio playlist for MPD -# Best run from a cronjob - -RUHIT=$(curl -s http://ruhit.fm/player.htm | grep ruhit_64 \ - | sed -e 's/.*="//g;s/".*//g') - -cat < /var/lib/mpd/playlists/Internet.m3u -#EXTM3U - -#EXTINF:-1,CKGN-FM 89.7 (Kapuskasing) -http://stream03.ustream.ca:80/ckgn128.mp3 - -#EXTINF:-1,CHYK-FM 104.1 (Timmins) -http://rubix.wavestreamer.com:8015/stream/1/ - -#EXTINF:-1,CJFO-FM 94.5 (Ottawa) -http://stream03.ustream.ca:8000/cjfofm128.mp3 - -#EXTINF:-1,CINN-FM 99.1 (Hearst) -http://stream2.statsradio.com:8050/stream - -#EXTINF:-1,CFSF-FM 99.3 (Sturgeon Falls) -http://listenlive.vistaradio.ca/CFSF - -#EXTINF:-1,99.6 Радио Русский Хит -${RUHIT} - -#EXTINF:-1,WYEP 91.3 (Pittsburgh) -https://ais-sa3.cdnstream1.com/2557_128.mp3 - -EOF diff --git a/bin/copyright.awk b/bin/copyright.awk deleted file mode 100755 index 371a9c2..0000000 --- a/bin/copyright.awk +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/gawk -f -# Copyright (C) 2013 Ryan Kavanagh -# Given a series of lines in the format -# Copyright (c) NNNN, MMMM-MMMM, ..., NNNN John Smith -# group years and emails by person. - -{ - match($0, /.*Copyright.*[0-9][,]? +/); - DATE_LENGTH = RLENGTH; - match($0, /<.*>/); - EMAIL_START = RSTART; - if (RLENGTH != -1) { - NAME = substr($0, DATE_LENGTH + 1, EMAIL_START - DATE_LENGTH - 2); - EMAIL = substr($0, EMAIL_START); - } else { - # No email on this line - NAME = substr($0, DATE_LENGTH + 1); - } - match($0, /.*Copyright +\([cC]\) +/); - DATE_START = RLENGTH + 1; - YEARS = substr($0, DATE_START, DATE_LENGTH - DATE_START); - gsub(/, +/, " ", YEARS); - gsub(/,/, " ", YEARS); - people_years[NAME] = people_years[NAME] " " YEARS; - if (EMAIL_LENGTH != -1) { - email_pattern = "/.*" EMAIL ".*/"; - if (!(NAME in people_emails)) { - people_emails[NAME] = EMAIL; - } else if (!match(people_emails[NAME], EMAIL)) { - people_emails[NAME] = people_emails[NAME] "," EMAIL; - } - } -} END { - for (person in people_years) { - delete years_array; - split(people_years[person], years_array); - # Split any hyphenated years; - for (year in years_array) { - if (years_array[year] ~ /[0-9]+-[0-9]+/) { - delete split_year; - split(years_array[year], split_year, /-/); - years_array[year] = split_year[1]; - if (split_year[1] != split_year[2]) { - # Make sure it isn't some crappy input like 2012-2012 - for (j = 1; j <= split_year[2] - split_year[1]; j++) { - years_array[length(years_array) + 1] = \ - years_array[year] + j; - } - } - } - } - # Sort the years - asort(years_array); - # Delete any duplicates: - for (i = 1; i <= length(years_array); i++) { - if (i > 1 && years_array[i-1] == years_array[i]) { - # Delete years_array[i-1] instead of years_array[i] so that we - # can still check the next year with ease - delete years_array[i-1]; - } - } - # Final sort - asort(years_array); - # Remove duplicates and generate year string - year_string = ""; - # Force AWK to access the years in order - added_hyphen = 0; - for (i = 1; i <= length(years_array); i++) { - if (i > 1) { - if (years_array[i - 1] != years_array[i]) { - # added_hyphen tracks if the last character in the string is - # a hyphen - if ((!added_hyphen) && (years_array[i - 1] == years_array[i] - 1)) { - # year_string isn't terminated by a hyphen, and the year - # at i-1 is one less than the current one - year_string = year_string "-"; - added_hyphen = 1; - } else if (added_hyphen && (years_array[i - 1] != years_array[i] - 1)) { - # The string is terminated by a hyphen, but the current - # year does not immediately follow the preceeding - # one - year_string = year_string years_array[i-1] ", " years_array[i]; - added_hyphen = 0; - } else if (!added_hyphen) { - year_string = year_string ", " years_array[i]; - } - } - } else { - year_string = years_array[i]; - } - } - # We've added a hyphen, but run out of years to check, terminate it - if (added_hyphen) { - year_string = year_string years_array[length(years_array)]; - } - final_line[years_array[length(years_array)]][length(years_array)][person] = \ - "Copyright (C) " year_string "\t" person " " people_emails[person]; - } - # We can't sort the years indices with asorti because we want a numerical, - # not lexicographic sort of the indices. - j = 0; - delete years_sorted; - for (i in final_line) years_sorted[j++] = i+0; - n_years_entries = asort(years_sorted); - # And output the lines with the most recent contributor first - for (y = n_years_entries; y >= 1; y--) { - # Sort the contributors with most recent contribution in year - # by_year[y] by number of years contributed: - j = 0; - delete contributions_sorted; - for (i in final_line[years_sorted[y]]) contributions_sorted[j++] = i+0; - n_contrib_entries = asort(contributions_sorted); - for (c = n_contrib_entries; c >= 1; c--) { - # Finally, sort by contributor name - asorti(final_line[years_sorted[y]][contributions_sorted[c]], by_person); - # And output the lines in alphabetical order by person name - for (n = 1; n <= length(by_person); n++) { - print final_line[years_sorted[y]][contributions_sorted[c]][by_person[n]]; - } - } - } -} diff --git a/bin/do_blue.sh b/bin/do_blue.sh deleted file mode 100755 index 6958aba..0000000 --- a/bin/do_blue.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -pacmd load-module module-bluez5-discover -echo "connect CD:0D:69:69:9A:1B" | bluetoothctl diff --git a/bin/do_dac.sh b/bin/do_dac.sh deleted file mode 100755 index 7ae913e..0000000 --- a/bin/do_dac.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -USB_CARD="alsa_card.usb-FiiO_DigiHug_USB_Audio-01" -USB_SINK="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.iec958-stereo" -SPEAKERS="alsa_output.pci-0000_00_1b.0.analog-stereo" - -pacmd set-sink-mute "${SPEAKERS}" 1 -pacmd set-card-profile "${USB_CARD}" output:iec958-stereo -pacmd set-sink-mute "${USB_SINK}" 0 - -if pacmd list-modules | grep module-ladspa-sink; then - pacmd unload-module module-ladspa-sink -fi -pacmd load-module module-ladspa-sink sink_name=binaural sink_master="${USB_SINK}" plugin=bs2b label=bs2b control=700,4.5 - -for s in $(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}') -do - pacmd move-sink-input $s "${USB_SINK}" >/dev/null 2>&1 -done diff --git a/bin/do_speakers.sh b/bin/do_speakers.sh deleted file mode 100755 index 84b82e1..0000000 --- a/bin/do_speakers.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -USB_CARD="alsa_card.usb-FiiO_DigiHug_USB_Audio-01" -USB_SINK="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.iec958-stereo" -SPEAKERS="alsa_output.pci-0000_00_1b.0.analog-stereo" - -pacmd set-sink-mute "${USB_SINK}" 1 -pacmd set-sink-mute "${SPEAKERS}" 0 - -for s in $(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}') -do - pacmd move-sink-input $s "${SPEAKERS}" >/dev/null 2>&1 -done diff --git a/bin/executable_Internet.m3u.sh b/bin/executable_Internet.m3u.sh new file mode 100755 index 0000000..6f35d85 --- /dev/null +++ b/bin/executable_Internet.m3u.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Updates the internet radio playlist for MPD +# Best run from a cronjob + +RUHIT=$(curl -s http://ruhit.fm/player.htm | grep ruhit_64 \ + | sed -e 's/.*="//g;s/".*//g') + +cat < /var/lib/mpd/playlists/Internet.m3u +#EXTM3U + +#EXTINF:-1,CKGN-FM 89.7 (Kapuskasing) +http://stream03.ustream.ca:80/ckgn128.mp3 + +#EXTINF:-1,CHYK-FM 104.1 (Timmins) +http://rubix.wavestreamer.com:8015/stream/1/ + +#EXTINF:-1,CJFO-FM 94.5 (Ottawa) +http://stream03.ustream.ca:8000/cjfofm128.mp3 + +#EXTINF:-1,CINN-FM 99.1 (Hearst) +http://stream2.statsradio.com:8050/stream + +#EXTINF:-1,CFSF-FM 99.3 (Sturgeon Falls) +http://listenlive.vistaradio.ca/CFSF + +#EXTINF:-1,99.6 Радио Русский Хит +${RUHIT} + +#EXTINF:-1,WYEP 91.3 (Pittsburgh) +https://ais-sa3.cdnstream1.com/2557_128.mp3 + +EOF diff --git a/bin/executable_copyright.awk b/bin/executable_copyright.awk new file mode 100755 index 0000000..371a9c2 --- /dev/null +++ b/bin/executable_copyright.awk @@ -0,0 +1,122 @@ +#!/usr/bin/gawk -f +# Copyright (C) 2013 Ryan Kavanagh +# Given a series of lines in the format +# Copyright (c) NNNN, MMMM-MMMM, ..., NNNN John Smith +# group years and emails by person. + +{ + match($0, /.*Copyright.*[0-9][,]? +/); + DATE_LENGTH = RLENGTH; + match($0, /<.*>/); + EMAIL_START = RSTART; + if (RLENGTH != -1) { + NAME = substr($0, DATE_LENGTH + 1, EMAIL_START - DATE_LENGTH - 2); + EMAIL = substr($0, EMAIL_START); + } else { + # No email on this line + NAME = substr($0, DATE_LENGTH + 1); + } + match($0, /.*Copyright +\([cC]\) +/); + DATE_START = RLENGTH + 1; + YEARS = substr($0, DATE_START, DATE_LENGTH - DATE_START); + gsub(/, +/, " ", YEARS); + gsub(/,/, " ", YEARS); + people_years[NAME] = people_years[NAME] " " YEARS; + if (EMAIL_LENGTH != -1) { + email_pattern = "/.*" EMAIL ".*/"; + if (!(NAME in people_emails)) { + people_emails[NAME] = EMAIL; + } else if (!match(people_emails[NAME], EMAIL)) { + people_emails[NAME] = people_emails[NAME] "," EMAIL; + } + } +} END { + for (person in people_years) { + delete years_array; + split(people_years[person], years_array); + # Split any hyphenated years; + for (year in years_array) { + if (years_array[year] ~ /[0-9]+-[0-9]+/) { + delete split_year; + split(years_array[year], split_year, /-/); + years_array[year] = split_year[1]; + if (split_year[1] != split_year[2]) { + # Make sure it isn't some crappy input like 2012-2012 + for (j = 1; j <= split_year[2] - split_year[1]; j++) { + years_array[length(years_array) + 1] = \ + years_array[year] + j; + } + } + } + } + # Sort the years + asort(years_array); + # Delete any duplicates: + for (i = 1; i <= length(years_array); i++) { + if (i > 1 && years_array[i-1] == years_array[i]) { + # Delete years_array[i-1] instead of years_array[i] so that we + # can still check the next year with ease + delete years_array[i-1]; + } + } + # Final sort + asort(years_array); + # Remove duplicates and generate year string + year_string = ""; + # Force AWK to access the years in order + added_hyphen = 0; + for (i = 1; i <= length(years_array); i++) { + if (i > 1) { + if (years_array[i - 1] != years_array[i]) { + # added_hyphen tracks if the last character in the string is + # a hyphen + if ((!added_hyphen) && (years_array[i - 1] == years_array[i] - 1)) { + # year_string isn't terminated by a hyphen, and the year + # at i-1 is one less than the current one + year_string = year_string "-"; + added_hyphen = 1; + } else if (added_hyphen && (years_array[i - 1] != years_array[i] - 1)) { + # The string is terminated by a hyphen, but the current + # year does not immediately follow the preceeding + # one + year_string = year_string years_array[i-1] ", " years_array[i]; + added_hyphen = 0; + } else if (!added_hyphen) { + year_string = year_string ", " years_array[i]; + } + } + } else { + year_string = years_array[i]; + } + } + # We've added a hyphen, but run out of years to check, terminate it + if (added_hyphen) { + year_string = year_string years_array[length(years_array)]; + } + final_line[years_array[length(years_array)]][length(years_array)][person] = \ + "Copyright (C) " year_string "\t" person " " people_emails[person]; + } + # We can't sort the years indices with asorti because we want a numerical, + # not lexicographic sort of the indices. + j = 0; + delete years_sorted; + for (i in final_line) years_sorted[j++] = i+0; + n_years_entries = asort(years_sorted); + # And output the lines with the most recent contributor first + for (y = n_years_entries; y >= 1; y--) { + # Sort the contributors with most recent contribution in year + # by_year[y] by number of years contributed: + j = 0; + delete contributions_sorted; + for (i in final_line[years_sorted[y]]) contributions_sorted[j++] = i+0; + n_contrib_entries = asort(contributions_sorted); + for (c = n_contrib_entries; c >= 1; c--) { + # Finally, sort by contributor name + asorti(final_line[years_sorted[y]][contributions_sorted[c]], by_person); + # And output the lines in alphabetical order by person name + for (n = 1; n <= length(by_person); n++) { + print final_line[years_sorted[y]][contributions_sorted[c]][by_person[n]]; + } + } + } +} diff --git a/bin/executable_do_blue.sh b/bin/executable_do_blue.sh new file mode 100755 index 0000000..6958aba --- /dev/null +++ b/bin/executable_do_blue.sh @@ -0,0 +1,3 @@ +#!/bin/sh +pacmd load-module module-bluez5-discover +echo "connect CD:0D:69:69:9A:1B" | bluetoothctl diff --git a/bin/executable_do_dac.sh b/bin/executable_do_dac.sh new file mode 100755 index 0000000..7ae913e --- /dev/null +++ b/bin/executable_do_dac.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +USB_CARD="alsa_card.usb-FiiO_DigiHug_USB_Audio-01" +USB_SINK="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.iec958-stereo" +SPEAKERS="alsa_output.pci-0000_00_1b.0.analog-stereo" + +pacmd set-sink-mute "${SPEAKERS}" 1 +pacmd set-card-profile "${USB_CARD}" output:iec958-stereo +pacmd set-sink-mute "${USB_SINK}" 0 + +if pacmd list-modules | grep module-ladspa-sink; then + pacmd unload-module module-ladspa-sink +fi +pacmd load-module module-ladspa-sink sink_name=binaural sink_master="${USB_SINK}" plugin=bs2b label=bs2b control=700,4.5 + +for s in $(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}') +do + pacmd move-sink-input $s "${USB_SINK}" >/dev/null 2>&1 +done diff --git a/bin/executable_do_speakers.sh b/bin/executable_do_speakers.sh new file mode 100755 index 0000000..84b82e1 --- /dev/null +++ b/bin/executable_do_speakers.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +USB_CARD="alsa_card.usb-FiiO_DigiHug_USB_Audio-01" +USB_SINK="alsa_output.usb-FiiO_DigiHug_USB_Audio-01.iec958-stereo" +SPEAKERS="alsa_output.pci-0000_00_1b.0.analog-stereo" + +pacmd set-sink-mute "${USB_SINK}" 1 +pacmd set-sink-mute "${SPEAKERS}" 0 + +for s in $(pacmd list-sink-inputs | awk '$1 == "index:" {print $2}') +do + pacmd move-sink-input $s "${SPEAKERS}" >/dev/null 2>&1 +done diff --git a/bin/executable_icd b/bin/executable_icd new file mode 100755 index 0000000..e419b7f --- /dev/null +++ b/bin/executable_icd @@ -0,0 +1,102 @@ +#!/bin/sh + +XKB_DIR=${HOME}/.xkb +[ -d ${XKB_DIR}/keymap ] || mkdir -p ${XKB_DIR}/keymap + +GLOBAL_OPTIONS="\ + -I${XKB_DIR} \ + -layout icd,ru \ + -variant icd, \ + -option terminate:ctrl_alt_bksp \ + -option nbsp:level3n \ + -option lalt_meta:lalt_meta \ + -option grp:shifts_toggle" + +LAPTOP_OPTIONS="\ + ${GLOBAL_OPTIONS} \ + -option lv3:ralt_switch_multikey" + +KIN_OPTIONS="\ + ${GLOBAL_OPTIONS} \ + -option lv3:switch \ + -option caps:swapescape" + +SUN_OPTIONS="\ + ${GLOBAL_OPTIONS} \ + -geometry sun(type6unix) \ + -option caps:escape \ + -option lv3:menu_switch \ + -option myswap:switch_lalt_lsuper" + +ERG_OPTIONS="\ + ${GLOBAL_OPTIONS} \ + -option lv3:switch \ + -option caps:escape" + +LAPTOP_ID=$(xinput | grep "AT Translated Set 2 keyboard" | sed -e 's/.*id=\([0-9]\+\).*/\1/g') +KIN_USB_ID=$(lsusb | grep -i "Kinesis Advantage Pro" | awk '{ print $6 }') +ERG_USB_ID=$(lsusb | grep -i "feed:1307" | awk '{ print $6 }') +SUN_USB_ID=$(lsusb | grep -i "Sun Microsystems, Inc. Type 6 Keyboard" | awk '{ print $6 }') + +echo "Setting up laptop" +setxkbmap ${LAPTOP_OPTIONS} -device ${LAPTOP_ID} -print > ${XKB_DIR}/keymap/icd.laptop +# xkbcomp -I${HOME}/.xkb -i ${LAPTOP_ID} -synch \ +xkbcomp -I${HOME}/.xkb -synch \ + ${HOME}/.xkb/keymap/icd.laptop $DISPLAY # 2> /dev/null + +if [ "x${KIN_USB_ID}" != "x" ]; then + echo "Setting up Kinesis" + KIN_XINPUT_ID=$(xinput | grep ${KIN_USB_ID} | sed -e 's/.*id=\([0-9]\+\).*/\1/g') + for XID in $KIN_XINPUT_ID; do + echo $XID + setxkbmap \ + -I${XKB_DIR} \ + -device ${XID} \ + ${KIN_OPTIONS} \ + -print | sed -e 's@+ctrl(nocaps)@@g;s@bksp)@bksp)+lalt_meta(lalt_meta)@g' > ${HOME}/.xkb/keymap/icd.kin + xkbcomp -I${HOME}/.xkb -i ${XID} -synch \ + ${HOME}/.xkb/keymap/icd.kin ${DISPLAY} # 2> /dev/null + done + xkbcomp -I${HOME}/.xkb -synch \ + ${HOME}/.xkb/keymap/icd.kin ${DISPLAY} # 2> /dev/null + xmodmap -e "remove mod1 = Alt_R" + xmodmap -e "add mod4 = Alt_R" +fi + +if [ "x${SUN_USB_ID}" != "x" ]; then + echo "Setting up Sun Type 6" + SUN_XINPUT_ID=$(xinput | grep ${SUN_USB_ID} | sed -e 's/.*id=\([0-9]\+\).*/\1/g') + echo "ID: ${SUN_XINPUT_ID}" + for XID in $SUN_XINPUT_ID; do + echo $XID + setxkbmap \ + -I${XKB_DIR} \ + -device ${XID} \ + ${SUN_OPTIONS} \ + -print | sed -e '/xkb_keycodes/s/"[[:space:]]/+sunt6fix&/' > ${HOME}/.xkb/keymap/icd.sun + xkbcomp -I${HOME}/.xkb -i ${XID} -synch \ + ${HOME}/.xkb/keymap/icd.sun ${DISPLAY} # 2> /dev/null + done +fi + +echo ${ERG_USB_ID} +if [ "x${ERG_USB_ID}" != "x" ]; then + echo "Setting up ergodox" + ERG_XINPUT_ID=$(xinput | grep "ErgoDox EZ" | grep keyboard | sed -e 's/.*id=\([0-9]\+\).*/\1/g') + echo "ID: ${ERG_XINPUT_ID}" + for XID in $ERG_XINPUT_ID; do + echo $XID + setxkbmap \ + -I${XKB_DIR} \ + -device ${XID} \ + ${ERG_OPTIONS} \ + -print > ${HOME}/.xkb/keymap/icd.erg + # -print | sed -e 's@+group(shifts_toggle)@+ctrl(nocaps)&@g' > ${HOME}/.xkb/keymap/icd.erg + # xkbcomp -I${HOME}/.xkb -i ${XID} -synch \ + xkbcomp -I${HOME}/.xkb -synch \ + ${HOME}/.xkb/keymap/icd.erg ${DISPLAY} # 2> /dev/null + done +fi + + +echo icd > ${HOME}/.xmonad/layout diff --git a/bin/executable_lbdb-fetchaddr-wrapper b/bin/executable_lbdb-fetchaddr-wrapper new file mode 100755 index 0000000..4503c5e --- /dev/null +++ b/bin/executable_lbdb-fetchaddr-wrapper @@ -0,0 +1,3 @@ +#!/bin/sh + +{ tee /dev/fd/3 | lbdb-fetchaddr >&2; } 3>&1 diff --git a/bin/executable_mailx-alias b/bin/executable_mailx-alias new file mode 100755 index 0000000..c1d961a --- /dev/null +++ b/bin/executable_mailx-alias @@ -0,0 +1,13 @@ +#!/bin/sh + +MUTT_ALIAS=${HOME}/.mutt/alias.rc +MAILX_ALIAS=${HOME}/.mailx-aliases.rc + +awk '{ + NAME=""; + for (i = 3; i < NF; i++) { + NAME=NAME " " $i; + }; + NAME = substr(NAME, 2); + print "alias", $2, "\"" $NF, "(" NAME ")\""; +}' $MUTT_ALIAS > $MAILX_ALIAS diff --git a/bin/executable_mice.sh b/bin/executable_mice.sh new file mode 100755 index 0000000..794f86f --- /dev/null +++ b/bin/executable_mice.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Synaptics: +synclient HorizTwoFingerScroll=0 || true +synclient HorizEdgeScroll=1 || true +# Enable circular scrolling with top edge activating +synclient CircularScrolling=1 || true +synclient CircScrollTrigger=1 || true +# One finger is left click +synclient TapButton1=1 || true +# Two is right click +synclient TapButton2=3 || true +# Three is middle click +synclient TapButton3=2 || true +# Enable coasting +synclient CoastingSpeed=5 +synclient CoastingFriction=30 + +trackball=$(xinput | grep "Kensington Expert Wireless TB" | grep pointer | sed -e 's/.*id=//g;s/\s\+.*//g') +if [ "x${trackball}" != "x" ]; then + xinput set-button-map "${trackball}" 1 2 8 4 5 6 7 3 9 10 11 12 13 14 15 16 + xinput set-prop "${trackball}" "libinput Accel Speed" 0.25 +fi + + diff --git a/bin/executable_mpd_only.sh b/bin/executable_mpd_only.sh new file mode 100755 index 0000000..39c3770 --- /dev/null +++ b/bin/executable_mpd_only.sh @@ -0,0 +1,2 @@ +#!/bin/sh +pacmd exit && mpc enable "DigiHug USB Audio" && mpc disable "My Pulse Output" diff --git a/bin/executable_mpd_others.sh b/bin/executable_mpd_others.sh new file mode 100755 index 0000000..1d832de --- /dev/null +++ b/bin/executable_mpd_others.sh @@ -0,0 +1,5 @@ +#!/bin/sh +mpc disable "DigiHug USB Audio" +mpc enable "My Pulse Output" +pacmd load-module module-udev-detect +${HOME}/bin/do_dac.sh diff --git a/bin/executable_mutt b/bin/executable_mutt new file mode 100755 index 0000000..78bd4ca --- /dev/null +++ b/bin/executable_mutt @@ -0,0 +1,7 @@ +#!/bin/sh + +if which neomutt; then + exec neomutt $@ +else + exec mutt $@ +fi diff --git a/bin/executable_mutt-fetchbug b/bin/executable_mutt-fetchbug new file mode 100755 index 0000000..93ffc58 --- /dev/null +++ b/bin/executable_mutt-fetchbug @@ -0,0 +1,161 @@ +#!/usr/bin/perl -w +# +# mutt-fetchbug, extensively based off of +# mutt-notmuch - notmuch (of a) helper for Mutt +# +# Copyright: © 2011 Stefano Zacchiroli +# License: GNU General Public License (GPL), version 3 or above +# +# Differences between mutt-notmuch and mutt-fetchbug are +# Copyright: © 2012 Ryan Kavanagh +# License: GNU General Public License (GPL), version 3 or above +# +# See the bottom of this file for more documentation. +# A manpage can be obtained by running "pod2man mutt-fetchbug > mutt-fetchbug.1" + +use strict; +use warnings; + +use File::Path; +use Getopt::Long; +use Pod::Usage; + +# search($btsmbox, $query) +# Fetch bugs matching $query with bts; store results in $btsmbox +sub search($$) { + my ($btsmbox, $query) = @_; + + system("bts --cache-mode=mbox cache $query" + . " && ln -fs ~/.cache/devscripts/bts/$query.mbox $btsmbox"); +} + +sub search_action($$@) { + my ($interactive, $btsmbox, @params) = @_; + + if (! $interactive) { + fetch($btsmbox, join(' ', @params)); + } else { + my $query = ""; + my $done = 0; + while (! $done) { + print "bug number ('?' for man): "; + chomp($query = ); + if ($query eq "?") { + system("man bts"); + } elsif ($query eq "") { + $done = 1; # quit doing nothing + } else { + search($btsmbox, $query); + $done = 1; + } + } + } +} + +sub die_usage() { + my %podflags = ( "verbose" => 1, + "exitval" => 2 ); + pod2usage(%podflags); +} + +sub main() { + my $btsmbox = "$ENV{HOME}/.cache/mutt_btsresults"; + my $interactive = 0; + my $help_needed = 0; + + my $getopt = GetOptions( + "h|help" => \$help_needed, + "o|output-mbox=s" => \$btsmbox, + "p|prompt" => \$interactive); + if (! $getopt || $#ARGV < 0) { die_usage() }; + my ($action, @params) = ($ARGV[0], @ARGV[1..$#ARGV]); + + if ($help_needed) { + die_usage(); + } elsif ($action eq "search" && $#ARGV == 0 && ! $interactive) { + print STDERR "Error: no search term provided\n\n"; + die_usage(); + } elsif ($action eq "search") { + search_action($interactive, $btsmbox, @params); + } else { + die_usage(); + } +} + +main(); + +__END__ + +=head1 NAME + +mutt-fetchbug - 'bts show' frontend for Mutt + +=head1 SYNOPSIS + +=over + +=item B [I