diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-12-06 23:03:44 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-12-07 09:41:16 -0700 |
commit | 13f08e9d36de02c54283993d2bd035adf13f0411 (patch) | |
tree | 8270a1dfe4916b9e70e173f4b2957d86e56e9e12 | |
parent | e27b9fcc8e89e847a4c7f7f6a80cc15e991dd260 (diff) | |
download | dotfiles-13f08e9d36de02c54283993d2bd035adf13f0411.tar.gz |
bin/: some straightforward tidying up
-rw-r--r-- | .config/i3/config | 4 | ||||
-rw-r--r-- | .emacs.d/eshell/alias | 2 | ||||
-rw-r--r-- | .shinit | 2 | ||||
-rwxr-xr-x | archive/bin/debian-ftp-master-cut-note (renamed from bin/debian-ftp-master-cut-note) | 0 | ||||
-rwxr-xr-x | archive/bin/grml-live-git (renamed from bin/grml-live-git) | 0 | ||||
-rwxr-xr-x | archive/bin/hexographer (renamed from bin/hexographer) | 0 | ||||
-rwxr-xr-x | archive/bin/i3-rotate-wallpaper | 5 | ||||
-rwxr-xr-x | archive/bin/in-develacc (renamed from bin/in-develacc) | 0 | ||||
-rwxr-xr-x | archive/bin/philpapers-bib (renamed from bin/philpapers-bib) | 0 | ||||
-rwxr-xr-x | archive/bin/propellor_lines (renamed from bin/propellor_lines) | 0 | ||||
-rwxr-xr-x | archive/bin/sblog (renamed from bin/sblog) | 0 | ||||
-rwxr-xr-x | bin/a2ac | 3 | ||||
-rwxr-xr-x | bin/choose-wallpaper | 2 | ||||
-rwxr-xr-x | bin/deb-why-removed | 228 | ||||
-rwxr-xr-x | bin/dlp | 3 | ||||
-rwxr-xr-x | bin/git-develacc | 2 | ||||
-rwxr-xr-x | bin/git-dotfiles-update-master | 2 | ||||
-rwxr-xr-x | bin/git-realadd | 5 | ||||
-rwxr-xr-x | bin/git-unshallow | 13 | ||||
-rwxr-xr-x | bin/pdfwc | 4 | ||||
-rwxr-xr-x | bin/quilt-pop-all | 10 | ||||
-rwxr-xr-x | bin/xdo-evince-highlight | 7 | ||||
-rwxr-xr-x | scripts/debian/test-package-plan (renamed from bin/test-package-plan) | 0 | ||||
-rwxr-xr-x | scripts/desktop/i3-startup-always (renamed from bin/i3-startup-always) | 2 | ||||
-rwxr-xr-x | scripts/desktop/xuserrun (renamed from bin/xuserrun) | 0 | ||||
-rwxr-xr-x | scripts/docs/make-poster-pdf (renamed from bin/make-poster-pdf) | 0 | ||||
-rwxr-xr-x | scripts/docs/pdfbg.py (renamed from bin/pdfbg.py) | 0 | ||||
-rwxr-xr-x | scripts/flashdrive/usbpubkeys (renamed from bin/usbpubkeys) | 0 | ||||
-rwxr-xr-x | scripts/media/burndir (renamed from bin/burndir) | 0 | ||||
-rwxr-xr-x | scripts/media/copydvd (renamed from bin/copydvd) | 0 | ||||
-rwxr-xr-x | scripts/media/encode.sh (renamed from bin/encode.sh) | 0 | ||||
-rwxr-xr-x | scripts/media/flac2mp3 (renamed from bin/flac2mp3) | 0 | ||||
-rwxr-xr-x | scripts/pgp/get-wkd-key (renamed from bin/get-wkd-key) | 0 | ||||
-rwxr-xr-x | scripts/pgp/offcaff (renamed from bin/offcaff) | 0 | ||||
-rwxr-xr-x | scripts/pgp/preoffcaff (renamed from bin/preoffcaff) | 0 | ||||
-rwxr-xr-x | scripts/root/ps_mem.py (renamed from bin/ps_mem.py) | 0 |
36 files changed, 13 insertions, 281 deletions
diff --git a/.config/i3/config b/.config/i3/config index 31936f0d..16c03ee1 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -224,7 +224,7 @@ mode "C-i-" { # reload the configuration file -- useful simply to reexecute # startup scripts bindsym c reload; \ - exec --no-startup-id ~/src/dotfiles/bin/i3-startup-always, \ + exec --no-startup-id ~/src/dotfiles/scripts/desktop/i3-startup-always, \ mode "default" # restart i3 inplace (preserves your layout/session, can be # used to upgrade i3) @@ -365,7 +365,7 @@ exec --no-startup-id redshift-gtk exec --no-startup-id xfce4-power-manager # idempotent settings and tweaks script -exec_always --no-startup-id ~/src/dotfiles/bin/i3-startup-always +exec_always --no-startup-id ~/src/dotfiles/scripts/desktop/i3-startup-always popup_during_fullscreen leave_fullscreen diff --git a/.emacs.d/eshell/alias b/.emacs.d/eshell/alias index dacbdef3..1975aa81 100644 --- a/.emacs.d/eshell/alias +++ b/.emacs.d/eshell/alias @@ -7,12 +7,14 @@ alias e find-file $1 alias o find-file-other-window $1 alias g git $* alias ga git annex $* +alias a2ac annex-to-annex --commit $@ alias v view-file-other-window $1 >/dev/null alias dak-rdeps { cd /ssh:mirror.ftp-master.debian.org: && dak rm -Rn $* } alias bts-policy bts user debian-policy@packages.debian.org , package debian-policy , $* alias afsid apt-file --filter-suites unstable $* alias grepcopy grep -Eir '(copyright|©)' * alias pdfwords pdftotext "$1" - | wc -w +alias dlp lp -o sides=two-sided-long-edge $* alias tail-dak { cd /ssh:ftp-master.debian.org:/srv/ftp-master.debian.org/log && tail -f current } alias tail-queued { cd /ssh:ssh.upload.debian.org:/srv/upload.debian.org/queued/run && tail -f log } alias package-plan-unpack ~/src/dotfiles/scripts/debian/package-plan-unpack "$1"; cd "/tmp/$1" @@ -18,10 +18,12 @@ alias mrs="src-register-all && mr -m status" alias gdbmacs="emacsclient -tc -sgdbmacs" alias g="git" alias ga="git annex" +alias a2ac="annex-to-annex --commit" # useful to check whether a rebase introduced any changes to files alias rld="git diff @{1}..@{0}" alias athvpn="sshuttle -r athena 0/0 --dns" alias grepcopy="grep --color=always -Eir '(copyright|©)' * | less -R" +alias dlp="lp -o sides=two-sided-long-edge" upenv () { # don't want to do this outside of tmux as then tmux show-environment will diff --git a/bin/debian-ftp-master-cut-note b/archive/bin/debian-ftp-master-cut-note index 435ba9c8..435ba9c8 100755 --- a/bin/debian-ftp-master-cut-note +++ b/archive/bin/debian-ftp-master-cut-note diff --git a/bin/grml-live-git b/archive/bin/grml-live-git index dc2b051d..dc2b051d 100755 --- a/bin/grml-live-git +++ b/archive/bin/grml-live-git diff --git a/bin/hexographer b/archive/bin/hexographer index 98843deb..98843deb 100755 --- a/bin/hexographer +++ b/archive/bin/hexographer diff --git a/archive/bin/i3-rotate-wallpaper b/archive/bin/i3-rotate-wallpaper index b31bf91f..43f84462 100755 --- a/archive/bin/i3-rotate-wallpaper +++ b/archive/bin/i3-rotate-wallpaper @@ -35,7 +35,8 @@ push @images, chomp @images; system "resize-wallpapers-for-outputs", @images; -system "i3-startup-always" if $ENV{DISPLAY}; +system "$ENV{HOME}/src/dotfiles/scripts/desktop/i3-startup-always" + if $ENV{DISPLAY}; # if [ -n "$img" ]; then # # this will just size up images with the correct aspect ratio. For @@ -51,7 +52,7 @@ system "i3-startup-always" if $ENV{DISPLAY}; # # $HOME/local/wallpaper.png # # this calls feh -# [ -n "$DISPLAY" ] && i3-startup-always +# [ -n "$DISPLAY" ] && ~/src/dotfiles/scripts/desktop/i3-startup-always # fi # # do develacc too, though we can't call i3-startup-always diff --git a/bin/in-develacc b/archive/bin/in-develacc index 85369e93..85369e93 100755 --- a/bin/in-develacc +++ b/archive/bin/in-develacc diff --git a/bin/philpapers-bib b/archive/bin/philpapers-bib index e5c575a9..e5c575a9 100755 --- a/bin/philpapers-bib +++ b/archive/bin/philpapers-bib diff --git a/bin/propellor_lines b/archive/bin/propellor_lines index 8bdd28e1..8bdd28e1 100755 --- a/bin/propellor_lines +++ b/archive/bin/propellor_lines diff --git a/bin/sblog b/archive/bin/sblog index cded87db..cded87db 100755 --- a/bin/sblog +++ b/archive/bin/sblog diff --git a/bin/a2ac b/bin/a2ac deleted file mode 100755 index 4e402022..00000000 --- a/bin/a2ac +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -annex-to-annex --commit "$@" diff --git a/bin/choose-wallpaper b/bin/choose-wallpaper index 892252d8..e1fd8bd0 100755 --- a/bin/choose-wallpaper +++ b/bin/choose-wallpaper @@ -27,7 +27,7 @@ unshift @wallpapers, @ARGV; select_wallpaper_files @wallpapers; # resize_for_current_outputs; -# system "i3-startup-always"; # feh and also restart i3lock +# system "$ENV{HOME}/src/dotfiles/scripts/desktop/i3-startup-always"; # feh & restart i3lock # now give develacc something if (-e "$ENV{HOME}/local/develacc") { diff --git a/bin/deb-why-removed b/bin/deb-why-removed deleted file mode 100755 index 8880ebe8..00000000 --- a/bin/deb-why-removed +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/perl -# -# Copyright © 2017-2018 Guillem Jover <guillem@debian.org> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -use strict; -use warnings; - -use File::Basename; -use File::Path qw(make_path); -use File::Spec; -use Getopt::Long qw(:config posix_default no_ignorecase); -use HTTP::Tiny; -use Dpkg::Index; - -my $VERSION = '0.0'; -my ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)}; - -my %url_map = ( - 'debian' => 'https://ftp-master.debian.org/removals-full.822', -); -my $default_url = 'debian'; - -sub version -{ - print "$PROGNAME $VERSION (devscripts ###VERSION###)\n"; -} - -sub usage -{ - print <<HELP; -Usage: $PROGNAME [<option>...] <package>... - -Options: - -u, --url URL URL to the removals deb822 file list (defaults to - <$url_map{$default_url}>). - --no-refresh Do not refresh the cached removals file even if old. - -?, --help Print this help text. - --version Print the version. -HELP -} - -sub error -{ - my @msg = @_; - - print { *STDERR } "E: @msg\n"; - exit 1; -} - -# XXX: DAK produces broken output, fix it up here before we process it. -# -# The two current bogus instances are, at least two fused paragraphs, and -# bogus "sh: 0: getcwd() failed: No such file or directory" command output -# interpersed within the file. -sub fixup_broken_metadata -{ - my $cachefile = shift; - my $para_sep = 1; - - open my $fh_old, '<', $cachefile - or error("cannot open cache file $cachefile for fixup"); - open my $fh_new, '>', "$cachefile.new" - or error("cannot open cache file $cachefile.new for fixup"); - while (my $line = <$fh_old>) { - if ($line =~ m/^\s*$/) { - $para_sep = 1; - } elsif (not $para_sep and $line =~ m/^Date:/) { - # XXX: We assume each paragraph starts with a Date: field, and - # inject the missing newline. - print { $fh_new } "\n"; - } else { - $para_sep = 0; - } - - # XXX: Fixup shell output detritus. - if ($line =~ s/sh: 0: getcwd\(\) failed: No such file or directory//) { - # Remove the trailing line so that the next line gets folded back - # into this one. - chomp $line; - } - - print { $fh_new } $line; - } - close $fh_new or error("cannot write cache file $cachefile.new"); - close $fh_old; - - # Preserve the original mtime so that mirroring works. - my ($atime, $mtime) = (stat $cachefile)[8, 9]; - utime $atime, $mtime, "$cachefile.new"; - - rename "$cachefile.new", $cachefile - or error("cannot replace cache file with fixup version"); -} - -my $opts; - -GetOptions( - 'url|u=s' => \$opts->{'url'}, - 'no-refresh' => \$opts->{'no-refresh'}, - 'help|?' => sub { usage(); exit 0 }, - 'version' => sub { version(); exit 0 }, -) or die "\nUsage: $PROGNAME [<option>...] <package>...\n" . - "Run $PROGNAME --help for more details.\n"; - -unless (@ARGV) { - error('need at least one package name as an argument'); -} - -my $url = $opts->{url} // $default_url; -$url = $url_map{$url} if $url_map{$url}; - -my $cachehome = $ENV{XDG_CACHE_HOME}; -$cachehome ||= File::Spec->catdir($ENV{HOME}, '.cache') if length $ENV{HOME}; -if (length $cachehome == 0) { - error("unknown user home, cannot download removal metadata"); -} -my $cachedir = File::Spec->catdir($cachehome, 'devscripts', 'deb-why-removed'); -my $cachefile = File::Spec->catfile($cachedir, basename($url)); - -if (not -d $cachedir) { - make_path($cachedir); -} - -if (not -e $cachefile or (-e _ and not $opts->{'no-refresh'})) { - # Cache the file locally. - my $http = HTTP::Tiny->new(verify_SSL => 1); - my $resp = $http->mirror($url, $cachefile); - - unless ($resp->{success}) { - error("cannot fetch removal metadata: $resp->{status} $resp->{reason}"); - } - - if ($resp->{status} != 304) { - fixup_broken_metadata($cachefile); - } -} - -my $meta = Dpkg::Index->new( - get_key_func => sub { return $_[0]->{Sources} // $_[0]->{Binaries} // '' }, -); - -$meta->load($cachefile, compression => 0); - -STANZA: foreach my $entry ($meta->get) { - foreach my $pkg (@ARGV) { - # XXX: Skip bogus entries with no indexable fields. - next if not defined $entry->{Sources} and - not defined $entry->{Binaries}; - - next unless (defined $entry->{Sources} and - $entry->{Sources} =~ m/^\Q$pkg\E_/m) or - (defined $entry->{Binaries} and - $entry->{Binaries} =~ m/^\Q$pkg\E_/m); - - print $entry->output(); - print "\n"; - next STANZA; - } -} - -=encoding utf8 - -=head1 NAME - -deb-why-removed - shows the reason a package was removed from the archive - -=head1 SYNOPSIS - -B<deb-why-removed> [I<option>...] I<package>... - -=head1 DESCRIPTION - -This program will download the removals metadata from the archive, search -and print the entries within for a source or binary package name match. - -=head1 OPTIONS - -=over 4 - -=item B<-u>, B<--url> I<URL> - -URL to the archive removals deb822-formatted file list. - -=item B<--no-refresh> - -Do not refresh the cached removals file even if there is a newer version -in the archive. - -=item B<-?>, B<--help> - -Show a help message and exit. - -=item B<--version> - -Show the program version. - -=back - -=head1 FILES - -=over 4 - -=item I<cachedir>B</devscripts/deb-why-removed/> - -This directory contains the cached removal files downloaded from the archive. -I<cachedir> will be either B<$XDG_CACHE_HOME> or if that is not defined -B<$HOME/.cache/>. - -=back - -=head1 SEE ALSO - -L<https://ftp-master.debian.org/#removed> - -=cut diff --git a/bin/dlp b/bin/dlp deleted file mode 100755 index 33ae6482..00000000 --- a/bin/dlp +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -lp -o sides=two-sided-long-edge "$@" diff --git a/bin/git-develacc b/bin/git-develacc index 4e8f3671..99982b8a 100755 --- a/bin/git-develacc +++ b/bin/git-develacc @@ -20,7 +20,7 @@ set -e # sanity check -if in-develacc; then +if [ "$(hostname)" = develacc ]; then echo >&2 "$0: this script should be run outside the develacc container by my normal user" exit 1 fi diff --git a/bin/git-dotfiles-update-master b/bin/git-dotfiles-update-master index 6b575f2d..17d3e99d 100755 --- a/bin/git-dotfiles-update-master +++ b/bin/git-dotfiles-update-master @@ -12,7 +12,7 @@ set -e # To update a shallow clone we would do 'git fetch --depth 1' and then 'git # reset --hard origin/master'. But that would leave us vulnerable to an # attacker causing us to check out an older signed commit than the one we have -# now. So require an explicit 'git unshallow' from the user, or get +# now. So require an explicit 'git fetch --unshallow' from the user, or get # Consfigurator to update repo from a snapshot from laptop, or something. if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then echo >&2 "shallow dotfiles clone; refusing to reset to origin/master" diff --git a/bin/git-realadd b/bin/git-realadd deleted file mode 100755 index e02fb7bc..00000000 --- a/bin/git-realadd +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# see https://git-annex.branchable.com/forum/__34__git_add__34___vs___34__git_annex_add__34___in_v6/ - -git -c annex.gitaddtoannex=false add "$@" diff --git a/bin/git-unshallow b/bin/git-unshallow deleted file mode 100755 index 5cfb223c..00000000 --- a/bin/git-unshallow +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# assumes remote named origin - -if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then - git fetch --unshallow origin - # does not seem to be needed anymore? - # git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - # git fetch origin -else - echo >&2 "fatal: repository is not shallow" - exit 1 -fi diff --git a/bin/pdfwc b/bin/pdfwc deleted file mode 100755 index fb889aaa..00000000 --- a/bin/pdfwc +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# rough -pdftotext $1 - | tr " " "\n" | wc -l diff --git a/bin/quilt-pop-all b/bin/quilt-pop-all deleted file mode 100755 index bce9a8f7..00000000 --- a/bin/quilt-pop-all +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -test -e .pc || exit 0 -quilt pop -a -quiltexit=$? -if [ $quiltexit = 2 ]; then - exit 0 -else - exit $quiltexit -fi diff --git a/bin/xdo-evince-highlight b/bin/xdo-evince-highlight deleted file mode 100755 index 5a9dbdc4..00000000 --- a/bin/xdo-evince-highlight +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -xdotool click 3 -sleep 0.4 -xdotool key Up -xdotool key Up -xdotool key Return diff --git a/bin/test-package-plan b/scripts/debian/test-package-plan index 47d6b232..47d6b232 100755 --- a/bin/test-package-plan +++ b/scripts/debian/test-package-plan diff --git a/bin/i3-startup-always b/scripts/desktop/i3-startup-always index c5e937bd..b2a02e25 100755 --- a/bin/i3-startup-always +++ b/scripts/desktop/i3-startup-always @@ -108,7 +108,7 @@ feh --bg-tile ~/src/dotfiles/lib-src/img/green_gobbler.png # Changes to these values should be kept in sync with comproc.org # notes for configuring xfce4-power-manager xset s default -if in-develacc; then +if [ "$(hostname)" = develacc ]; then xset s 0 xset dpms 0 0 0 xset -dpms diff --git a/bin/xuserrun b/scripts/desktop/xuserrun index 6ec24350..6ec24350 100755 --- a/bin/xuserrun +++ b/scripts/desktop/xuserrun diff --git a/bin/make-poster-pdf b/scripts/docs/make-poster-pdf index f8ac917b..f8ac917b 100755 --- a/bin/make-poster-pdf +++ b/scripts/docs/make-poster-pdf diff --git a/bin/pdfbg.py b/scripts/docs/pdfbg.py index af1b28cd..af1b28cd 100755 --- a/bin/pdfbg.py +++ b/scripts/docs/pdfbg.py diff --git a/bin/usbpubkeys b/scripts/flashdrive/usbpubkeys index 20330b99..20330b99 100755 --- a/bin/usbpubkeys +++ b/scripts/flashdrive/usbpubkeys diff --git a/bin/burndir b/scripts/media/burndir index 786845ac..786845ac 100755 --- a/bin/burndir +++ b/scripts/media/burndir diff --git a/bin/copydvd b/scripts/media/copydvd index 6b939c68..6b939c68 100755 --- a/bin/copydvd +++ b/scripts/media/copydvd diff --git a/bin/encode.sh b/scripts/media/encode.sh index 4c72eff5..4c72eff5 100755 --- a/bin/encode.sh +++ b/scripts/media/encode.sh diff --git a/bin/flac2mp3 b/scripts/media/flac2mp3 index 23d5a170..23d5a170 100755 --- a/bin/flac2mp3 +++ b/scripts/media/flac2mp3 diff --git a/bin/get-wkd-key b/scripts/pgp/get-wkd-key index 98ee6165..98ee6165 100755 --- a/bin/get-wkd-key +++ b/scripts/pgp/get-wkd-key diff --git a/bin/offcaff b/scripts/pgp/offcaff index ef71398d..ef71398d 100755 --- a/bin/offcaff +++ b/scripts/pgp/offcaff diff --git a/bin/preoffcaff b/scripts/pgp/preoffcaff index 6913e1ce..6913e1ce 100755 --- a/bin/preoffcaff +++ b/scripts/pgp/preoffcaff diff --git a/bin/ps_mem.py b/scripts/root/ps_mem.py index a6bd1c58..a6bd1c58 100755 --- a/bin/ps_mem.py +++ b/scripts/root/ps_mem.py |