This commit is contained in:
Daniel Langbein 2021-07-02 12:50:24 +02:00
parent cea65f6f67
commit e9e8d99035
9 changed files with 42 additions and 34 deletions

View File

@ -2,7 +2,7 @@
_pkgname=mkinitcpio
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.9
pkgver=0.0.10
pkgrel=1
pkgdesc="mkinitcpio configuration"
arch=('any')

View File

@ -1,9 +1,10 @@
#!/bin/sh
# stdin: default config
# stdout: modified config
set -e
# save stdin (content of /etc/mkinitcpio.conf) in variable
stdin=$(cat)
stdin="$(cat)"
# assert MODULES is empty
echo "$stdin" | grep --quiet '^MODULES=()'
@ -18,8 +19,8 @@ echo "$stdin" | grep --quiet '^HOOKS=(base udev autodetect modconf block filesys
echo "$stdin" | grep --quiet '^#COMPRESSION="lz4"'
# 1) add to MODULES; 2 replace HOOKS; 3) uncomment lz4 COMPRESSION
sed '
echo "$stdin" | sed '
s|^MODULES=(|MODULES=(crc32c-intel |;
s|^#COMPRESSION="lz4".*$|COMPRESSION="lz4"|;
s|^HOOKS=(.*$|HOOKS=(base udev modconf block keyboard keymap encrypt lvm2 btrfs filesystems fsck resume)|
' <<< "$stdin"
'

View File

@ -2,7 +2,7 @@
_pkgname=ssh
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.7
pkgver=0.0.8
pkgrel=1
pkgdesc="ssh with configuration"
arch=('any')

44
pkg/de-p1st-ssh/sshd_config.holoscript Normal file → Executable file
View File

@ -1,28 +1,36 @@
#!/bin/sh
# stdin: default config
# stdout: modified config
set -e
# save stdin (content of /etc/ssh/sshd_config) in variable
stdin=$(cat)
stdin="$(cat)"
# assertions
echo "=== assert UsePAM ===" 1>&2
echo "$stdin" | grep --quiet '^UsePAM yes$'
#
echo "$stdin" | grep --quiet '^#PermitRootLogin\s*$'
! echo "$stdin" | grep --quiet '^PermitRootLogin\s*$'
echo "$stdin" | grep --quiet '^#PubkeyAuthentication\s*$'
! echo "$stdin" | grep --quiet '^PubkeyAuthentication\s*$'
echo "$stdin" | grep --quiet '^#PasswordAuthentication\s*$'
! echo "$stdin" | grep --quiet '^PasswordAuthentication\s*$'
echo "$stdin" | grep --quiet '^#PermitEmptyPasswords\s*$'
! echo "$stdin" | grep --quiet '^PermitEmptyPasswords\s*$'
echo "$stdin" | grep --quiet '^#X11Forwarding\s*$'
! echo "$stdin" | grep --quiet '^X11Forwarding\s*$'
echo "=== assert PermitRootLogin ===" 1>&2
echo "$stdin" | grep --quiet '^#PermitRootLogin\s.*$'
! echo "$stdin" | grep --quiet '^PermitRootLogin\s.*$'
echo "=== assert PubkeyAuthentication ===" 1>&2
echo "$stdin" | grep --quiet '^#PubkeyAuthentication\s.*$'
! echo "$stdin" | grep --quiet '^PubkeyAuthentication\s.*$'
echo "=== assert PasswordAuthentication ===" 1>&2
echo "$stdin" | grep --quiet '^#PasswordAuthentication\s.*$'
! echo "$stdin" | grep --quiet '^PasswordAuthentication\s.*$'
echo "=== assert PermitEmptyPasswords ===" 1>&2
echo "$stdin" | grep --quiet '^#PermitEmptyPasswords\s.*$'
! echo "$stdin" | grep --quiet '^PermitEmptyPasswords\s.*$'
echo "=== assert X11Forwarding ===" 1>&2
echo "$stdin" | grep --quiet '^#X11Forwarding\s.*$'
! echo "$stdin" | grep --quiet '^X11Forwarding\s.*$'
sed '
s|^#PermitRootLogin\s*$|PermitRootLogin no|;
s|^#PubkeyAuthentication\s*$|PubkeyAuthentication yes|;
s|^#PasswordAuthentication\s*$|PasswordAuthentication no|;
s|^#PermitEmptyPasswords\s*$|PermitEmptyPasswords no|;
s|^#X11Forwarding\s*$|X11Forwarding no|
' <<< "$stdin"
echo "=== sed ===" 1>&2
echo "$stdin" | sed '
s|^#PermitRootLogin\s.*$|PermitRootLogin no|;
s|^#PubkeyAuthentication\s.*$|PubkeyAuthentication yes|;
s|^#PasswordAuthentication\s.*$|PasswordAuthentication no|;
s|^#PermitEmptyPasswords\s.*$|PermitEmptyPasswords no|;
s|^#X11Forwarding\s.*$|X11Forwarding no|
'

View File

@ -2,7 +2,7 @@
_pkgname=xfce4-hidpi
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.8
pkgver=0.0.9
pkgrel=1
pkgdesc="HiDPI for XFCE4"
arch=('any')

View File

@ -2,11 +2,8 @@
# stdin: default config
# stdout: modified config
# save stdin in variable
stdin=$(cat)
# Decrease size
sed '
s|<!-- Anchor1 for de-p1st-xfce4-hidpi -->|<property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_75_PERCENT"/>|;
s|<!-- Anchor2 for de-p1st-xfce4-hidpi -->|<property name="last-details-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_50_PERCENT"/>|;
' <<< "$stdin"
'

View File

@ -1,9 +1,10 @@
#!/bin/sh
# stdin: default config
# stdout: modified config
set -e
# save stdin in variable
stdin=$(cat)
stdin="$(cat)"
# assert WindowScalingFactor is as expected
echo "$stdin" | grep --quiet '<property name="WindowScalingFactor" type="int" value="1"/>'
@ -13,7 +14,7 @@ echo "$stdin" | grep --quiet '<property name="CursorThemeSize" type="int" value=
# 1. Double WindowScalingFactor
# 2.Increase cursor size to 32
sed '
echo "$stdin" | sed '
s|<property name="WindowScalingFactor" type="int" value="1"/>|<property name="WindowScalingFactor" type="int" value="2"/>|;
s|<property name="CursorThemeSize" type="int" value="0"/>|<property name="CursorThemeSize" type="int" value="32"/>|;
' <<< "$stdin"
'

View File

@ -2,7 +2,7 @@
_pkgname=xfce4
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.26
pkgver=0.0.27
pkgrel=1
pkgdesc="XFCE4 with configuration"
arch=('any')

View File

@ -1,12 +1,13 @@
#!/bin/sh
# stdin: default config
# stdout: modified config
set -e
# save stdin (content of /etc/mkinitcpio.conf) in variable
stdin=$(cat)
stdin="$(cat)"
# assert a screenshot for key-combination "Print" exists
echo "$stdin" | grep --quiet '^\s*<property name="Print" type="string" value="xfce4-screenshooter"/>\s*$'
# replace action key-combination "Print"
sed 's|<property name="Print" type="string" value="xfce4-screenshooter"/>|<property name="Print" type="string" value="sh -c &apos;xfce4-screenshooter -f -s &quot;Pictures/$(date +%Y%m%d_%H%M%S).png&quot;&apos;"/>|' <<< "$stdin"
echo "$stdin" | sed 's|<property name="Print" type="string" value="xfce4-screenshooter"/>|<property name="Print" type="string" value="sh -c &apos;xfce4-screenshooter -f -s &quot;Pictures/$(date +%Y%m%d_%H%M%S).png&quot;&apos;"/>|'