Update 2024-12-31 10:47 OpenBSD/amd64-t14

This commit is contained in:
c0dev0id 2024-12-31 10:47:38 +01:00
parent 9ffce7022e
commit 9f55042b33
23 changed files with 369 additions and 499 deletions

View File

@ -69,7 +69,8 @@ needs() {
|| add="$add $x"
done
[ ! -z "$add" ] \
&& doas pkg_add -- $add
&& doas pkg_add -- $add \
|| true
}
#

View File

@ -153,7 +153,7 @@ choose_browser() {
[Qq]uteb*r*) BROWSER="qutebrowser -R" ;;
[Ss]urf*) BROWSER=surf ;;
[Oo]tter*r*) BROWSER=otter-browser ;;
[Ll]uakit*) BROWSER="luakit -Un" ;;
[Ll]uakit*) BROWSER="luakit -v -U" ;;
[Cc]hrome*) BROWSER=chrome ;;
[Ff]irefox*) BROWSER=firefox ;;
[Tt]or-B*r*) BROWSER=tor-browser ;;
@ -174,4 +174,4 @@ read_input
choose_wrapper
choose_browser
save_history
$BROWSER "$(printf '%s' "${URI}" | sed 's/ /%20/g')" &
$BROWSER "$(printf '%s' "${URI}" | sed 's/ /%20/g')" > /home/sdk/browser.log 2>&1 &

View File

@ -1,29 +0,0 @@
#!/bin/sh -e
_dev="$1"
[ -z $_dev ] && printf "usage: %s <sd2>\n" "$(basename $0)" && exit 2
[ $(id -u) -gt 0 ] && printf "you need superuser rights\n" && exit 2
dmesg | grep "$_dev" | grep -A1 scsibus | tail -n 2
printf "Format ${_dev} [y/N]? "
read
case $REPLY in
[yY]) ;;
*) exit 0; ;;
esac
printf "Overwriting first MBs with zeros:"
dd of=/dev/r${_dev}c if=/dev/zero bs=1M count=1 > /dev/null 2>&1
printf " ✅\n"
printf "Creating FAT32 partition:"
echo "edit 0\n0B\n\n512\n*\nw\nq\n" | fdisk -e "$_dev" > /dev/null 2>&1
printf " ✅\n"
printf "Creating FAT32 file system (this may take a while)...\n"
newfs_msdos -F32 -b65536 "${_dev}i"
printf "Creating FAT32 file system: ✅\n"
printf "Mount:\ndoas mkdir -p /mnt/%s && doas mount_msdos /dev/%si /mnt/%s\n" "$_dev" "$_dev" "$_dev"

4
.bin/g
View File

@ -20,6 +20,10 @@ then echo "no git repository"
fi
_width=$(tput cols)
if [ -z "$_width" ]
then
_width=60
fi
[ $_width -lt 43 ] \
&& _width=43 \
|| _width=$(( _width - 3 ))

View File

