summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-03-24 20:36:31 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-03-24 20:36:31 +0100
commita6c197569a35b023cb1d681deb3a22fbde82048e (patch)
treeefb1bd1503f6b09ebfde38926110d76db803cc37
parent900060c6e9612b1cf13da67a4237c6157cea9823 (diff)
downloaddotfiles-a6c197569a35b023cb1d681deb3a22fbde82048e.tar.gz
smaller gaps, sudo write vim
-rw-r--r--.i3/config2
-rw-r--r--.vim/vimrc2
-rwxr-xr-xscripts/gandi-update2
-rwxr-xr-xscripts/system-setup64
4 files changed, 69 insertions, 1 deletions
diff --git a/.i3/config b/.i3/config
index 26ef85c..e0d22da 100644
--- a/.i3/config
+++ b/.i3/config
@@ -305,7 +305,7 @@ default_floating_border none
for_window [class="feh"] floating enable
-gaps inner 15
+gaps inner 5
bar {
i3bar_command i3bar -t
diff --git a/.vim/vimrc b/.vim/vimrc
index 9d93917..0857bcf 100644
--- a/.vim/vimrc
+++ b/.vim/vimrc
@@ -85,6 +85,8 @@ function Fileheader()
cursor(1,1)
endfunction
+command -bar Suw :w !SUDO_ASKPASS="/usr/lib/ssh/ssh-askpass" sudo -A tee %
+
" Command HEXMODE
command -bar Hexmode call ToggleHex()
diff --git a/scripts/gandi-update b/scripts/gandi-update
index 496eb9c..502e861 100755
--- a/scripts/gandi-update
+++ b/scripts/gandi-update
@@ -1,4 +1,6 @@
#!/bin/bash
+# DNS Record update script for gandi.net API
+# for use as DynDNS
APIKEY=
TTL=1800
diff --git a/scripts/system-setup b/scripts/system-setup
new file mode 100755
index 0000000..6e2bebe
--- /dev/null
+++ b/scripts/system-setup
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+#interactive systen setup
+
+AUTHKEY_FILE_URL="https://jonasgunz.de/authorized_keys"
+
+if [ $(id -u) -ne 0 ]; then
+ echo Supposed to run as root.
+ return 1
+fi
+
+yes_no()
+{
+ read -p "$1 (y/[n])" inp
+ case $inp in
+ [yY]* ) return 0;;
+ * ) return 1;;
+ esac
+}
+
+selector()
+{
+ local cnt=0
+ local regex="^-?[0-9]+\$"
+ for selection in "$@"
+ do
+ echo "$cnt) $selection"
+ ((cnt=$cnt + 1))
+ done
+
+ read -p "(default=0) >" inp
+ if [[ "$inp" =~ $regex ]] && [ $inp -ge 0 -a $inp -le $# ]
+ then
+ return $inp
+ elif [ -z $inp ]
+ then
+ return 0
+ else
+ return -1
+ fi
+}
+
+function user_setup() {
+ while true; do
+ read -p "Name for new User: " username
+ if [ ! -z $username ]; then
+ break;
+ fi
+ done
+}
+
+echo "Interactive system setup"
+
+while true ; do
+ selector "User setup" "Exit"
+ case $? in
+ 0)
+ user_setup;;
+ 1)
+ exit 0;;
+ *)
+ echo Wrong input;;
+ esac
+done