diff --git a/.config/ags/assets/icons/ollama-symbolic.svg b/.config/ags/assets/icons/ollama-symbolic.svg new file mode 100644 index 000000000..014548151 --- /dev/null +++ b/.config/ags/assets/icons/ollama-symbolic.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + diff --git a/.config/ags/scripts/color_generation/randomwall.sh b/.config/ags/scripts/color_generation/randomwall.sh new file mode 100755 index 000000000..cca302284 --- /dev/null +++ b/.config/ags/scripts/color_generation/randomwall.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +CONFIG_DIR="$XDG_CONFIG_HOME/ags" +$CONFIG_DIR/scripts/color_generation/switchwall.sh $(fd . ~/Pictures/wallpapers/ -e .png -e .jpg -e .svg | xargs shuf -n1 -e) diff --git a/.config/ags/scripts/color_generation/switchwall.sh b/.config/ags/scripts/color_generation/switchwall.sh index a08f7cc68..68de4defa 100755 --- a/.config/ags/scripts/color_generation/switchwall.sh +++ b/.config/ags/scripts/color_generation/switchwall.sh @@ -3,31 +3,35 @@ XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" CONFIG_DIR="$XDG_CONFIG_HOME/ags" +switch() { + imgpath=$1 + screensizey=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2 | head -1) + cursorposx=$(hyprctl cursorpos -j | gojq '.x' 2>/dev/null) || cursorposx=960 + cursorposy=$(hyprctl cursorpos -j | gojq '.y' 2>/dev/null) || cursorposy=540 + cursorposy_inverted=$((screensizey - cursorposy)) + + if [ "$imgpath" == '' ]; then + echo 'Aborted' + exit 0 + fi + + # ags run-js "wallpaper.set('')" + # sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" & + swww img "$imgpath" --transition-step 100 --transition-fps 120 \ + --transition-type grow --transition-angle 30 --transition-duration 1 \ + --transition-pos "$cursorposx, $cursorposy_inverted" +} + if [ "$1" == "--noswitch" ]; then - imgpath=$(swww query | head -1 | awk -F 'image: ' '{print $2}') - # imgpath=$(ags run-js 'wallpaper.get(0)') + imgpath=$(swww query | awk -F 'image: ' '{print $2}') + # imgpath=$(ags run-js 'wallpaper.get(0)') +elif [[ "$1" ]]; then + switch $1 else - # Select and set image (hyprland) - cd "$(xdg-user-dir PICTURES)" - imgpath=$(yad --width 1200 --height 800 --file --title='Choose wallpaper' --add-preview --large-preview) - read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs) - cursorposx=$(hyprctl cursorpos -j | gojq '.x' 2>/dev/null) || cursorposx=960 - cursorposx=$(bc <<< "scale=0; ($cursorposx - $screenx) * $scale / 1") - cursorposy=$(hyprctl cursorpos -j | gojq '.y' 2>/dev/null) || cursorposy=540 - cursorposy=$(bc <<< "scale=0; ($cursorposy - $screeny) * $scale / 1") - cursorposy_inverted=$(( screensizey - cursorposy )) - - if [ "$imgpath" == '' ]; then - echo 'Aborted' - exit 0 - fi - - - # ags run-js "wallpaper.set('')" - # sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" & - swww img "$imgpath" --transition-step 100 --transition-fps 60 \ - --transition-type grow --transition-angle 30 --transition-duration 1 \ - --transition-pos "$cursorposx, $cursorposy_inverted" + # Select and set image (hyprland) + + cd "$(xdg-user-dir PICTURES)" || return 1 + switch $(yad --width 1200 --height 800 --file --add-preview --large-preview --title='Choose wallpaper') fi # Generate colors for ags n stuff diff --git a/.config/ags/services/gpt.js b/.config/ags/services/gpt.js index 30695e970..eab2c392f 100644 --- a/.config/ags/services/gpt.js +++ b/.config/ags/services/gpt.js @@ -16,6 +16,15 @@ const PROVIDERS = { // There's this list hmm https://github.com/zukixa/cool-ai-s 'key_file': 'openai_key.txt', 'model': 'gpt-3.5-turbo', }, + 'ollama': { + 'name': 'Ollama', + 'logo_name': 'ollama', + 'description': 'Official Ollama API.\nPricing: Free.', + 'base_url': 'http://localhost:11434/v1/chat/completions', + 'key_get_url': 'it\'s just ollama', + 'key_file': 'ollama_key.txt', + 'model': 'llama3:instruct', + }, 'oxygen4o': { 'name': 'Oxygen (GPT-4o)', 'logo_name': 'ai-oxygen-symbolic', diff --git a/.config/hypr/hyprlock.conf b/.config/hypr/hyprlock.conf index 401d09085..ad5bc502b 100755 --- a/.config/hypr/hyprlock.conf +++ b/.config/hypr/hyprlock.conf @@ -99,4 +99,4 @@ label { # Status position = 30, -30 halign = left valign = top -} \ No newline at end of file +}