@ -1,296 +0,0 @@
#!/usr/bin/perl -w
my $debug = 0;
#
# ical2rem.pl -
# Reads iCal files and outputs remind-compatible files. Tested ONLY with
# calendar files created by Mozilla Calendar/Sunbird. Use at your own risk.
# Copyright (c) 2005, 2007, Justin B. Alcorn
# 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
# version 0.5.2 2007-03-23
# - BUG: leadtime for recurring events had a max of 4 instead of DEFAULT_LEAD_TIME
# - remove project-lead-time, since Category was a non-standard attribute
# - NOTE: There is a bug in iCal::Parser v1.14 that causes multiple calendars to
# fail if a calendar with recurring events is followed by a calendar with no
# recurring events. This has been reported to the iCal::Parser author.
# version 0.5.1 2007-03-21
# - BUG: Handle multiple calendars on STDIN
# - add --heading option for priority on section headers
# version 0.5 2007-03-21
# - Add more help options
# - --project-lead-time option
# - Supress printing of heading if there are no todos to print
# version 0.4
# - Version 0.4 changes all written or inspired by, and thanks to Mark Stosberg
# - Change to GetOptions
# - Change to pipe
# - Add --label, --help options
# - Add Help Text
# - Change to subroutines
# - Efficiency and Cleanup
# version 0.3
# - Convert to GPL (Thanks to Mark Stosberg)
# - Add usage
# version 0.2
# - add command line switches
# - add debug code
# - add SCHED _sfun keyword
# - fix typos
# version 0.1 - ALPHA CODE.
=head1 SYNOPSIS
cat /path/to/file*.ics | ical2rem.pl > ~/.ical2rem
All options have reasonable defaults:
--label Calendar name (Default: Calendar)
--lead-time Advance days to start reminders (Default: 3)
--todos, --no-todos Process Todos? (Default: Yes)
--heading Define a priority for static entries
--help Usage
--man Complete man page
Expects an ICAL stream on STDIN. Converts it to the format
used by the C<remind> script and prints it to STDOUT.
=head2 --label
ical2rem.pl --label "Bob's Calendar"
The syntax generated includes a label for the calendar parsed.
By default this is "Calendar". You can customize this with
the "--label" option.
=head2 --lead-time
ical2rem.pl --lead-time 3
How may days in advance to start getting reminders about the events. Defaults to 3.
=head2 --no-todos
ical2rem.pl --no-todos
If you don't care about the ToDos the calendar, this will surpress
printing of the ToDo heading, as well as skipping ToDo processing.
=head2 --heading
ical2rem.pl --heading "PRIORITY 9999"
Set an option on static messages output. Using priorities can made the static messages look different from
the calendar entries. See the file defs.rem from the remind distribution for more information.
=cut
use strict;
use iCal::Parser;
use DateTime;
use Getopt::Long 2.24 qw':config auto_help';
use Pod::Usage;
use Data::Dumper;
use vars '$VERSION';
$VERSION = "0.5.2";
# Declare how many days in advance to remind
my $DEFAULT_LEAD_TIME = 3;
my $PROCESS_TODOS = 1;
my $HEADING = "";
my $help;
my $man;
my $label = 'Calendar';
GetOptions (
"label=s" => \$label,
"lead-time=i" => \$DEFAULT_LEAD_TIME,
"todos!" => \$PROCESS_TODOS,
"heading=s" => \$HEADING,
"help|?" => \$help,
"man" => \$man
);
pod2usage(1) if $help;
pod2usage(-verbose => 2) if $man;
my $month = ['None','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
my @calendars;
my $in;
while (<>) {
$in .= $_;
if (/END:VCALENDAR/) {
push(@calendars,$in);
$in = "";
}
}
print STDERR "Read all calendars\n" if $debug;
my $startdate = DateTime->new( year => 2010,
month => 4,
day => 1,
time_zone => 'US/Eastern',
);
my $oneyear = DateTime::Duration->new( years => 1);
my $oneweek = DateTime::Duration->new( weeks => -1);
$startdate = DateTime->now + $oneweek;
my $enddate = DateTime->now + $oneyear;
print STDERR "About to parse calendars\n" if $debug;
my $parser = iCal::Parser->new('start' => $startdate,
'debug' => 0,
'end' => $enddate);
my $hash = $parser->parse_strings(@calendars);
print STDERR "Calendars parsed\n" if $debug;
##############################################################
#
# Subroutines
#
#############################################################
#
# _process_todos()
# expects 'todos' hashref from iCal::Parser is input
# returns String to output
sub _process_todos {
my $todos = shift;
my ($todo, @newtodos, $leadtime);
my $output = "";
$output .= 'REM '.$HEADING.' MSG '.$label.' ToDos:%"%"%'."\n";
# For sorting, make sure everything's got something
# To sort on.
my $now = DateTime->now;
for $todo (@{$todos}) {
# remove completed items
if ($todo->{'STATUS'} && $todo->{'STATUS'} eq 'COMPLETED') {
next;
} elsif ($todo->{'DUE'}) {
# All we need is a due date, everything else is sugar
$todo->{'SORT'} = $todo->{'DUE'}->clone;
} elsif ($todo->{'DTSTART'}) {
# for sorting, sort on start date if there's no due date
$todo->{'SORT'} = $todo->{'DTSTART'}->clone;
} else {
# if there's no due or start date, just make it now.
$todo->{'SORT'} = $now;
}
push(@newtodos,$todo);
}
if (! (scalar @newtodos)) {
return "";
}
# Now sort on the new Due dates and print them out.
for $todo (sort { DateTime->compare($a->{'SORT'}, $b->{'SORT'}) } @newtodos) {
my $due = $todo->{'SORT'}->clone();
my $priority = "";
if (defined($todo->{'PRIORITY'})) {
if ($todo->{'PRIORITY'} == 1) {
$priority = "PRIORITY 1000";
} elsif ($todo->{'PRIORITY'} == 3) {
$priority = "PRIORITY 7500";
}
}
if (defined($todo->{'DTSTART'}) && defined($todo->{'DUE'})) {
# Lead time is duration of task + lead time
my $diff = ($todo->{'DUE'}->delta_days($todo->{'DTSTART'})->days())+$DEFAULT_LEAD_TIME;
$leadtime = "+".$diff;
} else {
$leadtime = "+".$DEFAULT_LEAD_TIME;
}
$output .= "REM ".$due->month_abbr." ".$due->day." ".$due->year." $leadtime $priority MSG \%a $todo->{'SUMMARY'}\%\"\%\"\%\n";
}
$output .= 'REM '.$HEADING.' MSG %"%"%'."\n";
return $output;
}
#######################################################################
#
# Main Program
#
######################################################################
print _process_todos($hash->{'todos'}) if $PROCESS_TODOS;
my ($leadtime, $yearkey, $monkey, $daykey,$uid,%eventsbyuid);
print 'REM '.$HEADING.' MSG '.$label.' Events:%"%"%'."\n";
my $events = $hash->{'events'};
foreach $yearkey (sort keys %{$events} ) {
my $yearevents = $events->{$yearkey};
foreach $monkey (sort {$a <=> $b} keys %{$yearevents}){
my $monevents = $yearevents->{$monkey};
foreach $daykey (sort {$a <=> $b} keys %{$monevents} ) {
my $dayevents = $monevents->{$daykey};
foreach $uid (sort {
DateTime->compare($dayevents->{$a}->{'DTSTART'}, $dayevents->{$b}->{'DTSTART'})
} keys %{$dayevents}) {
my $event = $dayevents->{$uid};
if ($eventsbyuid{$uid}) {
my $curreventday = $event->{'DTSTART'}->clone;
$curreventday->truncate( to => 'day' );
$eventsbyuid{$uid}{$curreventday->epoch()} =1;
for (my $i = 0;$i < $DEFAULT_LEAD_TIME && !defined($event->{'LEADTIME'});$i++) {
if ($eventsbyuid{$uid}{$curreventday->subtract( days => $i+1 )->epoch() }) {
$event->{'LEADTIME'} = $i;
}
}
} else {
$eventsbyuid{$uid} = $event;
my $curreventday = $event->{'DTSTART'}->clone;
$curreventday->truncate( to => 'day' );
$eventsbyuid{$uid}{$curreventday->epoch()} =1;
}
}
}
}
}
foreach $yearkey (sort keys %{$events} ) {
my $yearevents = $events->{$yearkey};
foreach $monkey (sort {$a <=> $b} keys %{$yearevents}){
my $monevents = $yearevents->{$monkey};
foreach $daykey (sort {$a <=> $b} keys %{$monevents} ) {
my $dayevents = $monevents->{$daykey};
foreach $uid (sort {
DateTime->compare($dayevents->{$a}->{'DTSTART'}, $dayevents->{$b}->{'DTSTART'})
} keys %{$dayevents}) {
my $event = $dayevents->{$uid};
if (exists($event->{'LEADTIME'})) {
$leadtime = "+".$event->{'LEADTIME'};
} else {
$leadtime = "+".$DEFAULT_LEAD_TIME;
}
my $start = $event->{'DTSTART'};
print "REM ".$start->month_abbr." ".$start->day." ".$start->year." $leadtime ";
if ($start->hour > 0) {
print " AT ";
print $start->strftime("%H:%M");
# print " SCHED _sfun MSG %a %2 ";
# fix 2024-10-04
print " +15 MSG %a %2 ";
} else {
print " MSG %a ";
}
print "%\"$event->{'SUMMARY'}";
print " at $event->{'LOCATION'}" if $event->{'LOCATION'};
print "\%\"%\n";
}
}
}
}
exit 0;
#:vim set ft=perl ts=4 sts=4 expandtab :

View File

@ -147,12 +147,8 @@ fi
if [ "$_action" == "update-port" ]
then
export DEVELOPMENT_PATHS=0
cd /usr/ports/mystuff/www/luakit
commit="$(basename $(gh browse --repo luakit/luakit -c -n))"
sed -i "s/^COMMIT =.*/COMMIT = $commit/" Makefile
make clean=all
portbump
make makesum
make reinstall
./update.sh
fi

View File

@ -1,9 +1,60 @@
#!/bin/sh
set -xe
# Figure out what's the best directory to put tag files in.
# This is usually the top level of the project / source directory.
# We can figure this out in a source controlled directories.
# git: the top level dir is the one that contains the .git
# directory, so we traverse the directory hierarchy backwards and
# look for it.
# cvs: the top level dir is the first dir that still contains a CVS
# directory. So we traverse back the directory hierarchy and check
# it the parent directory has no CVS directory. Then it's the current
# one.
gitdir() {
set -x
_path="$PWD"
while [ -n "$_path" ]
do [ -d "$_path/.git" ] \
&& echo "$_path" \
&& break
_path="${_path%/*}"
done
}
cvsdir() {
set -x
_path="$PWD"
while [ -n "$_path" ]
do
[ ! -d "$_path/../CVS" ] \
&& echo "$_path" \
&& break
_path="${_path%/*}"
done
}
_gitdir="$(gitdir)"
_cvsdir="$(cvsdir)"
if [ -n "$_gitdir" ]
then
_tagdir=".git"
_wrkdir="$_gitdir"
elif [ -n "$_cvsdir" ]
then
_wrkdir="$_cvsdir"
_tagdir=".tags"
else
_wrkdir=${PWD}
_tagdir=".tags"
fi
echo "Creating tags in $_wrkdir/$_tagdir"
mkdir -p "$_wrkdir/$_tagdir"
# create files list
find "${PWD}/"* -type f \
find "${_wrkdir}/"* -type f \
\( -iname "*.c" \
-o -iname "*.cc" \
-o -iname "*.cpp" \
@ -17,7 +68,7 @@ find "${PWD}/"* -type f \
-o -iname "*.pl" \
-o -iname "*.sh" \
-o -name "Makefile" \
\) > ${PWD}/.git/files
\) > ${_wrkdir}/${_tagdir}/files
# include extra directories
if [ ! -z "$1" ]
@ -36,11 +87,11 @@ then
-o -iname "*.pl" \
-o -iname "*.sh" \
-o -name "Makefile" \
\) >> ${PWD}/.git/files
\) >> ${_wrkdir}/${_tagdir}/files
fi
# create cscope database
cscope -qbkCRv -P${PWD} -f ${PWD}/.git/cscope.out -i${PWD}/.git/files
cscope -qbkCRv -P${_wrkdir} -f ${_wrkdir}/${_tagdir}/cscope.out -i${_wrkdir}/${_tagdir}/files
# create tags file
ectags --sort=yes \
@ -50,6 +101,6 @@ ectags --sort=yes \
--fields=+K \
--totals=yes \
--fields=fkst \
--exclude=.git \
-L ${PWD}/.git/files \
-f ${PWD}/.git/tags
--exclude=${_tagdir} \
-L ${_wrkdir}/${_tagdir}/files \
-f ${_wrkdir}/${_tagdir}/tags

View File

@ -1,2 +0,0 @@
#/bin/sh
doas /sbin/mount_msdos -o nodev,nosuid,noatime -u 1000 -g 1000

128
.bin/pkg-depends Executable file
View File

@ -0,0 +1,128 @@
#!/bin/sh
# lazy config
_sqlports="/usr/local/share/sqlports"
_pkgpath="$(head -1 /etc/installurl)/$(uname -r)/packages/$(uname -m)"
_usage() {
echo "usage: pkg-depends [options] <pkgpath>"
echo "options: -r - include run dependencies (default)"
echo " -l - include lib dependencies (default)"
echo " -b - include build dependencies"
echo " -t - include test dependencies"
echo " -p - show packges names (default)"
echo " -P - show port paths"
echo " -d <dir> - download packages"
echo
echo "Only one flavor / subpackage in pkgpath(7) is supported."
exit 2
}
while getopts rlbtpPd: arg
do
case $arg in
l) _deps="$_deps 0" ;;
r) _deps="$_deps 1" ;;
b) _deps="$_deps 2" ;;
t) _deps="$_deps 3" ;;
p) _showmode=$(( _showmode + 1 )) ;;
P) _showmode=$(( _showmode + 2 )) ;;
d) _dldir=$OPTARG ;;
h) _usage ;;
?) _usage ;;
esac
done
shift $(($OPTIND - 1))
[ -z "$1" ] \
&& _usage
if [ ! -f $_sqlports ]
then
echo "$_sqlports not found. Install \"sqlports\" to use this script."
exit 1
fi
### FUNCTIONS
_do_pkg() {
echo "pkg-depends needs pkgpath(7) as argument, pkg_info -P can help."
echo "Here, I'm calling it for you:"
echo
echo "$ pkg_info -P $1"
pkg_info -P "$1"
exit 0
}
_do_sql() {
_query="
WITH RECURSIVE pkg(x) AS (
SELECT \"$1\"
UNION
SELECT distinct fulldepends FROM depends
JOIN pkg ON fullpkgpath=x WHERE type in ($2)
) SELECT x, fullpkgname FROM pkg
JOIN ports ON fullpkgpath=x;
"
sqlite3 "$_sqlports" "$_query" \
| cut -d: -f2
}
_handle_list() {
if [ -z "$_deps" ]
then
_deps="0,1"
else
_deps="$(echo "$_deps" \
| tr -s " " \
| sed 's/^ //g' \
| tr ' ' ',')"
fi
_list=$(_do_sql "$1" "$_deps")
_firstname=$(echo "$_list" | head -1 | cut -d"|" -f2)
echo "$_list" | sort -u | while read line
do
_portpath=$(echo "$line" | cut -d"|" -f1)
_pkgname=$(echo "$line" | cut -d"|" -f2)
if [ -n "$_dldir" ]
then
_extra="(downloading)"
fi
# default || both on
if [ -z "$_showmode" ] || [ "$_showmode" == "3" ]
then
echo "$_portpath ($_pkgname) $_extra"
fi
# pkgname only
if [ "$_showmode" == "1" ]
then
echo "$_pkgname $_extra"
fi
# portpath only
if [ "$_showmode" == "2" ]
then
echo "$_portpath $_extra"
fi
if [ -n "$_dldir" ]
then
mkdir -p "$_dldir"
ftp -MV -C -o $_dldir/$_pkgname.tgz $_pkgpath/$_pkgname.tgz
fi
done
if [ -n "$_dldir" ]
then
echo "Set the following environmane variables to enable offline installation:"
echo "export TRUSTED_PKG_PATH=\"$(readlink -f "$_dldir")\""
echo "export PKG_PATH=\"$(readlink -f "$_dldir")\""
echo "pkg_add $_firstname"
fi
}
### MAIN PROGRAM
case "$1" in
*/*) _handle_list "$1" ;;
*) _do_pkg "$1" ;;
esac

15
.bin/port-remake-mystuff Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh -xe
mystuff="
/usr/ports/mystuff/x11/st-sdk
/usr/ports/mystuff/www/luakit
/usr/ports/mystuff/sysutils/libtree
/usr/ports/sysutils/tarsnap
"
for p in $mystuff
do
cd $p
make clean=all
make reinstall
done

View File

@ -1,12 +1,17 @@
#!/bin/sh
#!/bin/sh -x
if [ -z "$1" ]
then
echo "usage: port-search <file pattern> <search term>"
echo "usage: port-search [file pattern] <search term>"
exit 2
fi
type="$1"
shift
if [ -n "$2" ]
then
_filter="-iname *$1*" \
_term="$2"
else
_term="$1"
fi
find /usr/ports/ \
-not \( -path "/usr/ports/pobj" -prune \
@ -16,5 +21,5 @@ find /usr/ports/ \
-o -path "*/CVS" -prune \
\) \
-type f \
-iname "$type" \
-exec ugrep -F -- "$@" {} +
$_filter \
-exec ugrep -i -F -- "$_term" {} +

