broken laptop backup

This commit is contained in:
Rick van Lieshout 2024-12-07 15:43:05 +01:00
parent 08585df3ac
commit 5aac22cb6d
13 changed files with 198 additions and 89 deletions

2
TODO.md Normal file
View File

@ -0,0 +1,2 @@
docker-credential-pass -> add to AUR
^ set up `pass`

View File

@ -14,3 +14,5 @@ alias reactserver='docker run --rm -p 8080:8080 -v "$PWD":/app mastermindzh/gene
alias mongoserver='docker run -d --rm -p 27017:27017 --name mongo-server -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=123 -v ~/.db/mongo:/data/db mongo' alias mongoserver='docker run -d --rm -p 27017:27017 --name mongo-server -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=123 -v ~/.db/mongo:/data/db mongo'
alias sqlserver='docker run --rm --name sql-server -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Your_Password123" -p 1433:1433 -v ~/.db/mssql:/var/opt/mssql mcr.microsoft.com/mssql/server' alias sqlserver='docker run --rm --name sql-server -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Your_Password123" -p 1433:1433 -v ~/.db/mssql:/var/opt/mssql mcr.microsoft.com/mssql/server'
alias mailcatcher='docker run -d -p 1080:1080 -p 1025:1025 --name mailcatcher schickling/mailcatcher' alias mailcatcher='docker run -d -p 1080:1080 -p 1025:1025 --name mailcatcher schickling/mailcatcher'
alias openwebui='docker run --rm -d -p 3004:8080 -v ~/.ollama:/root/.ollama -v ~/.open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:ollama'
alias postgresdb='docker run --rm -d -v ~/.db/postgres:/var/lib/postgresql/data -e POSTGRES_PASSWORD=admin -e POSTGRES_USER=admin -e POSTGRES_DB=postgres --name="postgres" -p 5432:5432 postgres'

View File

