mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 02:08:29 +02:00
feat: update wallpapers
This commit is contained in:
12
README.md
12
README.md
@@ -17,7 +17,12 @@ Nix allows for easy to manage, collaborative, reproducible deployments. This mea
|
|||||||
After installed NixOS with `nix-command` & `flake` enabled, you can deploy this flake with the following command:
|
After installed NixOS with `nix-command` & `flake` enabled, you can deploy this flake with the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# deploy my test configuration
|
||||||
sudo nixos-rebuild switch .#nixos-test
|
sudo nixos-rebuild switch .#nixos-test
|
||||||
|
|
||||||
|
|
||||||
|
# deploy my PC's configuration
|
||||||
|
sudo nixos-rebuild switch .#msi-rtx4090
|
||||||
```
|
```
|
||||||
|
|
||||||
## Other Interesting Dotfiles
|
## Other Interesting Dotfiles
|
||||||
@@ -26,5 +31,10 @@ Other configurations from where I learned and copied:
|
|||||||
|
|
||||||
- https://github.com/notwidow/hyprland
|
- https://github.com/notwidow/hyprland
|
||||||
- https://github.com/notusknot/dotfiles-nix
|
- https://github.com/notusknot/dotfiles-nix
|
||||||
|
- [xddxdd/nixos-config](https://github.com/xddxdd/nixos-config)
|
||||||
|
- [bobbbay/dotfiles](https://github.com/bobbbay/dotfiles)
|
||||||
|
- [gytis-ivaskevicius/nixfiles](https://github.com/gytis-ivaskevicius/nixfiles)
|
||||||
|
- [fufexan/dotfiles](https://github.com/fufexan/dotfiles)
|
||||||
|
- [davidak/nixos-config](https://codeberg.org/davidak/nixos-config)
|
||||||
|
- [davidtwco/veritas](https://github.com/davidtwco/veritas)
|
||||||
|
|
||||||
|
|||||||
82
flake.lock
generated
82
flake.lock
generated
@@ -1,22 +1,6 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1673956053,
|
|
||||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat_2": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1680531544,
|
"lastModified": 1680531544,
|
||||||
"narHash": "sha256-8qbiDTYb1kGaDADRXTItpcMKQ1TeQVkuof6oEwHUvVA=",
|
"narHash": "sha256-8qbiDTYb1kGaDADRXTItpcMKQ1TeQVkuof6oEwHUvVA=",
|
||||||
@@ -54,21 +38,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667395993,
|
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
@@ -150,7 +119,7 @@
|
|||||||
},
|
},
|
||||||
"lib-aggregate": {
|
"lib-aggregate": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -170,7 +139,7 @@
|
|||||||
"nix-eval-jobs": {
|
"nix-eval-jobs": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682480188,
|
"lastModified": 1682480188,
|
||||||
@@ -186,26 +155,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nix-vscode-extensions": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": "nixpkgs_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1683248756,
|
|
||||||
"narHash": "sha256-jB11TQX+CKvH+MpPzAQbc5/OVg9D28zoBN4ZwmUUKiU=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nix-vscode-extensions",
|
|
||||||
"rev": "288ddbb70b5befac24602bfe7e5d9fe09dfae8d0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nix-vscode-extensions",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683014792,
|
"lastModified": 1683014792,
|
||||||
@@ -239,10 +188,10 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-wayland": {
|
"nixpkgs-wayland": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat",
|
||||||
"lib-aggregate": "lib-aggregate",
|
"lib-aggregate": "lib-aggregate",
|
||||||
"nix-eval-jobs": "nix-eval-jobs",
|
"nix-eval-jobs": "nix-eval-jobs",
|
||||||
"nixpkgs": "nixpkgs_5"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683289443,
|
"lastModified": 1683289443,
|
||||||
@@ -259,22 +208,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1675763311,
|
|
||||||
"narHash": "sha256-bz0Q2H3mxsF1CUfk26Sl9Uzi8/HFjGFD/moZHz1HebU=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "fab09085df1b60d6a0870c8a89ce26d5a4a708c2",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683194677,
|
"lastModified": 1683194677,
|
||||||
"narHash": "sha256-Am7aCGNy/h6RMnvg7Pn4PHQXZZq9FyIUA9klYxBwyDI=",
|
"narHash": "sha256-Am7aCGNy/h6RMnvg7Pn4PHQXZZq9FyIUA9klYxBwyDI=",
|
||||||
@@ -290,7 +223,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681347147,
|
"lastModified": 1681347147,
|
||||||
"narHash": "sha256-B+hTioRc3Jdf4SJyeCiO0fW5ShIznJk2OTiW2vOV+mc=",
|
"narHash": "sha256-B+hTioRc3Jdf4SJyeCiO0fW5ShIznJk2OTiW2vOV+mc=",
|
||||||
@@ -306,7 +239,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683194677,
|
"lastModified": 1683194677,
|
||||||
"narHash": "sha256-Am7aCGNy/h6RMnvg7Pn4PHQXZZq9FyIUA9klYxBwyDI=",
|
"narHash": "sha256-Am7aCGNy/h6RMnvg7Pn4PHQXZZq9FyIUA9klYxBwyDI=",
|
||||||
@@ -326,8 +259,7 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"nix-vscode-extensions": "nix-vscode-extensions",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs": "nixpkgs_3",
|
|
||||||
"nixpkgs-wayland": "nixpkgs-wayland"
|
"nixpkgs-wayland": "nixpkgs-wayland"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
# copy the scripts directory recursively
|
# copy the scripts directory recursively
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
|
home.file.".config/hypr/wallpapers/lockscreen.webp".source = ../wallpapers/lockscreen.webp;
|
||||||
|
home.file.".config/hypr/wallpapers/wallpaper.webp".source = ../wallpapers/wallpaper.webp;
|
||||||
|
|
||||||
# allow fontconfig to discover fonts and configurations installed through home.packages
|
# allow fontconfig to discover fonts and configurations installed through home.packages
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Background Image
|
# Background Image
|
||||||
IMAGE="$HOME/.config/hypr/wallpapers/lockscreen.png"
|
IMAGE="$HOME/.config/hypr/wallpapers/lockscreen.webp"
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
bg='1e1e2e' bgl='313244' fg='d9e0ee'
|
bg='1e1e2e' bgl='313244' fg='d9e0ee'
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ done
|
|||||||
/usr/lib/xfce-polkit/xfce-polkit &
|
/usr/lib/xfce-polkit/xfce-polkit &
|
||||||
|
|
||||||
# Set wallpaper
|
# Set wallpaper
|
||||||
swaybg --output '*' --mode fill --image ~/.config/hypr/wallpapers/wallpaper.png &
|
swaybg --output '*' --mode fill --image ~/.config/hypr/wallpapers/wallpaper.webp &
|
||||||
|
|
||||||
# Apply themes
|
# Apply themes
|
||||||
~/.config/hypr/scripts/gtkthemes &
|
~/.config/hypr/scripts/gtkthemes &
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 149 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB |
@@ -346,7 +346,7 @@ exec --no-startup-id dex --autostart --environment i3
|
|||||||
|
|
||||||
# set wallpaper
|
# set wallpaper
|
||||||
# exec --no-startup-id sleep 2 && nitrogen --restore
|
# exec --no-startup-id sleep 2 && nitrogen --restore
|
||||||
exec --no-startup-id sleep 1 && feh --bg-fill ~/.config/i3/wallpaper.jpg
|
exec --no-startup-id sleep 1 && feh --bg-fill ~/.config/i3/wallpaper.webp
|
||||||
|
|
||||||
# set powersavings for display:
|
# set powersavings for display:
|
||||||
exec --no-startup-id xset s 480 dpms 600 600 600
|
exec --no-startup-id xset s 480 dpms 600 600 600
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
# 直接从当前文件夹中读取配置文件作为配置内容
|
# 直接从当前文件夹中读取配置文件作为配置内容
|
||||||
|
|
||||||
# wallpaper, binary file
|
# wallpaper, binary file
|
||||||
home.file.".config/i3/wallpaper.jpg".source = ../../wallpaper.jpg;
|
home.file.".config/i3/wallpaper.webp".source = ../wallpapers/wallpaper.webp;
|
||||||
home.file.".config/i3/config".source = ./config;
|
home.file.".config/i3/config".source = ./config;
|
||||||
home.file.".config/i3/i3blocks.conf".source = ./i3blocks.conf;
|
home.file.".config/i3/i3blocks.conf".source = ./i3blocks.conf;
|
||||||
home.file.".config/i3/keybindings".source = ./keybindings;
|
home.file.".config/i3/keybindings".source = ./keybindings;
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
playerctl
|
playerctl
|
||||||
pulsemixer
|
pulsemixer
|
||||||
|
|
||||||
|
ffmpeg-full
|
||||||
|
|
||||||
# images
|
# images
|
||||||
viu # terminal image viewer
|
viu # terminal image viewer
|
||||||
imv # simple image viewer
|
imv # simple image viewer
|
||||||
|
|||||||
37
home/wallpapers/convert_to_webp.nu
Normal file
37
home/wallpapers/convert_to_webp.nu
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# convert all png/jpeg images to webp
|
||||||
|
|
||||||
|
def to_webp [old_path: string, old_format: string] {
|
||||||
|
# 将后缀改为 .webp 得到新图片的 path
|
||||||
|
let webp_path = ($old_path | split row $old_format | append ".webp" | str collect)
|
||||||
|
# 使用 ffmpeg 进行格式转换
|
||||||
|
ffmpeg -y -i $old_path -c:v libwebp $webp_path
|
||||||
|
# 删除旧图片
|
||||||
|
rm $old_path
|
||||||
|
}
|
||||||
|
|
||||||
|
def replace_with_webp [old_path: string, old_format: string] {
|
||||||
|
# 将后缀改为 .webp 得到新图片的 path
|
||||||
|
let webp_path = ($old_path | split row $old_format | append ".webp" | str collect)
|
||||||
|
# 图片的旧名称与新名称
|
||||||
|
let old_name = ($old_path | path basename)
|
||||||
|
let webp_name = ($webp_path | path basename)
|
||||||
|
# 批量将 .md 文件中的所有图片名称,改为对应的 webp 图片名称
|
||||||
|
# 注:MacOS 需要首先安装好 gsed,Linux 请将下面的 gsed 替换为 sed
|
||||||
|
let cmd = $"gsed -ri 's/($old_name)/($webp_name)/g' `find . -name "*.md"`"
|
||||||
|
echo $cmd
|
||||||
|
bash -c $cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
def convert_format(old_format: string) {
|
||||||
|
# 递归找出所有大于 10kib 的图片
|
||||||
|
let old_paths = (ls $"**/*($old_format)" | where size > 10kb | each {|it| $it.name})
|
||||||
|
$old_paths | to md | save --raw ./old_paths.txt
|
||||||
|
|
||||||
|
# 1. 执行图片格式转换与压缩,同时删除原图片
|
||||||
|
$old_paths | each { |it| to_webp $it $old_format }
|
||||||
|
# 2. 执行 .md 文档中的图片名称替换
|
||||||
|
$old_paths | each { |it| replace_with_webp $it $old_format }
|
||||||
|
}
|
||||||
|
|
||||||
|
convert_format ".png"
|
||||||
|
convert_format ".jpg"
|
||||||
BIN
home/wallpapers/lockscreen.webp
Normal file
BIN
home/wallpapers/lockscreen.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
home/wallpapers/wallpaper-1.webp
Normal file
BIN
home/wallpapers/wallpaper-1.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
BIN
home/wallpapers/wallpaper.webp
Normal file
BIN
home/wallpapers/wallpaper.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 373 KiB |
BIN
wallpaper.jpg
BIN
wallpaper.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 534 KiB |
Reference in New Issue
Block a user