View File

@ -50,12 +50,9 @@ _loop() {
[ "$1" == "max" ] \
&& xrandr --output $_primary --mode "$_max_res"
if [ "$1" == "b" ]
then
[ -z "$2" ] \
&& doas wsconsctl -n display.brightness \
|| doas wsconsctl display.brightness=$2
fi
case "$1" in
[0-9]*) doas wsconsctl display.brightness=$1 ;;
esac
[ "$1" == "r" ] && [ -n "$2" ] \
&& xrandr --output $_primary --mode "$2"
@ -76,7 +73,6 @@ then
echo
echo "Primary: $_primary"
echo "Connected: $_con_dev"
echo "Disconnected: $_dis_dev"
echo "Brightness: $(doas wsconsctl -n display.brightness)%"
echo
fi

View File

@ -4,8 +4,8 @@
require "lfs"
local unique_instance = require "unique_instance"
unique_instance.open_links_in_new_window = true
-- local unique_instance = require "unique_instance"
-- unique_instance.open_links_in_new_window = true
-- Set the number of web processes to use. A value of 0 means 'no limit'.
-- luakit.process_limit = 1
@ -39,7 +39,7 @@ window.add_signal("build", function (w)
l.layout:pack(widgets.uri())
l.layout:pack(widgets.hist())
l.layout:pack(widgets.progress())
-- l.layout:pack(widgets.zoom())
l.layout:pack(widgets.zoom())
-- Right-aligned status bar widgets
r.layout:pack(widgets.buf())
@ -55,20 +55,20 @@ local binds = require "binds"
-- Settings (the commented ones do not [yet] work)
local settings = require "settings"
-- local settings_chrome = require "settings_chrome"
local settings_chrome = require "settings_chrome"
-- settings.window.home_page = "luakit://newtab"
-- settings.window.scroll_step = 20
-- settings.window.zoom_step = 0.2
-- settings.webview.zoom_level = 125
-- settings.window.close_with_last_tab = true
--
-- -- search engines
-- settings.window.search_engines.ddg = "https://duckduckgo.com/?q=%s"
-- settings.window.search_engines.g = "https://google.com/?q=%s"
-- settings.window.search_engines.mg = "https://metager.org/?q=%s"
-- settings.window.search_engines.gh = "https://github.com/search?q=%s"
-- settings.window.search_engines.default = settings.window.search_engines.ddg
settings.window.scroll_step = 20
settings.window.zoom_step = 0.2
settings.webview.zoom_level = 90
settings.window.close_with_last_tab = true
-- search engines
settings.window.search_engines.ddg = "https://duckduckgo.com/?q=%s"
settings.window.search_engines.g = "https://google.com/?q=%s"
settings.window.search_engines.mg = "https://metager.org/?q=%s"
settings.window.search_engines.gh = "https://github.com/search?q=%s"
settings.window.search_engines.default = settings.window.search_engines.ddg
----------------------------------
-- Optional user script loading --
@ -82,25 +82,25 @@ local adblock_chrome = require "adblock_chrome"
local webinspector = require "webinspector"
-- Add uzbl-like form filling
-- local formfiller = require "formfiller"
-- formfiller.extend({
-- pass = function(s) return io.popen("pass " .. s):read() end
-- })
local formfiller = require "formfiller"
formfiller.extend({
pass = function(s) return io.popen("pass " .. s):read() end
})
-- Add proxy support & manager
-- local proxy = require "proxy"
local proxy = require "proxy"
-- Add quickmarks support & manager
-- local quickmarks = require "quickmarks"
local quickmarks = require "quickmarks"
-- Add session saving/loading support
local session = require "session"
-- local session = require "session"
-- Enable Gopher protocol support
local gopher = require "gopher"
-- Delete website data
-- local clear_data = require "clear_data"
local clear_data = require "clear_data"
-- Add command to list closed tabs & bind to open closed tabs
local undoclose = require "undoclose"
@ -121,7 +121,7 @@ local downloads_chrome = require "downloads_chrome"
downloads.default_dir = os.getenv("HOME") .. "/Downloads"
-- Add automatic PDF downloading and opening
local viewpdf = require "viewpdf"
-- local viewpdf = require "viewpdf"
-- Add vimperator-like link hinting & following
local follow = require "follow"
@ -133,7 +133,7 @@ local cmdhist = require "cmdhist"
local search = require "search"
-- Add ordering of new tabs
-- local taborder = require "taborder"
local taborder = require "taborder"
-- Save web history
local history = require "history"
@ -149,8 +149,8 @@ local completion = require "completion"
-- Press Control-E while in insert mode to edit the contents of the currently
-- focused <textarea> or <input> element, using `xdg-open`
-- local open_editor = require "open_editor"
-- local editor = require "editor"
-- editor.editor_cmd = "hterm vim {file}"
local editor = require "editor"
editor.editor_cmd = "sterm vim {file}"
-- NoScript plugin, toggle scripts and or plugins on a per-domain basis.
-- `,ts` to toggle scripts, `,tp` to toggle plugins, `,tr` to reset.
@ -164,7 +164,7 @@ local go_next_prev = require "go_next_prev"
local go_up = require "go_up"
-- Filter Referer HTTP header if page domain does not match Referer domain
-- require_web_module("referer_control_wm")
require_web_module("referer_control_wm")
local error_page = require "error_page"
@ -182,21 +182,21 @@ follow.stylesheet = follow.stylesheet .. [===[
]===]
-- Hide scrollbars on all pages
-- local hide_scrollbars = require "hide_scrollbars"
local hide_scrollbars = require "hide_scrollbars"
-- local vertical_tabs = require "vertical_tabs"
-- Add a stylesheet when showing images
-- local image_css = require "image_css"
local image_css = require "image_css"
-- -- Add a new tab page
-- local newtab_chrome = require "newtab_chrome"
-- newtab_chrome.new_tab_src = [==[
-- <html>
-- <head><title>New Tab</title></head>
-- <body bgcolor=black></body>
-- </html>
-- ]==]
local newtab_chrome = require "newtab_chrome"
newtab_chrome.new_tab_src = [==[
<html>
<head><title>New Tab</title></head>
<body bgcolor=black></body>
</html>
]==]
-- Add tab favicons mod
local tab_favicons = require "tab_favicons"
@ -207,7 +207,7 @@ local tab_favicons = require "tab_favicons"
-- tablist.min_width = 100
-- Add :view-source command
-- local view_source = require "view_source"
local view_source = require "view_source"
-- Use "asdfqwerzxcv" for generating labels
local select = require "select"
@ -261,31 +261,31 @@ follow.pattern_maker = follow.pattern_styles.match_label
-- end)
-- social media blocker
-- local webview = require "webview"
-- webview.add_signal('init', function (view)
-- view:add_signal('navigation-request', function(v, uri)
-- local blocklist_pattern = {
-- "facebook.com",
-- ".fb.com",
-- ".fbcdn.com",
-- ".fbsbx.com",
-- ".fbcdn.net",
-- ".tfbnw.net",
-- "whatsapp.com",
-- "online-metrix.net",
-- ".fb.me",
-- "facebook-web-clients.appspot.com",
-- "fbcdn-profile-a.akamaihd.net"
-- }
-- for key,value in ipairs(blocklist_pattern)
-- do
-- if v.uri:match(value) then
-- print("Navigation request to " .. v.uri .. " blocked.")
-- return false
-- end
-- end
-- end)
-- end)
local webview = require "webview"
webview.add_signal('init', function (view)
view:add_signal('navigation-request', function(v, uri)
local blocklist_pattern = {
"facebook.com",
".fb.com",
".fbcdn.com",
".fbsbx.com",
".fbcdn.net",
".tfbnw.net",
"whatsapp.com",
"online-metrix.net",
".fb.me",
"facebook-web-clients.appspot.com",
"fbcdn-profile-a.akamaihd.net"
}
for key,value in ipairs(blocklist_pattern)
do
if v.uri:match(value) then
print("Navigation request to " .. v.uri .. " blocked.")
return false
end
end
end)
end)
-----------------------------
-- End user script loading --

