diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..068ab36 --- /dev/null +++ b/TODO.md @@ -0,0 +1,2 @@ +docker-credential-pass -> add to AUR +^ set up `pass` diff --git a/bash/.aliases/docker.sh b/bash/.aliases/docker.sh index 2ae2450..58eb89c 100644 --- a/bash/.aliases/docker.sh +++ b/bash/.aliases/docker.sh @@ -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 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 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' diff --git a/bash/mounts.sh b/bash/mounts.sh index 7fd4106..1e78f08 100644 --- a/bash/mounts.sh +++ b/bash/mounts.sh @@ -9,7 +9,6 @@ fi # declare variables MY_SERVER_LOCATION="//10.10.1.11" MOUNT_PREFIX="/mnt" -USERNAME="mastermindzh" # check whether array contains a key containsElement() { @@ -86,6 +85,11 @@ declare -A MOUNTS12=( [share]="data" [mount]="data" ) +declare -A MOUNTS13=( + [server]="$MY_SERVER_LOCATION" + [share]="vault" + [mount]="vault" +) # declare array with "objects" 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 if [ $? -eq 0 ]; then - echo "Succesfully mounted $MOUNT_LOCATION" + echo "Successfully mounted $MOUNT_LOCATION" else echo "Failed mounting $SERVER_LOCATION on $MOUNT_LOCATION" fi diff --git a/bash/rofi/docker.sh b/bash/rofi/docker.sh new file mode 100644 index 0000000..e906662 --- /dev/null +++ b/bash/rofi/docker.sh @@ -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 diff --git a/computers/hparch/.xprofile b/computers/hparch/.xprofile index 3076b89..6139c4a 100644 --- a/computers/hparch/.xprofile +++ b/computers/hparch/.xprofile @@ -4,6 +4,6 @@ #/bin/bash displays=($(xrandr | awk '/ connected /{print $1}')) selected_display="${displays[0]}" -xrandr --output "$selected_display" --brightness 0.75 +xrandr --output "$selected_display" --brightness 0.60 # power savings diff --git a/config/polybar/modules.ini b/config/polybar/modules.ini index 36a7bfd..215ef0b 100644 --- a/config/polybar/modules.ini +++ b/config/polybar/modules.ini @@ -169,7 +169,7 @@ exec = "~/.config/i3/scripts/tidal-cli.sh info" click-left = "~/.config/i3/scripts/tidal-cli.sh playpause" scroll-up = "~/.config/i3/scripts/tidal-cli.sh next" 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] type = custom/script diff --git a/config/poshthemes/mastermindzh.yaml b/config/poshthemes/mastermindzh.yaml index e737b97..cd7fb19 100644 --- a/config/poshthemes/mastermindzh.yaml +++ b/config/poshthemes/mastermindzh.yaml @@ -1,61 +1,49 @@ -version: 2 +# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json + 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: "❯ " - +- type: rprompt + overflow: hidden + segments: + - properties: + cache_duration: none + threshold: 1 + template: "{{ .FormattedMs }}" + foreground: yellow + background: transparent + type: executiontime + style: plain +- type: prompt + alignment: left + segments: + - properties: + cache_duration: none + home_icon: "\uf015 " + style: agnoster_short + template: "{{ .Path }} " + foreground: "#77E4F7" + type: path + - properties: + cache_duration: none + fetch_status: true + template: "<#ffffff>on {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }} \uf044 {{end}} " + foreground: "#C678DD" + type: git + style: plain + - properties: + cache_duration: none + fetch_version: true + template: " \uf3d3 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }} {{ .Full }} " + foreground: "#98C379" + type: node + style: plain + newline: true +- type: prompt + alignment: left + segments: + - properties: + cache_duration: none + template: "➜ " + foreground: "#63F08C" + type: text + style: plain +version: 3 diff --git a/config/poshthemes/mastermindzh.yaml.bak b/config/poshthemes/mastermindzh.yaml.bak new file mode 100644 index 0000000..e737b97 --- /dev/null +++ b/config/poshthemes/mastermindzh.yaml.bak @@ -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: "❯ " + diff --git a/dependencies/aur.txt b/dependencies/aur.txt index 14d43e9..acee2ff 100644 --- a/dependencies/aur.txt +++ b/dependencies/aur.txt @@ -2,27 +2,24 @@ visual-studio-code-bin i3blocks-contrib insync awesome-terminal-fonts-git -otf-droid-sans-mono-powerline-git +dracula-gtk-theme-full downgrade oh-my-posh dive -xorg-xev +gnome-text-editor +chili-sddm-theme +greenclip +seafile +seafile-client +awf-gtk4 networkmanager-l2tp +xorg-xev notify-osd-customizable notifyconf dotnet-host-bin keychain nomachine -chili-sddm-theme -dive -gnome-text-editor -greenclip pulseaudio-ctl -seafile -seafile-client -awf-gtk4 - -azure-cli sysmontask -kind -dracula-gtk-theme-full +otf-droid-sans-mono-powerline-git +azure-cli diff --git a/dependencies/pacman.txt b/dependencies/pacman.txt index e4e81c7..d7c0e88 100644 --- a/dependencies/pacman.txt +++ b/dependencies/pacman.txt @@ -88,7 +88,7 @@ docker docker-compose duf engrampa -eog +loupe feh firefox flameshot diff --git a/i3/config b/i3/config index a95383a..d4dd176 100644 --- a/i3/config +++ b/i3/config @@ -201,7 +201,7 @@ bindsym $mod+Shift+g move container to workspace $workspace13 ############################################ # Set the default font font pango:Ubuntu regular 12 -new_window 1pixel +#new_window 1pixel hide_edge_borders both # Window Colours @@ -319,3 +319,6 @@ exec --no-startup-id seafile-applet exec --no-startup-id obsidian exec /usr/bin/compton 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 diff --git a/i3/scripts/tidal-cli.sh b/i3/scripts/tidal-cli.sh index 506b35e..24856f1 100755 --- a/i3/scripts/tidal-cli.sh +++ b/i3/scripts/tidal-cli.sh @@ -38,12 +38,10 @@ case $1 in fi ;; -"songwhip") +"getLink") JSON=$(httpGet current) URL=$(echo "$JSON" | jq -r '.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" + echo "$URL" ;; "status") if httpGet current | grep "paused" >/dev/null; then diff --git a/install.sh b/install.sh index 797d6b1..f4088b6 100644 --- a/install.sh +++ b/install.sh @@ -75,15 +75,15 @@ function install_fonts { cp -rf ./fonts/* /usr/local/share/fonts } -# install trizen, a aur helper +# install trizen, an aur helper function install_trizen { - git clone https://aur.archlinux.org/trizen.git - pushd trizen || return + mkdir /tmp/trizen-install + git clone https://aur.archlinux.org/trizen.git /tmp/trizen-install + pushd /tmp/trizen-install || return makepkg -si popd || return - sudo rm -dRf trizen/ + sudo rm -dRf /tmp/trizen-install } - # Sets up time and date related stuff function setDateTimeConfig { systemctl enable ntpd @@ -112,7 +112,7 @@ function install_config { linkDir "$PWD"/config/polybar ~/.config/polybar linkDir "$PWD"/config/poshthemes ~/.config/poshthemes 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 ln -sf "$PWD"/bash/.aliases ~/ @@ -167,7 +167,10 @@ function install_dependencies { fileToList dependencies/pacman.txt | xargs sudo pacman --noconfirm -S install_trizen + set +e fileToList dependencies/aur.txt | xargs trizen -S --noconfirm + set -e + fileToList dependencies/npm.txt | xargs sudo npm install -g }