diff options
author | Andreas Fankhauser | 2022-12-15 14:11:24 +0100 |
---|---|---|
committer | Andreas Fankhauser | 2022-12-15 14:11:24 +0100 |
commit | d124dd09ad78f2ad27f21e0dcb7e5caa900445e2 (patch) | |
tree | cb4a3b8641d62f1bb6bde441534c366977e01c37 | |
parent | 22edfe11d14d7352f688ecd21559665437fa42ce (diff) | |
parent | 61ecc7842fb3582f6ae4eb1ff1ee1cc6ed096aa1 (diff) | |
download | dotfiles-d124dd09ad78f2ad27f21e0dcb7e5caa900445e2.zip dotfiles-d124dd09ad78f2ad27f21e0dcb7e5caa900445e2.tar.gz |
Merge upstream changes from gh master to local master
Conflicts:
src/git/_gitconfig
-rw-r--r-- | LICENSE.txt | 14 | ||||
-rw-r--r-- | README.txt | 18 | ||||
-rw-r--r-- | src/bash/_bashrc | 17 | ||||
-rw-r--r-- | src/bin/my-git-status-recursive | 11 | ||||
-rw-r--r-- | src/bin/vol-dec | 8 | ||||
-rw-r--r-- | src/bin/vol-inc | 8 | ||||
-rw-r--r-- | src/bin/wallpaper-set.sh | 4 | ||||
-rw-r--r-- | src/bin/xrandr-dual.sh | 3 | ||||
-rw-r--r-- | src/bin/xrandr-lg4k-fujitsuLeftHi | 34 | ||||
-rw-r--r-- | src/dockerfiles/debian-cxx.Dockerfile | 25 | ||||
-rw-r--r-- | src/dockerfiles/debian-jni.Dockerfile | 28 | ||||
-rw-r--r-- | src/file-templates/scriptlee.lua | 62 | ||||
-rw-r--r-- | src/firewall/src-allowAll | 6 | ||||
-rw-r--r-- | src/firewall/src-default | 4 | ||||
-rw-r--r-- | src/git/_gitconfig | 61 | ||||
-rw-r--r-- | src/openbox/autostart | 24 | ||||
-rw-r--r-- | src/openbox/autostart.sh | 12 | ||||
-rw-r--r-- | src/openbox/environment | 5 | ||||
-rw-r--r-- | src/openbox/rc.parts.xml | 6 | ||||
-rw-r--r-- | src/session-init/setup-env | 4 | ||||
-rw-r--r-- | src/session-init/setup-gui | 4 | ||||
-rw-r--r-- | src/session-init/setup-shell | 4 | ||||
-rw-r--r-- | src/vi/_vimrc | 2 | ||||
-rw-r--r-- | src/windoof/cross-compile/README.txt | 61 |
24 files changed, 275 insertions, 150 deletions
diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..98a361e --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,14 @@ +
+Copyright (c) 2017-2022 Andreas Fankhauser
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
@@ -1,13 +1,23 @@ -Personal Settings -================= +My Dotfiles +================ -My dotfiles. +See also +https://git.hiddenalpha.ch/UnspecifiedGarbage.git/tree +for more handy nonsense. +Shell pipes error handling: -Windoof drivers get installed to + https://www.shellscript.sh/tips/pipestatus/ + + +Windoof drivers installation location: C:\Windows\System32\DriverStore\FileRepository +ytdl srf full-url: + + srgssr:srf:video:{hash} + diff --git a/src/bash/_bashrc b/src/bash/_bashrc index aa512c7..af3ee3e 100644 --- a/src/bash/_bashrc +++ b/src/bash/_bashrc @@ -1,19 +1,20 @@ -WINDOOF=$(if test -d /c/Windows; then echo true; else echo false; fi) +WINDOOF=$(if [ -d /c/Windows ]; then echo true; else echo false; fi) -if test -d ~/.bin ; then +if [ -d ~/.bin ]; then PATH=~/.bin:$PATH fi +alias docker='sudo docker' + # Add global node modules to path #PATH=/opt/node-6.10.1/lib/node_modules/.bin:$PATH # bash completion for npm (nodePackageManager) #source /opt/node-6.10.1/etc/npm-completion.sh -# Load user scoped settings. -#source ~/.config/user/setup-env -#source ~/.config/user/setup-shell +# Load (aka source) user scoped settings. +#. ~/.config/user/setup-env if $WINDOOF; then @@ -21,9 +22,7 @@ if $WINDOOF; then # ssh-agent (See: https://docs.github.com/en/github/authenticating-to-github/working-with-ssh-key-passphrases#auto-launching-ssh-agent-on-git-for-windows) env=~/.ssh/agent.env agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } - agent_start () { - (umask 077; ssh-agent >| "$env") - . "$env" >| /dev/null ; } + agent_start () { (umask 077; ssh-agent >| "$env"); . "$env" >| /dev/null ; } agent_load_env agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?) if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then @@ -34,7 +33,7 @@ if $WINDOOF; then # Fix vim-behind-ssh on windoof # TODO this fixes the remote shell, but breaks the local one (Eg del prints # tilde). Grr .... - #if test -n "$ConEmuBuild"; then TERM=dumb; export TERM; fi + #if [ -n "$ConEmuBuild" ]; then TERM=dumb; export TERM; fi fi diff --git a/src/bin/my-git-status-recursive b/src/bin/my-git-status-recursive deleted file mode 100644 index 368e222..0000000 --- a/src/bin/my-git-status-recursive +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -find -type d -name ".git" \ - | while read x ; do \ - x=`dirname $x`; \ - echo -e "\n-------------------------------------------------------------------------------\n$x"; \ - pushd $x; \ - git status; - popd > /dev/null; - done - diff --git a/src/bin/vol-dec b/src/bin/vol-dec index 1a76527..28b9834 100644 --- a/src/bin/vol-dec +++ b/src/bin/vol-dec @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/sh -source functions +. functions function main { @@ -13,8 +13,8 @@ function main { vol=$(expr $vol - 3) # Make sure to not exceed limits. - if [ $vol -lt 0 ]; then vol=0 ; fi - if [ $vol -gt 100 ]; then vol=100; fi + if test $vol -lt 0; then vol=0 ; fi + if test $vol -gt 100; then vol=100; fi # Set calculated volume my-pa-setdefaultsinkvolpercent $vol diff --git a/src/bin/vol-inc b/src/bin/vol-inc index abb6ccd..411595f 100644 --- a/src/bin/vol-inc +++ b/src/bin/vol-inc @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/sh -source functions +. functions function main { @@ -13,8 +13,8 @@ function main { vol=$(expr $vol + 3) # Make sure to not exceed limits. - if [ $vol -lt 0 ]; then vol=0 ; fi - if [ $vol -gt 100 ]; then vol=100; fi + if test $vol -lt 0; then vol=0 ; fi + if test $vol -gt 100; then vol=100; fi # Set new volume. my-pa-setdefaultsinkvolpercent $vol diff --git a/src/bin/wallpaper-set.sh b/src/bin/wallpaper-set.sh deleted file mode 100644 index 1e9d1cc..0000000 --- a/src/bin/wallpaper-set.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -feh --randomize --bg-fill ~/.config/wallpapers/* - diff --git a/src/bin/xrandr-dual.sh b/src/bin/xrandr-dual.sh index cbde316..f84c415 100644 --- a/src/bin/xrandr-dual.sh +++ b/src/bin/xrandr-dual.sh @@ -1,6 +1,7 @@ #!/bin/sh -echo "TODO: Needs configuration."; exit 1; +echo "TODO: Needs configuration."; +exit 1; xrandr --output HDMI-1 --auto --pos 0x0 --primary \ --output eDP-1 --preferred --pos 1920x100 diff --git a/src/bin/xrandr-lg4k-fujitsuLeftHi b/src/bin/xrandr-lg4k-fujitsuLeftHi new file mode 100644 index 0000000..406dfa9 --- /dev/null +++ b/src/bin/xrandr-lg4k-fujitsuLeftHi @@ -0,0 +1,34 @@ + +# I suspect the lxpanel to destroy the intel driver in some way. So kill it +# before we begin. +pkill lxpanel + +# Secondary monitor (Fujitsu) +# Using lower resolution so scale matches the other screen better +# Native: 1920x1200 +# Scaled: 1440x900 +xrandr \ + --output DP-1 \ + --mode 1440x900 \ + --rate 60.00 \ + --rotate left + +sleep 0.1 + +# Primary monitor (LG 4k) +# "pos" is to have it right of the 2nd-dary monitor. +xrandr \ + --output HDMI-3 \ + --mode 1920x1080 \ + --rate 60.00 \ + --pos 900x310 + +sleep 0.1 + +# Wallpaper +feh --bg-tile "/home/andreas/.config/wallpaper/gfx/wallpaper-bricks-infinite.jpg" + +# Start (previously killed) panel again +sleep 0.1 +lxpanel 2>/dev/null & + diff --git a/src/dockerfiles/debian-cxx.Dockerfile b/src/dockerfiles/debian-cxx.Dockerfile deleted file mode 100644 index f35e6a9..0000000 --- a/src/dockerfiles/debian-cxx.Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# -# Debian with C++ compiler. -# -# Usage: -# -# IMG=debian-cxx:latest -# CNTNR=debian-cxx -# curl -sSL "https://git.hiddenalpha.ch/dotfiles.git/plain/src/dockerfiles/debian-cxx.Dockerfile" | sudo docker build . -f - -t "${IMG:?}" -# sudo docker container create --name "${CNTNR:?}" -v "${PWD:?}:/work" "${IMG:?}" -# sudo docker start "${CNTNR:?}" -# sudo docker exec -ti "${CNTNR:?}" bash -# - -FROM debian:buster-20220622-slim - -RUN true \ - && apt update \ - && apt install -y --no-install-recommends \ - g++ make \ - && apt clean \ - && true - -USER 1000:1000 -WORKDIR /work -CMD ["sleep", "36000"] diff --git a/src/dockerfiles/debian-jni.Dockerfile b/src/dockerfiles/debian-jni.Dockerfile deleted file mode 100644 index 90e2015..0000000 --- a/src/dockerfiles/debian-jni.Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# -# Debian with tools for java-native-interface development. -# -# Usage: -# -# IMG=debian-jni:latest -# CNTNR=debian-jni -# curl -sSL "https://git.hiddenalpha.ch/dotfiles.git/plain/src/dockerfiles/debian-jni.Dockerfile" | sudo docker build . -f - -t "${IMG:?}" -# sudo docker container create --name "${CNTNR:?}" -v "${PWD:?}:/work" "${IMG:?}" -# sudo docker start "${CNTNR:?}" -# sudo docker exec -ti "${CNTNR:?}" bash -# - -FROM debian:buster-20220622-slim - -ENV \ - JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 - -RUN true \ - && apt update \ - && apt install -y --no-install-recommends \ - g++ make openjdk-11-jdk-headless \ - && apt clean \ - && true - -USER 1000:1000 -WORKDIR /work -CMD ["sleep", "36000"] diff --git a/src/file-templates/scriptlee.lua b/src/file-templates/scriptlee.lua new file mode 100644 index 0000000..75da940 --- /dev/null +++ b/src/file-templates/scriptlee.lua @@ -0,0 +1,62 @@ + +local objectSeal = assert(require("scriptlee").objectSeal) + +local inn, out, log = io.stdin, io.stdout, io.stderr +local mod = {} + + +function mod.getExports()return{ + --doWhatever = mod.doWhatever, +}end + + +function mod.printHelp() + out:write("\n" + .." TODO write this help page\n" + .."\n" + .." Options:\n" + .."\n") +end + + +function mod.parseArgs( app ) + local positionalArgNr = 0 + local iA = 0 + while true do iA = iA +1 + local arg = _ENV.arg[iA] + if not arg then + break + elseif arg == "--help" then + mod.printHelp() return -1 + elseif not arg:find("^%-%-") then + positionalArgNr = positionalArgNr + 1 + if false then + --elseif positionalArgNr == 1 then + -- app.whatever = arg + else + log:write("Unexpected arg: ".. arg .."\n")return -1 + end + else + log:write("Unexpected arg: ".. arg .."\n")return -1 + end + end + if not app.whatever then log:write("TODO write errmsg here\n")return -1 end + return 0 +end + + +function mod.run( app ) + log:write("[INFO ] TODO impl what the prog should do\n") +end + + +function mod.main() + local app = objectSeal{ + whatever = false, + } + if mod.parseArgs(app) ~= 0 then os.exit(1) end + mod.run(app) +end + + +if debug.getinfo(3)then return mod.getExports()else mod.main()end diff --git a/src/firewall/src-allowAll b/src/firewall/src-allowAll index 009310a..2504c22 100644 --- a/src/firewall/src-allowAll +++ b/src/firewall/src-allowAll @@ -1,8 +1,6 @@ -############################################################################### -# Disable v4 filtering completely -# -############################################################################### +# Effectifely disable firewall +# HINT: Probably breaks docker networking. Restart dockerd to fix. *filter diff --git a/src/firewall/src-default b/src/firewall/src-default index 0c04995..ae66476 100644 --- a/src/firewall/src-default +++ b/src/firewall/src-default @@ -138,6 +138,10 @@ #-A OUTPUT -o vboxnet0 -j ACCEPT #-A INPUT -i vboxnet0 -j ACCEPT +# Allow all docker servers +#-A OUTPUT -o docker0 -m state --state NEW,RELATED -j ACCEPT +#-A INPUT -i docker0 -m state --state ESTABLISHED,RELATED -j ACCEPT + # Some client ports for debugging. #-A OUTPUT -p tcp -m tcp --match multiport --dports 10000:10010 -j ACCEPT #-A INPUT -p tcp -m state --state ESTABLISHED,RELATED --match multiport --sports 10000:10010 -j ACCEPT diff --git a/src/git/_gitconfig b/src/git/_gitconfig index b40caed..ef17fe0 100644 --- a/src/git/_gitconfig +++ b/src/git/_gitconfig @@ -1,48 +1,49 @@ [user] -email = https://hiddenalpha.ch/slnk/id/1:c0n74ct -name = user@host + email = 23085769+hiddenalpha@users.noreply.github.com + name = Andreas Fankhauser hiddenalpha.ch [merge] -tool = meld -ff = no + ff = no + tool = meld [pull] -ff = yes + ff = yes [push] -default = simple + default = simple [log] -date = iso + date = iso [alias] -detach = checkout --detach -l = log --graph --decorate --date-order -la = log --graph --decorate --date-order --all -l1 = log --graph --decorate --date-order -n1 -l2 = log --graph --decorate --date-order -n2 -l3 = log --graph --decorate --date-order -n3 -l4 = log --graph --decorate --date-order -n4 -l5 = log --graph --decorate --date-order -n5 -l6 = log --graph --decorate --date-order -n6 -l7 = log --graph --decorate --date-order -n7 -l8 = log --graph --decorate --date-order -n8 -l9 = log --graph --decorate --date-order -n9 -mb = merge-base -d = diff -dc = diff --cached -dh = diff HEAD -s = status -co = checkout -br = branch -bra = !git br && git br -r -delmerged = !git br -d $(find .git/refs/heads -type f|cut -c17-) + br = branch + bra = !git br && git br -r + co = checkout + d = diff + dc = diff --cached + dh = diff HEAD + detach = checkout --detach + l = log --graph --decorate --date-order + l1 = log --graph --decorate --date-order -n1 + l2 = log --graph --decorate --date-order -n2 + l3 = log --graph --decorate --date-order -n3 + l4 = log --graph --decorate --date-order -n4 + l5 = log --graph --decorate --date-order -n5 + l6 = log --graph --decorate --date-order -n6 + l7 = log --graph --decorate --date-order -n7 + l8 = log --graph --decorate --date-order -n8 + l9 = log --graph --decorate --date-order -n9 + la = log --graph --decorate --date-order --all + mb = merge-base + s = status + rimraf = ! git clean -df && git reset --hard HEAD + delmerged = !git br -d $(find .git/refs/heads -type f|cut -c17-) [color] -ui = always + ui = always # Helpful to get mouse scrollable diff in some terminals #[core] -#pager = less -R -+X +# pager = less -R -+X diff --git a/src/openbox/autostart b/src/openbox/autostart new file mode 100644 index 0000000..2f63e2f --- /dev/null +++ b/src/openbox/autostart @@ -0,0 +1,24 @@ +# +# Put this file to: "~/.config/openbox/autostart" +# + +# mouse acceleration +#xset mouse 3/1 0 + +#numlockx on + +# Screen lock daemon +light-locker --lock-on-suspend --lock-after-screensaver=600 & + +# Restore last used desktop wallpaper +# For example create file "~/.fehbg" and fill with: +# feh --bg-tile your/wallpaper.png +# TODO any need to launch in background? +if test -e ~/.fehbg; then ~/.fehbg; fi + +#lxpanel & +#xscreensaver & + +# Launch a term as powerusers need one anyway. +#x-terminal-emulator & + diff --git a/src/openbox/autostart.sh b/src/openbox/autostart.sh deleted file mode 100644 index 5daf214..0000000 --- a/src/openbox/autostart.sh +++ /dev/null @@ -1,12 +0,0 @@ -# -# "~/.config/openbox/autostart.sh" -# - -source ~/.config/user/setup-gui - -lxpanel & -xscreensaver & -~/.bin/wallpaper-set.sh & - -x-terminal-emulator & - diff --git a/src/openbox/environment b/src/openbox/environment index 2fcf133..e89f6b2 100644 --- a/src/openbox/environment +++ b/src/openbox/environment @@ -1,6 +1,7 @@ # -# "~/.config/openbox/environment" +# Put this file to: "~/.config/openbox/environment" # -source ~/.config/user/setup-env +# Delegate to that other file so we can have environ in ONE place. +. ~/.config/user/setup-env diff --git a/src/openbox/rc.parts.xml b/src/openbox/rc.parts.xml index f4eb8ff..454ff3d 100644 --- a/src/openbox/rc.parts.xml +++ b/src/openbox/rc.parts.xml @@ -1,6 +1,6 @@ -<!-- ********************************************************************** --> -<!-- Parts for "~/.config/openbox/rc.xml". --> -<!-- ********************************************************************** --> +<!-- *************************************************************** --> +<!-- Parts for "~/.config/openbox/rc.xml". --> +<!-- *************************************************************** --> <!-- General shortcuts --> <openbox_config> diff --git a/src/session-init/setup-env b/src/session-init/setup-env index 98fd924..3c4fcae 100644 --- a/src/session-init/setup-env +++ b/src/session-init/setup-env @@ -1,5 +1,7 @@ # -# "~/.config/user/setup-env" +# Put this file to: "~/.config/user/setup-env" +# +# Used by eg "~/.config/openbox/environment". # # Make sure launchers (eg gmrun) are able to find custom executables. diff --git a/src/session-init/setup-gui b/src/session-init/setup-gui deleted file mode 100644 index 8da24a6..0000000 --- a/src/session-init/setup-gui +++ /dev/null @@ -1,4 +0,0 @@ -# -# "~/.config/user/setup-gui" -# - diff --git a/src/session-init/setup-shell b/src/session-init/setup-shell deleted file mode 100644 index d16b645..0000000 --- a/src/session-init/setup-shell +++ /dev/null @@ -1,4 +0,0 @@ -# -# "~/.config/user/setup-shell" -# - diff --git a/src/vi/_vimrc b/src/vi/_vimrc index 5430b5b..cca102a 100644 --- a/src/vi/_vimrc +++ b/src/vi/_vimrc @@ -81,6 +81,8 @@ set autoindent set clipboard= set backspace=2 set encoding=utf-8 +set fileformat=unix +set fileformats=unix, dos set linebreak set nobackup set nowritebackup diff --git a/src/windoof/cross-compile/README.txt b/src/windoof/cross-compile/README.txt new file mode 100644 index 0000000..a21c9c4 --- /dev/null +++ b/src/windoof/cross-compile/README.txt @@ -0,0 +1,61 @@ + +Some notes about cross compilation for windoof +============================================== + +Packages (alpine): + + mingw-w64-gcc + + +make (eg via MAKE_OPTS): + + CC=x86_64-w64-mingw32-gcc + AR=x86_64-w64-mingw32-ar + CPP=x86_64-w64-mingw32-cpp + CXX=x86_64-w64-mingw32-g++ + LD=x86_64-w64-mingw32-ld + NM=x86_64-w64-mingw32-nm + BINEXT=.exe + LIBSEXT=.lib + LIBDPRE= + LIBDEXT=.dll + LIBSPREF= + LIBSSUFF=.lib + + +DeflateAndInflate: + + MAKE_OPTS="CC=x86_64-w64-mingw32-gcc BINEXT=.exe" + PKGS_TO_ADD="curl git make tar zlib-dev mingw-w64-gcc" + PKGS_TO_DEL="curl git make tar zlib-dev mingw-w64-gcc" + add_zlib_snip + + +zlib: + + && echo "\n Build zlib\n" \ + && VERSION="1.2.11" \ + && THEOLDPWD="$PWD" \ + && cd /tmp \ + && curl -LsS -o "/tmp/zlib-${VERSION}.tgz" "https://github.com/madler/zlib/archive/refs/tags/v${VERSION:?}.tar.gz" \ + && tar xzf "/tmp/zlib-${VERSION:?}.tgz" \ + && export SRCDIR="/tmp/zlib-${VERSION:?}" \ + && mkdir $SRCDIR/build \ + && cd "${SRCDIR:?}" \ + && export DESTDIR=./build BINARY_PATH=/bin INCLUDE_PATH=/include LIBRARY_PATH=/lib \ + && sed -i "s;^PREFIX =.\*\$;;" win32/Makefile.gcc \ + && make -e -fwin32/Makefile.gcc PREFIX=x86_64-w64-mingw32- \ + && make -e -fwin32/Makefile.gcc install PREFIX=x86_64-w64-mingw32- \ + && unset DESTDIR BINARY_PATH INCLUDE_PATH LIBRARY_PATH \ + && cp README build/. \ + && (cd build && rm -rf lib/pkgconfig) \ + && (cd build && find -type f -not -name MD5SUM -exec md5sum -b {} + > MD5SUM) \ + && (cd build && tar --owner=0 --group=0 -cz *) > /tmp/zlib-1.2.11-windoof.tgz \ + && cd / \ + && rm -rf /tmp/zlib-1.2.11 \ + && mkdir -p /usr/local/x86_64-w64-mingw32 \ + && tar -C /usr/x86_64-w64-mingw32 -f /tmp/zlib-1.2.11-windoof.tgz -x include lib \ + && echo -e "\n zlib Done :)\n" \ + && cd "${THEOLDPWD:?}" \ + && unset THEOLDPWD VERSION \ + |