View File

@ -1 +1,4 @@
set startup-quietly on
set follow-fork-mode parent
set detach-on-fork off
set schedule-multiple on

View File

@ -6,7 +6,7 @@ python
# License ----------------------------------------------------------------------
# Copyright (c) 2015-2023 Andrea Cardaci <cyrus.and@gmail.com>
# Copyright (c) 2015-2024 Andrea Cardaci <cyrus.and@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ -346,7 +346,7 @@ def fetch_breakpoints(watchpoints=False, pending=False):
parsed_breakpoints[number] = [address_info], is_pending, ''
elif len(fields) >= 5 and fields[1] == 'catchpoint':
# only take before comma, but ignore commas in quotes
what = catch_what_regex.search(' '.join(fields[4:]))[0].strip()
what = catch_what_regex.search(' '.join(fields[4:])).group(0).strip()
parsed_breakpoints[number] = [], False, what
elif len(fields) >= 3 and number in parsed_breakpoints:
# add this address to the list of multiple locations

30
.kshrc
View File

@ -202,19 +202,25 @@ alias mygit-track="git add --intent-to-add"
alias mygit-update="git fetch --all"
alias mygit-diff="git difftool -y ..origin/HEAD"
alias mygit-log="git log --graph"
alias mygit-branch="git --no-pager branch --all"
alias mygit-list-branches="git --no-pager branch --all"
alias mygit-delete-branch="git branch -D"
mygit-upstream-sync() {
if [ -z "$1" ]
then
echo "sync with which upstream branch?"
return
fi
set -xe
git fetch upstream
git checkout $1
git merge upstream/$1
git push origin $1
}
mygit-checkout() {
_local="$(echo "$1" | sed 's,remotes/,,g;s,origin/,,g;')"
git checkout -b $_local $1
}
alias mygit-changed-files="git --no-pager whatchanged origin/HEAD..HEAD | grep -E '^:' | awk '{ print \$6; }'"
mygit-diffbranch() {
for file in $(mygit-changed-files)
do
git difftool -y ..origin/HEAD
done
}
mygot-clone() {
if test -z "$1" || test -z "$2"
@ -373,11 +379,13 @@ rem-edit() {
scp -q sdk@home.codevoid.de:.reminders/$1.rem ~sdk/.reminders/$1.rem
}
rem-edit-uugrn() {
vim sftp://vorstand@vorstand.uugrn.org/.reminders/uugrn.rem
scp -q vorstand@vorstand.uugrn.org:.reminders/uugrn.rem ~sdk/.reminders/uugrn.rem
scp -q ~sdk/.reminders/uugrn.rem vorstand@vorstand.uugrn.org:private/Kalender/uugrn.rem
# edit remote file
vim sftp://vorstand@vorstand.uugrn.org/private/Kalender/uugrn.rem
# update local file
scp -q sdk@vorstand.uugrn.org:~vorstand/private/Kalender/uugrn.rem ~sdk/.reminders/uugrn.rem
# run update script
ssh sdk@vorstand.uugrn.org sh \
~sdk/.bin/make_calendar.sh \
~vorstand/private/Kalender/scripts/make_calendar.sh \
|| true
}

File diff suppressed because one or more lines are too long

View File

@ -1,46 +0,0 @@
@-moz-document domain(old.reddit.com) {
* {
background-color: #181818 !important;
color: #CCC !important;
border-color: #555 !important;
border-width: 0px !important;
}
.premium-banner-outer, .premium-banner {
display: none !important;
}
#header-img.default-header, .side {
display: none !important;
}
.link.promotedlink.promoted, .link.promotedlink.external {
display: none !important;
}
.footer-parent {
display: none !important;
}
.happening-now-wrap {
display: none !important;
}
.stickied {
display: none !important;
}
input, textarea, button {
background-color: #282828 !important;
}
a {
font-style: oblique !important;
}
.expando-button, .thumbnail, .rank, .midcol {
display: none !important;
}
.top-matter, .top-matter > *, .top-matter > * > *, .top-matter > * > * > *, .top-matter > * > * > * > * {
background-color: #222 !important;
}
.linkflairlabel, .linkflairlabel > * {
background-color: #999 !important;
color: #121212 !important;
}
.entry {
border-left: 5px solid darkred !important;
padding-left: 5px !important;
}
}

