feat: add wallpapers

This commit is contained in:
Dmitriy Pleshevskiy 2022-04-14 16:55:53 +03:00
parent 0e753a3cdb
commit 3a7c1bbe14
7 changed files with 60 additions and 10 deletions

8
.gitignore vendored
View File

@ -7,6 +7,12 @@
!/nix/home.nix
!/nix/*.example.nix
!/programs
!/scripts
!/wallpapers
/wallpapers/*
!/wallpapers/*.png
!/wallpapers/build.sh

View File

@ -92,7 +92,7 @@ in
services.screen-locker = {
enable = true;
lockCmd = "/usr/bin/i3lock -e -c 000000";
lockCmd = "/bin/bash ~/scripts/lock.sh";
inactiveInterval = 5;
};
@ -178,14 +178,29 @@ in
enableZshIntegration = true;
};
xdg.configFile = {
# add config for alacritty terminal
"alacritty/alacritty.yml".source = ../programs/alacritty/alacritty.yml;
home.file = {
"scripts" = {
source = ../scripts;
recursive = true;
};
# add config for xmonad window manager
# "xmonad/xmonad.hs".source = ../programs/xmonad/xmonad.hs;
# "xmobar/xmobar.hs".source = ../programs/xmonad/xmobar.hs;
"pictures/wallpapers" = {
source = ../wallpapers;
recursive = true;
};
};
"stylish-haskell/config.yaml".source = ../programs/stylish-haskell/config.yml;
xdg = {
enable = true;
configFile = {
# add config for alacritty terminal
"alacritty/alacritty.yml".source = ../programs/alacritty/alacritty.yml;
# add config for xmonad window manager
# "xmonad/xmonad.hs".source = ../programs/xmonad/xmonad.hs;
# "xmobar/xmobar.hs".source = ../programs/xmonad/xmobar.hs;
"stylish-haskell/config.yaml".source = ../programs/stylish-haskell/config.yml;
};
};
}

View File

@ -130,7 +130,7 @@ myKeys conf = mkKeymap conf $
-- Lock screen
, ("M4-l", spawn "i3lock -e -c 000000")
, ("M4-l", spawn "bash ~/scripts/lock.sh")
-- Change volume
, ("<XF86AudioMute>", spawn "amixer -qD pulse sset Master toggle")

2
scripts/lock.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
/usr/bin/i3lock -ei $(exa -1 ~/pictures/wallpapers/*.png | awk '{ print $1 }' | sort -R | head -n 1)

6
scripts/slugify.ts Normal file
View File

@ -0,0 +1,6 @@
import { slugify } from 'https://deno.land/x/slugify/mod.ts';
for (const sourceFileName of Deno.args) {
console.log(slugify(sourceFileName).replace(/_+/g, '-').toLowerCase());
}

21
wallpapers/build.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
cd -- $(dirname "$0")
echo "Change dir: $PWD"
jpg_file_names=$(exa -1 | grep jpg)
jpg_file_count=$(echo $jpg_images | wc -l)
if [[ $jpg_file_names != "" && $jpg_file_count != "0" ]]; then
echo found: $jpg_file_count images
echo converting to png...
for f in $jpg_file_names
do
echo " $f -> ${f%.jpg}.png"
convert "$f" "${f%.jpg}.png"
done
echo done
else
echo nothing to convert
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB