From 1ef3b31bde3f2153cf87c7ca61e8cd7158187ec0 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 10 Jun 2021 22:53:56 +0100 Subject: [PATCH] Add some more to setup --- .config/nvim | 2 +- .local/bin/setup/setup | 2 ++ .local/bin/setup/setupdev | 2 ++ .local/bin/setup/setupfirefox | 30 ++++++++++++++++++++++++++++++ .local/bin/setup/setupkeyring | 2 ++ .local/bin/setup/setupmaptool | 2 ++ .local/bin/setup/setupnextcloud | 24 ++++++++++++++++++++++-- .local/bin/setup/setupssh | 12 +++++++----- .local/bin/setup/setupwacom | 7 +++++-- 9 files changed, 73 insertions(+), 10 deletions(-) create mode 100755 .local/bin/setup/setupfirefox diff --git a/.config/nvim b/.config/nvim index b4987ee..2b59570 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit b4987eec8d0c8525c29083b4eb3b1be00a42b2e3 +Subproject commit 2b5957097aa473b490f3e03cf4bb600a3d57d0f1 diff --git a/.local/bin/setup/setup b/.local/bin/setup/setup index c14b05d..cd899e1 100755 --- a/.local/bin/setup/setup +++ b/.local/bin/setup/setup @@ -8,6 +8,8 @@ enpass & dwmc toggleview 32 +clear + read -n 1 -r -s -p $'Press enter for next clip...\n' echo "$MASTERPW" | xclip -selection clipboard -i diff --git a/.local/bin/setup/setupdev b/.local/bin/setup/setupdev index 147fbd0..d626b2b 100755 --- a/.local/bin/setup/setupdev +++ b/.local/bin/setup/setupdev @@ -1,5 +1,7 @@ #! /bin/bash +echo "Creating development directories" + mkdir "$HOME/Code" mkdir "$HOME/Code/DevOps" # For server and computer admin mkdir "$HOME/Code/FSharp" diff --git a/.local/bin/setup/setupfirefox b/.local/bin/setup/setupfirefox new file mode 100755 index 0000000..833363b --- /dev/null +++ b/.local/bin/setup/setupfirefox @@ -0,0 +1,30 @@ +#! /usr/bin/zsh + +FIREFOX=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Firefox" 2>&1) +FIREFOXUN=$(echo "$FIREFOX" | grep -Po "(?<=login: )[^\s]+") +FIREFOXPW=$(echo "$FIREFOX" | grep -Po "(?<=pass : ).+(?=\")") + +firefox "https://ffprofile.com/" + +read -s -k $'?Press enter when you have downloaded the profile...\n' + +profile="$(find "$HOME/.mozilla/firefox" -type d -name '*.default-release')" + +rm -rf "$profile" + +unzip -o -qq "$HOME/Downloads/profile.zip" -d "$profile" + +echo "$FIREFOXUN" | xclip -selection clipboard -i + +setsid "$TERMINAL" -e firefox "https://accounts.firefox.com/signin?context=fx_desktop_v3&entrypoint=fxa_app_menu&action=email&service=sync" & + +clipnotify + +echo "$FIREFOXPW" | xclip -selection clipboard -i + +read -s -k $'?Press enter when you have synced Firefox...\n' + +echo "" | xclip -selection clipboard -i + +firefox "https://www.enpass.io/downloads/" + diff --git a/.local/bin/setup/setupkeyring b/.local/bin/setup/setupkeyring index 5ee4f7d..f8ca762 100755 --- a/.local/bin/setup/setupkeyring +++ b/.local/bin/setup/setupkeyring @@ -1,5 +1,7 @@ #! /bin/bash +echo "Setting up keyring to start at login" + # Start gnome keyring at login sudo -A sed -i '/auth include system-local-login/a auth optional pam_gnome_keyring.so' /etc/pam.d/login sudo -A sed -i '/session include system-local-login/a session optional pam_gnome_keyring.so auto_start' /etc/pam.d/login diff --git a/.local/bin/setup/setupmaptool b/.local/bin/setup/setupmaptool index d0d12e5..ba9cc95 100755 --- a/.local/bin/setup/setupmaptool +++ b/.local/bin/setup/setupmaptool @@ -1,5 +1,7 @@ #! /bin/bash +echo "Configuring MapTool" + # Scale up the GUI by 2 times for HiDPI screens if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/x11/.DPI" ]; then DPI="$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/x11/.DPI")" diff --git a/.local/bin/setup/setupnextcloud b/.local/bin/setup/setupnextcloud index 5ba8c75..b743ccf 100755 --- a/.local/bin/setup/setupnextcloud +++ b/.local/bin/setup/setupnextcloud @@ -1,7 +1,27 @@ -#! /bin/bash +#! /usr/bin/zsh TOWER=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Tower" 2>&1) TOWERUN=$(echo "$TOWER" | grep -Po "(?<=login: )\w+") TOWERPW=$(echo "$TOWER" | grep -Po "(?<=pass : ).+(?=\")") -nextcloud +echo "https://tower.scarif.space" | xclip -selection clipboard -i + +mkdir -p "$HOME/Tower" + +nextcloud & + +dwmc toggleview 32 + +clipnotify + +echo "$TOWERUN" | xclip -selection clipboard -i + +clipnotify + +echo "$TOWERPW" | xclip -selection clipboard -i + +read -s -k $'?Press enter when you have synced Nextcloud... \n' + +echo "" | xclip -selection clipboard -i + +dwmc toggleview 0 diff --git a/.local/bin/setup/setupssh b/.local/bin/setup/setupssh index 4627001..c55d1c5 100755 --- a/.local/bin/setup/setupssh +++ b/.local/bin/setup/setupssh @@ -1,5 +1,7 @@ #!/bin/bash +echo "Setting up SSH" + # Extract the login details from enpass LABS=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Labs" 2>&1) LABSUN=$(echo "$LABS" | grep -Po "(?<=login: )\w+") @@ -28,7 +30,7 @@ CREDENTIALS="$LABSUN:$LABSPW" # The credentials to pass to the API KEYS_URL="https://$CREDENTIALS@labs.scarif.space/api/v1/user/keys" # Get all the existing keys -KEYS=$(curl -X GET -s --url "$KEYS_URL") +KEYS=$(curl -X GET -s -S --url "$KEYS_URL") KEY_EXISTS=$(echo $KEYS | jq --arg TITLE "$TITLE" 'map(.title)|contains([$TITLE])') @@ -41,10 +43,10 @@ if [[ $KEY_EXISTS == true ]]; then for ID in $IDS; do echo "Deleting key with ID $ID" curl -X DELETE \ - -s \ + -s -S \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ - --url "$KEYS_URL/$ID" + --url "$KEYS_URL/$ID" > /dev/null done fi fi @@ -52,11 +54,11 @@ fi # Save the new key in gitea curl -X POST \ - -s \ + -s -S \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ --data "$(generate_post_data)" \ - --url "$KEYS_URL" + --url "$KEYS_URL" > /dev/null HTTP_REPLACE="s/https:\/\/labs\.scarif\.space\//git@labs.scarif.space:/" diff --git a/.local/bin/setup/setupwacom b/.local/bin/setup/setupwacom index b007500..0dea5f2 100755 --- a/.local/bin/setup/setupwacom +++ b/.local/bin/setup/setupwacom @@ -1,5 +1,8 @@ #! /bin/bash -tee /etc/udev/rules.d/99-wacom.rules <