View File

@ -33,3 +33,5 @@ color body green default "^\\+"
color body green default "^\\+.*"
color body green default "> \\+.*"
color index red default '~F' # flagged
color index green default '@~f .' # aliased

View File

@ -319,4 +319,9 @@ set crypt_opportunistic_encrypt_strong_keys = yes # autoselect key with trust fu
set autocrypt = no
set pgp_use_gpg_agent = yes
set alias_file=~/.mutt/aliases
set sort_alias = alias
set reverse_alias = yes
source ~/.mutt/aliases
source ~/.mutt/colors/codevoid

View File

@ -22,6 +22,8 @@ read _reply < /dev/tty
if [ -z "$_reply" ]
then
_path="$PWD"
else
_path="$_reply"
fi
# shortcuts!!!
@ -36,7 +38,7 @@ esac
if [ ! -d "$_path" ]
then
_path="$(port-jump $_path)"
_path="$(port-jump "$_path")"
fi
print "Using: $_path"

35
.vim/bin/findtagsdir Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
gitdir() {
_path="$PWD"
while [ -n "$_path" ]
do [ -d "$_path/.git" ] \
&& echo "$_path" \
&& break
_path="${_path%/*}"
done
}
cvsdir() {
_path="$PWD"
while [ -n "$_path" ]
do
[ ! -d "$_path/../CVS" ] \
&& echo "$_path" \
&& break
_path="${_path%/*}"
done
}
_gitdir="$(gitdir)"
_cvsdir="$(cvsdir)"
if [ -n "$_gitdir" ]
then
echo "$_gitdir/.git"
elif [ -n "$_cvsdir" ]
then
echo "$_cvsdir/.tags"
else
echo "$PWD/.tags"
fi

