From a5b23da5bf0ee69485fc5316291a2bb24bc52a3d Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sun, 31 Dec 2023 08:53:37 +0545 Subject: [PATCH] minor fix --- config/hypr/scripts/Wallpaper.sh | 22 +++++++-- config/hypr/scripts/WallpaperRandom.sh | 40 ++++++++-------- config/hypr/scripts/WallpaperSelect.sh | 6 ++- config/nvim/lazy-lock.json | 13 ++--- .../plugins/extras/editor/docs/obsidian.lua | 47 +++++++------------ .../lua/plugins/extras/editor/docs/peek.lua | 23 +++++++++ .../lua/plugins/extras/editor/git/neogit.lua | 11 +++++ .../extras/ui/colorschemes/catppuccin.lua | 1 + config/nvim/lua/plugins/extras/util/mkdir.lua | 4 ++ config/swaync/config.json | 4 +- config/swaync/style.css | 2 +- 11 files changed, 108 insertions(+), 65 deletions(-) create mode 100644 config/nvim/lua/plugins/extras/editor/docs/peek.lua create mode 100644 config/nvim/lua/plugins/extras/editor/git/neogit.lua create mode 100644 config/nvim/lua/plugins/extras/util/mkdir.lua diff --git a/config/hypr/scripts/Wallpaper.sh b/config/hypr/scripts/Wallpaper.sh index 96b7722d..06daf86c 100755 --- a/config/hypr/scripts/Wallpaper.sh +++ b/config/hypr/scripts/Wallpaper.sh @@ -1,11 +1,19 @@ #!/bin/bash +# Wallpaper directory DIR="$HOME/Pictures/wallpapers" +# Find wallpapers +PICS=($(find "${DIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) -PICS=($(find ${DIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) -RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} +# Check if there are wallpapers in the specified directory +if [ ${#PICS[@]} -eq 0 ]; then + echo "No wallpapers found in ${DIR}. Exiting." + exit 1 +fi +# Randomly select a wallpaper +RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]} # Transition config FPS=60 @@ -14,8 +22,14 @@ DURATION=1 BEZIER=".43,1.19,1,.4" SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +# Check if swww is initialized, and initialize if not +swww query || swww init -swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS +# Set the wallpaper with transition parameters +swww img "${RANDOMPICS}" $SWWW_PARAMS -ln -sf "$RANDOMPICS" "$HOME/.config/hypr/.current_wallpaper" +# Notify that the wallpaper has changed +notify-send "Wallpaper Changed" -i "${RANDOMPICS}" +# Create a symbolic link to the current wallpaper +ln -sf "${RANDOMPICS}" "$HOME/.config/hypr/.current_wallpaper" diff --git a/config/hypr/scripts/WallpaperRandom.sh b/config/hypr/scripts/WallpaperRandom.sh index 6706ca67..2ac51ebc 100755 --- a/config/hypr/scripts/WallpaperRandom.sh +++ b/config/hypr/scripts/WallpaperRandom.sh @@ -2,34 +2,34 @@ DIR="$HOME/Pictures/wallpapers/" PICS=($(find "${DIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) -RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]} -# Create symbolic link to the selected wallpaper -ln -sf "${RANDOMPICS}" "$HOME/.config/hypr/.current_wallpaper" - -# Check if swww is initialized -swww query || swww init - -# Set the wallpaper -swww img "$HOME/.config/hypr/.current_wallpaper" - -if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then +# Check if there are wallpapers in the specified directory +if [ ${#PICS[@]} -eq 0 ]; then + echo "No wallpapers found in ${DIR}. Exiting." exit 1 fi +# Check if swww is initialized, and initialize if not +swww query || swww init + +# Set the transition type to random export SWWW_TRANSITION_TYPE=random # This controls (in seconds) when to switch to the next image INTERVAL=1800 while true; do - find "$1" -type f \ - | shuf \ - | while read -r img; do - # Update the symbolic link to the new wallpaper - ln -sf "$img" "$HOME/.config/hypr/.current_wallpaper" - # Set the new wallpaper - swww img "$HOME/.config/hypr/.current_wallpaper" - sleep $INTERVAL - done + # Select a random wallpaper + RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]} + + # Create symbolic link to the selected wallpaper + ln -sf "${RANDOMPICS}" "$HOME/.config/hypr/.current_wallpaper" + + # Set the new wallpaper + swww img "$HOME/.config/hypr/.current_wallpaper" + + # Notify that wallpaper has changed + notify-send "Wallpaper Changed" -i "$RANDOMPICS" + + sleep $INTERVAL done diff --git a/config/hypr/scripts/WallpaperSelect.sh b/config/hypr/scripts/WallpaperSelect.sh index 58fa45ab..7c97e2db 100755 --- a/config/hypr/scripts/WallpaperSelect.sh +++ b/config/hypr/scripts/WallpaperSelect.sh @@ -24,20 +24,24 @@ wallpaper="$WALLPAPERS_DIR/$choice" set_wallpaper_kde() { qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript \ "var allDesktops = desktops(); for (i=0;icp", + ft = "markdown", + function() + local peek = require("peek") + if peek.is_open() then + peek.close() + else + peek.open() + end + end, + desc = "Peek (Markdown Preview)", + }, + }, + opts = {}, + }, +} \ No newline at end of file diff --git a/config/nvim/lua/plugins/extras/editor/git/neogit.lua b/config/nvim/lua/plugins/extras/editor/git/neogit.lua new file mode 100644 index 00000000..a1eb6fb7 --- /dev/null +++ b/config/nvim/lua/plugins/extras/editor/git/neogit.lua @@ -0,0 +1,11 @@ +return { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + config = true, + cmd = { "Neogit" }, + -- TODO: Need to configure this +} diff --git a/config/nvim/lua/plugins/extras/ui/colorschemes/catppuccin.lua b/config/nvim/lua/plugins/extras/ui/colorschemes/catppuccin.lua index a7e42590..f451b36c 100644 --- a/config/nvim/lua/plugins/extras/ui/colorschemes/catppuccin.lua +++ b/config/nvim/lua/plugins/extras/ui/colorschemes/catppuccin.lua @@ -56,6 +56,7 @@ return { lsp_trouble = false, navic = { enabled = false, custom_bg = "lualine" }, neotest = true, + neogit = true, neotree = true, notify = true, noice = true, diff --git a/config/nvim/lua/plugins/extras/util/mkdir.lua b/config/nvim/lua/plugins/extras/util/mkdir.lua new file mode 100644 index 00000000..2a6a333c --- /dev/null +++ b/config/nvim/lua/plugins/extras/util/mkdir.lua @@ -0,0 +1,4 @@ +return { + "jghauser/mkdir.nvim", + event = "VeryLazy", +} \ No newline at end of file diff --git a/config/swaync/config.json b/config/swaync/config.json index 1147d413..2dcdea44 100755 --- a/config/swaync/config.json +++ b/config/swaync/config.json @@ -12,7 +12,7 @@ "control-center-margin-left": 0, "notification-2fa-action": true, "notification-inline-replies": false, - "notification-icon-size": 24, + "notification-icon-size": 50, "notification-body-image-height": 100, "notification-body-image-width": 200, "timeout": 6, @@ -72,7 +72,7 @@ }, { "label": "󰌾", - "command": "~/.config/hypr/scripts/LockScreen.sh" + "command": "swaylock" }, { "label": "󰍃", diff --git a/config/swaync/style.css b/config/swaync/style.css index d5153459..859ec608 100644 --- a/config/swaync/style.css +++ b/config/swaync/style.css @@ -213,7 +213,7 @@ .widget-dnd>switch { border-radius: 10px; /* border: 1px solid #7aa2f7; */ - background: @noti-border-color; + background: white; } .widget-dnd>switch:checked {