From 9f55042b33607d66f22b7bd1252b6622cb479c57 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Tue, 31 Dec 2024 10:47:38 +0100 Subject: [PATCH] Update 2024-12-31 10:47 OpenBSD/amd64-t14 --- .bin/_config | 3 +- .bin/dexec_browser | 4 +- .bin/format.sh | 29 --- .bin/g | 4 + .bin/ical2rem | 296 -------------------------- .bin/luakit-env | 8 +- .bin/maketags | 67 +++++- .bin/mount_msdos | 2 - .bin/pkg-depends | 128 +++++++++++ .bin/port-remake-mystuff | 15 ++ .bin/port-search | 17 +- .bin/scr | 10 +- .config/luakit/rc.lua | 126 +++++------ .gdbearlyinit | 3 + .gdbinit | 4 +- .kshrc | 30 ++- .kshrc.autocomplete | 6 +- .local/share/luakit/styles/reddit.css | 46 ---- .mutt/colors/codevoid | 2 + .mutt/rc-common | 5 + .mutt/scripts/patch.sh | 4 +- .vim/bin/findtagsdir | 35 +++ .vim/vimrc | 24 +-- 23 files changed, 369 insertions(+), 499 deletions(-) delete mode 100755 .bin/format.sh delete mode 100755 .bin/ical2rem delete mode 100755 .bin/mount_msdos create mode 100755 .bin/pkg-depends create mode 100755 .bin/port-remake-mystuff delete mode 100644 .local/share/luakit/styles/reddit.css create mode 100755 .vim/bin/findtagsdir diff --git a/.bin/_config b/.bin/_config index 35f2658..03c9d22 100644 --- a/.bin/_config +++ b/.bin/_config @@ -69,7 +69,8 @@ needs() { || add="$add $x" done [ ! -z "$add" ] \ - && doas pkg_add -- $add + && doas pkg_add -- $add \ + || true } # diff --git a/.bin/dexec_browser b/.bin/dexec_browser index f229876..35a49ef 100755 --- a/.bin/dexec_browser +++ b/.bin/dexec_browser @@ -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 & diff --git a/.bin/format.sh b/.bin/format.sh deleted file mode 100755 index 5f6adeb..0000000 --- a/.bin/format.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -e - -_dev="$1" - -[ -z $_dev ] && printf "usage: %s \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" diff --git a/.bin/g b/.bin/g index 6b5d0ec..9ad71e2 100755 --- a/.bin/g +++ b/.bin/g @@ -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 )) diff --git a/.bin/ical2rem b/.bin/ical2rem deleted file mode 100755 index 31166a6..0000000 --- a/.bin/ical2rem +++ /dev/null @@ -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 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 : diff --git a/.bin/luakit-env b/.bin/luakit-env index a9ab46b..e9ac579 100755 --- a/.bin/luakit-env +++ b/.bin/luakit-env @@ -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 diff --git a/.bin/maketags b/.bin/maketags index 5a7e153..967d08e 100755 --- a/.bin/maketags +++ b/.bin/maketags @@ -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 diff --git a/.bin/mount_msdos b/.bin/mount_msdos deleted file mode 100755 index e64c366..0000000 --- a/.bin/mount_msdos +++ /dev/null @@ -1,2 +0,0 @@ -#/bin/sh -doas /sbin/mount_msdos -o nodev,nosuid,noatime -u 1000 -g 1000 diff --git a/.bin/pkg-depends b/.bin/pkg-depends new file mode 100755 index 0000000..e199f48 --- /dev/null +++ b/.bin/pkg-depends @@ -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] " + 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 - 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 diff --git a/.bin/port-remake-mystuff b/.bin/port-remake-mystuff new file mode 100755 index 0000000..9e25c1e --- /dev/null +++ b/.bin/port-remake-mystuff @@ -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 diff --git a/.bin/port-search b/.bin/port-search index 1018e0b..1b59a38 100755 --- a/.bin/port-search +++ b/.bin/port-search @@ -1,12 +1,17 @@ -#!/bin/sh +#!/bin/sh -x if [ -z "$1" ] then - echo "usage: port-search " + echo "usage: port-search [file pattern] " 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" {} + diff --git a/.bin/scr b/.bin/scr index 1b2ab34..f4af770 100755 --- a/.bin/scr +++ b/.bin/scr @@ -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 diff --git a/.config/luakit/rc.lua b/.config/luakit/rc.lua index 4ac563b..6506ee2 100644 --- a/.config/luakit/rc.lua +++ b/.config/luakit/rc.lua @@ -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