View File

@ -220,7 +220,9 @@ let g:netrw_winsize = 25
hi! link netrwMarkFile Search
" TAGS FILE
set tags=.git/tags; " Search tagfile backward recursive
let tagsdir = trim(system("$HOME/.vim/bin/findtagsdir"))
execute "set tags=".tagsdir."/tags"
"set tags=.git/tags;.tags/tags; " Search tagfile backward recursive
nnoremap gt <c-]> " Jump to tag (go tag)
nnoremap gb <c-o> " Jump to last position (go back)
nnoremap gh :FSHere<CR> " Jump to header file (go header)
@ -232,20 +234,11 @@ if has("cscope")
set csprg=cscope
set cst
set cspc=3
if filereadable("cscope.out")
cs add cscope.out
elseif filereadable(".git/cscope.out")
cs add .git/cscope.out
elseif filereadable($CSCOPEDB)
if empty($CSCOPEDB)
let $CSCOPEDB=tagsdir.."/cscope.out"
endif
if filereadable($CSCOPEDB)
cs add $CSCOPEDB
elseif filereadable("../.git/cscope.out")
cs add ../.git/cscope.out
elseif filereadable("../../.git/cscope.out")
cs add ../../.git/cscope.out
elseif filereadable("../../../.git/cscope.out")
cs add ../../../.git/cscope.out
elseif filereadable("../../../../.git/cscope.out")
cs add ../../../../.git/cscope.out
endif
" 'ts' symbol: find all references to the token under cursor
" 'tg' global: find global definition(s) of the token under cursor
@ -280,7 +273,6 @@ nmap em :!vim Makefile<CR><CR>
nmap st :!smake . test<CR>
nmap sm :!smake . <CR>
let s:enablepaste = 0
function! TogglePasteMode()
if s:enablepaste
@ -318,7 +310,7 @@ xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
" CUSTOM: AUTO BRACKET
inoremap {<CR> {<CR> <CR>}<up><right>
inoremap {<cr> {<cr> <cr>}<up><end><c-h>
" CUSTOM: TREAT C FILES AS C, NOT C++
augroup Programming