1
Fork 0

Keybind to toggle wlsunset (with notifications!)

This commit is contained in:
Matei Adriel 2023-05-31 05:06:51 +02:00
parent a7f303f8ac
commit 2631071221
No known key found for this signature in database
2 changed files with 21 additions and 3 deletions

View file

@ -32,7 +32,7 @@ gestures {
} }
# Execute apps at launch # Execute apps at launch
exec-once = NO_TMUX=1 wezterm & firefox & discord exec-once = wezterm & firefox & discord
# {{{ Window rules # {{{ Window rules
# {{{ Automatically move stuff to workspaces # {{{ Automatically move stuff to workspaces
@ -51,17 +51,18 @@ windowrulev2 = idleinhibit focus, class:^(firefox)$, title:^(.*YouTube.*)$
# {{{ Keybinds # {{{ Keybinds
$mod = SUPER $mod = SUPER
#u {{{ General # {{{ General
bind = $mod, C, killactive, # Kill current bind = $mod, C, killactive, # Kill current
bind = $mod, F, fullscreen, # Fullscreen bind = $mod, F, fullscreen, # Fullscreen
# Execute external things # Execute external things
bind = $mod, return, exec, NO_TMUX=1 wezterm # Launch wezterm bind = $mod, return, exec, wezterm # Launch wezterm
bind = $mod, T, exec, wl-ocr # Use ocr script bind = $mod, T, exec, wl-ocr # Use ocr script
bind = $mod SHIFT, T, exec, hyprpicker | wl-copy && libnotify "Copied color $(wp-paste)" # Color picker bind = $mod SHIFT, T, exec, hyprpicker | wl-copy && libnotify "Copied color $(wp-paste)" # Color picker
bind = $mod, Q, exec, wlogout # Show logout menu bind = $mod, Q, exec, wlogout # Show logout menu
bind = $mod, L, exec, loginctl lock-session # Lock screen bind = $mod, L, exec, loginctl lock-session # Lock screen
bind = $mod, P, exec, wofi --show drun # Launch app bind = $mod, P, exec, wofi --show drun # Launch app
bind = $mod, B, exec, wlsunset-toggle # Toggle blue light filter thingy
# Work with the special workspace # Work with the special workspace
bind = $mod, x, togglespecialworkspace, bind = $mod, x, togglespecialworkspace,

View file

@ -1,3 +1,18 @@
{ pkgs, lib, ... }:
let
libnotify = lib.getExe pkgs.libnotify;
wlsunset-toggle = pkgs.writeShellScriptBin "wlsunset-toggle" ''
if [ "active" = "$(systemctl --user is-active wlsunset.service)" ]
then
systemctl --user stop wlsunset.service
${libnotify} "Stopped wlsunset"
else
systemctl --user start wlsunset.service
${libnotify} "Started wlsunset"
fi
'';
in
{ {
services.wlsunset = { services.wlsunset = {
enable = true; enable = true;
@ -6,4 +21,6 @@
latitude = "53.2"; latitude = "53.2";
longitude = "6.5"; longitude = "6.5";
}; };
home.packages = [ wlsunset-toggle ];
} }