@ -9,7 +9,6 @@ fi
# declare variables # declare variables
MY_SERVER_LOCATION="//10.10.1.11" MY_SERVER_LOCATION="//10.10.1.11"
MOUNT_PREFIX="/mnt" MOUNT_PREFIX="/mnt"
USERNAME="mastermindzh"
# check whether array contains a key # check whether array contains a key
containsElement() { containsElement() {
@ -86,6 +85,11 @@ declare -A MOUNTS12=(
[share]="data" [share]="data"
[mount]="data" [mount]="data"
) )
declare -A MOUNTS13=(
[server]="$MY_SERVER_LOCATION"
[share]="vault"
[mount]="vault"
)
# declare array with "objects" # declare array with "objects"
declare -n MOUNTS declare -n MOUNTS
@ -139,7 +143,7 @@ for MOUNTS in ${!MOUNTS@}; do
mount.cifs "$SERVER_LOCATION" "$MOUNT_LOCATION" -o user=mastermindzh,noperm,rw,vers=2.0 mount.cifs "$SERVER_LOCATION" "$MOUNT_LOCATION" -o user=mastermindzh,noperm,rw,vers=2.0
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "Succesfully mounted $MOUNT_LOCATION" echo "Successfully mounted $MOUNT_LOCATION"
else else
echo "Failed mounting $SERVER_LOCATION on $MOUNT_LOCATION" echo "Failed mounting $SERVER_LOCATION on $MOUNT_LOCATION"
fi fi

51
bash/rofi/docker.sh Normal file
View File

@ -0,0 +1,51 @@
#!/usr/bin/bash
#Set default terminal emulator
TERMINAL_APP=xfce4-terminal
CUSTOM_SCRIPTS_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/custom"
function execInTerminal {
$TERMINAL_APP -H -e "$1"
}
function getExtraActions {
local custom_scripts=""
if [ -d "$CUSTOM_SCRIPTS_DIR" ]; then
for file in "$CUSTOM_SCRIPTS_DIR"/*; do
custom_scripts="$custom_scripts\n$(basename "$file")"
done
fi
echo "$custom_scripts"
}
selected_container=$(docker ps --format "table {{.Names}}\t{{.Image}}\t{{.ID}}" | sed '1d' | rofi -p "🥡 Running containers " -dmenu)
container_options_attach="Attach"
container_options_stop="Stop"
container_options_logs="Logs"
container_options_restart="Restart"
if [[ ! -z $selected_container ]]; then
container_id=$(echo "$selected_container" | awk '{ print $3}')
container_name=$(echo "$selected_container" | awk '{ print $1}')
selected_action=$(echo -e "$container_options_attach\n$container_options_logs\n$container_options_restart\n$container_options_stop$(getExtraActions)" | rofi -dmenu -selected-row 0)
case $selected_action in
"$container_options_attach")
execInTerminal "docker exec -it ${container_id} /bin/sh"
;;
"$container_options_restart")
msg=$(docker restart "$container_id")
rofi -e "Message from the docker: $msg"
;;
"$container_options_logs")
execInTerminal "docker logs -f ${container_id}"
;;
"$container_options_stop")
msg=$(docker stop "$container_id")
rofi -e "Message from the docker: $msg"
;;
*)
bash "$CUSTOM_SCRIPTS_DIR/$selected_action" "$container_name"
;;
esac
fi

View File

@ -4,6 +4,6 @@
#/bin/bash #/bin/bash
displays=($(xrandr | awk '/ connected /{print $1}')) displays=($(xrandr | awk '/ connected /{print $1}'))
selected_display="${displays[0]}" selected_display="${displays[0]}"
xrandr --output "$selected_display" --brightness 0.75 xrandr --output "$selected_display" --brightness 0.60
# power savings # power savings

View File

@ -169,7 +169,7 @@ exec = "~/.config/i3/scripts/tidal-cli.sh info"
click-left = "~/.config/i3/scripts/tidal-cli.sh playpause" click-left = "~/.config/i3/scripts/tidal-cli.sh playpause"
scroll-up = "~/.config/i3/scripts/tidal-cli.sh next" scroll-up = "~/.config/i3/scripts/tidal-cli.sh next"
scrolldown = "~/.config/i3/scripts/tidal-cli.sh previous" scrolldown = "~/.config/i3/scripts/tidal-cli.sh previous"
click-right = "~/.config/i3/scripts/tidal-cli.sh songwhip | xclip -selection clipboard" click-right = "~/.config/i3/scripts/tidal-cli.sh getLink | xclip -selection clipboard"
[module/pulseaudio-microphone] [module/pulseaudio-microphone]
type = custom/script type = custom/script

View File

@ -1,61 +1,49 @@
version: 2 # yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
blocks: blocks:
# prompt on the right - type: rprompt
- type: rprompt
overflow: hidden overflow: hidden
segments: segments:
- background: transparent - properties:
foreground: yellow cache_duration: none
style: plain
template: "{{ .FormattedMs }}"
type: executiontime
properties:
threshold: 1 threshold: 1
template: "{{ .FormattedMs }}"
# prompt segment foreground: yellow
- type: prompt background: transparent
type: executiontime
style: plain
- type: prompt
alignment: left alignment: left
newline: true
segments: segments:
- foreground: "#77E4F7" - properties:
template: "{{ .Path }} " cache_duration: none
type: path home_icon: "\uf015 "
properties:
home_icon: " "
style: agnoster_short style: agnoster_short
template: "{{ .Path }} "
# git segment foreground: "#77E4F7"
- type: git type: path
foreground: "#C678DD" - properties:
properties: cache_duration: none
fetch_status: true fetch_status: true
template: "<#ffffff>on</> {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }} \uf044 {{end}} "
foreground: "#C678DD"
type: git
style: plain style: plain
# template: - properties:
# "<#ffffff>on</> {{ .HEAD }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) cache_duration: none
# (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String
# }}{{ end }}"
template: "<#ffffff>on</> {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}  {{end}} "
# current language info
- type: node
foreground: "#98C379"
properties:
fetch_version: true fetch_version: true
template: " \uf3d3 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }} {{ .Full }} "
foreground: "#98C379"
type: node
style: plain style: plain
template: "  {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }} {{ .Full }} " newline: true
- type: prompt
- alignment: left alignment: left
segments: segments:
- foreground: "#63F08C" - properties:
style: plain cache_duration: none
template: "➜ " template: "➜ "
foreground: "#63F08C"
type: text type: text
type: prompt style: plain
# bash won't play along :) version: 3
# transient_prompt:
# background: transparent
# foreground_templates:
# - "{{if gt .Code 0}}red{{end}}"
# - "{{if eq .Code 0}}magenta{{end}}"
# template: " "

View File

@ -0,0 +1,61 @@
version: 2
blocks:
# prompt on the right
- type: rprompt
overflow: hidden
segments:
- background: transparent
foreground: yellow
style: plain
template: "{{ .FormattedMs }}"
type: executiontime
properties:
threshold: 1
# prompt segment
- type: prompt
alignment: left
newline: true
segments:
- foreground: "#77E4F7"
template: "{{ .Path }} "
type: path
properties:
home_icon: " "
style: agnoster_short
# git segment
- type: git
foreground: "#C678DD"
properties:
fetch_status: true
style: plain
# template:
# "<#ffffff>on</> {{ .HEAD }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed)
# (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String
# }}{{ end }}"
template: "<#ffffff>on</> {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}  {{end}} "
# current language info
- type: node
foreground: "#98C379"
properties:
fetch_version: true
style: plain
template: "  {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }} {{ .Full }} "
- alignment: left
segments:
- foreground: "#63F08C"
style: plain
template: "➜ "
type: text
type: prompt
# bash won't play along :)
# transient_prompt:
# background: transparent
# foreground_templates:
# - "{{if gt .Code 0}}red{{end}}"
# - "{{if eq .Code 0}}magenta{{end}}"
# template: " "

23
dependencies/aur.txt vendored
View File

@ -2,27 +2,24 @@ visual-studio-code-bin
i3blocks-contrib i3blocks-contrib
insync insync
awesome-terminal-fonts-git awesome-terminal-fonts-git
otf-droid-sans-mono-powerline-git dracula-gtk-theme-full
downgrade downgrade
oh-my-posh oh-my-posh
dive dive
xorg-xev gnome-text-editor
chili-sddm-theme
greenclip
seafile
seafile-client
awf-gtk4
networkmanager-l2tp networkmanager-l2tp
xorg-xev
notify-osd-customizable notify-osd-customizable
notifyconf notifyconf
dotnet-host-bin dotnet-host-bin
keychain keychain
nomachine nomachine
chili-sddm-theme
dive
gnome-text-editor
greenclip
pulseaudio-ctl pulseaudio-ctl
seafile
seafile-client
awf-gtk4
azure-cli
sysmontask sysmontask
kind otf-droid-sans-mono-powerline-git
dracula-gtk-theme-full azure-cli

View File

@ -88,7 +88,7 @@ docker
docker-compose docker-compose
duf duf
engrampa engrampa
eog loupe
feh feh
firefox firefox
flameshot flameshot

View File

@ -201,7 +201,7 @@ bindsym $mod+Shift+g move container to workspace $workspace13
############################################ ############################################
# Set the default font # Set the default font
font pango:Ubuntu regular 12 font pango:Ubuntu regular 12
new_window 1pixel #new_window 1pixel
hide_edge_borders both hide_edge_borders both
# Window Colours # Window Colours
@ -319,3 +319,6 @@ exec --no-startup-id seafile-applet
exec --no-startup-id obsidian exec --no-startup-id obsidian
exec /usr/bin/compton exec /usr/bin/compton
exec /bin/bash ~/.config/i3/scripts/startup.sh exec /bin/bash ~/.config/i3/scripts/startup.sh
# don't blank the screen please :)
exec --no-startup-id xset s off && xset -dpms && xset s noblank

View File

@ -38,12 +38,10 @@ case $1 in
fi fi
;; ;;
"songwhip") "getLink")
JSON=$(httpGet current) JSON=$(httpGet current)
URL=$(echo "$JSON" | jq -r '.url') URL=$(echo "$JSON" | jq -r '.url')
echo "$URL"
WHIPPED_URL="https://songwhip.com$(curl -s -X POST 'https://songwhip.com/api/songwhip/create' -H 'Content-Type: application/json' --data-raw '{"url":"'"$URL"'","country":"NL"}' | jq -r '.data.item.url')"
echo "$WHIPPED_URL"
;; ;;
"status") "status")
if httpGet current | grep "paused" >/dev/null; then if httpGet current | grep "paused" >/dev/null; then

View File

@ -75,15 +75,15 @@ function install_fonts {
cp -rf ./fonts/* /usr/local/share/fonts cp -rf ./fonts/* /usr/local/share/fonts
} }
# install trizen, a aur helper # install trizen, an aur helper
function install_trizen { function install_trizen {
git clone https://aur.archlinux.org/trizen.git mkdir /tmp/trizen-install
pushd trizen || return git clone https://aur.archlinux.org/trizen.git /tmp/trizen-install
pushd /tmp/trizen-install || return
makepkg -si makepkg -si
popd || return popd || return
sudo rm -dRf trizen/ sudo rm -dRf /tmp/trizen-install
} }
# Sets up time and date related stuff # Sets up time and date related stuff
function setDateTimeConfig { function setDateTimeConfig {
systemctl enable ntpd systemctl enable ntpd
@ -112,7 +112,7 @@ function install_config {
linkDir "$PWD"/config/polybar ~/.config/polybar linkDir "$PWD"/config/polybar ~/.config/polybar
linkDir "$PWD"/config/poshthemes ~/.config/poshthemes linkDir "$PWD"/config/poshthemes ~/.config/poshthemes
linkDir "$PWD"/config/xfce4 ~/.config/xfce4/xfconf/xfce-perchannel-xml linkDir "$PWD"/config/xfce4 ~/.config/xfce4/xfconf/xfce-perchannel-xml
linkdir "$PWD"/config/rofi ~/.config/rofi linkDir "$PWD"/config/rofi ~/.config/rofi
# link user files # link user files
ln -sf "$PWD"/bash/.aliases ~/ ln -sf "$PWD"/bash/.aliases ~/
@ -167,7 +167,10 @@ function install_dependencies {
fileToList dependencies/pacman.txt | xargs sudo pacman --noconfirm -S fileToList dependencies/pacman.txt | xargs sudo pacman --noconfirm -S
install_trizen install_trizen
set +e
fileToList dependencies/aur.txt | xargs trizen -S --noconfirm fileToList dependencies/aur.txt | xargs trizen -S --noconfirm
set -e
fileToList dependencies/npm.txt | xargs sudo npm install -g fileToList dependencies/npm.txt | xargs sudo npm install -g
} }