Current working changes to configuration
This commit is contained in:
commit
0a24ffcef1
66 changed files with 5312 additions and 0 deletions
91
home/aselimov/theme/theme.nix
Normal file
91
home/aselimov/theme/theme.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{config, pkgs, ... }:
|
||||
{
|
||||
home.file."bin/themer.sh" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set_theme() {
|
||||
scheme="$(${pkgs.glib}/bin/gsettings get \
|
||||
org.gnome.desktop.interface color-scheme)"
|
||||
|
||||
if [[ "$scheme" == *dark* ]]; then
|
||||
wallpaper="$HOME/media/pics/wall-dark.png"
|
||||
fuzzel="$HOME/.config/fuzzel/themes/zenwritten-dark.ini"
|
||||
mako="$HOME/.config/mako/themes/zenwritten-dark.conf"
|
||||
tmux="$HOME/.config/tmux/themes/zenwritten-dark.conf"
|
||||
keys=$'<C-\\><C-n>:silent! let g:light_mode=0 | set background=dark | doautocmd ColorScheme | redraw!<CR>'
|
||||
|
||||
else
|
||||
wallpaper="$HOME/media/pics/wall-light.png"
|
||||
fuzzel="$HOME/.config/fuzzel/themes/zenwritten-light.ini"
|
||||
mako="$HOME/.config/mako/themes/zenwritten-light.conf"
|
||||
tmux="$HOME/.config/tmux/themes/zenwritten-light.conf"
|
||||
keys=$'<C-\\><C-n>:silent! let g:light_mode=1 | set background=light | doautocmd ColorScheme | redraw!<CR>'
|
||||
fi
|
||||
|
||||
${pkgs.awww}/bin/awww img "$wallpaper" \
|
||||
--transition-type fade \
|
||||
--transition-duration 0.4
|
||||
|
||||
ln -sf "$fuzzel" "$HOME/.config/fuzzel/colors.ini"
|
||||
ln -sf "$mako" "$HOME/.config/mako/theme.conf"
|
||||
ln -sf "$tmux" $HOME/.config/tmux/theme.conf
|
||||
makoctl reload
|
||||
tmux source-file ~/.config/tmux/theme.conf
|
||||
for dir in "$XDG_RUNTIME_DIR-}" "/tmp" "$HOME/.local/state/nvim"; do
|
||||
[ -d "$dir" ] || continue
|
||||
find "$dir" -type s -name 'nvim*' 2>/dev/null | while read -r sock; do
|
||||
timeout 1s nvim --server "$sock" --remote-send "$keys" >/dev/null 2>&1 || true
|
||||
done
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
set_theme
|
||||
|
||||
${pkgs.glib}/bin/gsettings monitor \
|
||||
org.gnome.desktop.interface color-scheme |
|
||||
while read -r _; do
|
||||
set_theme
|
||||
done
|
||||
'';
|
||||
};
|
||||
home.file."media/pics/wall-light.png".source = ./wall-light.png;
|
||||
home.file."media/pics/wall-dark.png".source = ./wall-dark.png;
|
||||
|
||||
systemd.user.services.awww = {
|
||||
Unit = {
|
||||
Description = "Awww wallpaper daemon";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${pkgs.awww}/bin/awww-daemon";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.themer = {
|
||||
Unit = {
|
||||
Description = "gsettings monitor to swap light/dark themes";
|
||||
After = [ "graphical-session.target" "awww.service"];
|
||||
Requires = [ "awww.service" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "/home/aselimov/bin/themer.sh";
|
||||
Restart = "always";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue