Compare commits

..

2 Commits

Author SHA1 Message Date
syedm bb6e4624db Add kutu config 2026-07-07 23:10:13 +01:00
syedm 91044efd80 Restructure 2026-07-07 21:47:49 +01:00
13 changed files with 224 additions and 48 deletions
+1
View File
@@ -1,2 +1,3 @@
.pos .pos
p.vim p.vim
log.txt
Generated
+4 -4
View File
@@ -26,11 +26,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1783430313, "lastModified": 1783461814,
"narHash": "sha256-OPyKjRU+DqJoF1qMtW8x8bzZQFczzC7c/dFhHwpaj9M=", "narHash": "sha256-ycpzjXjMey4PlAFYeprz2nHI2azxkvEn3wNvHee+Yh0=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "7fb1ea8cb3fa4b80f684239fb962cfd3288f3e37", "rev": "4b8599132f26d75bddfe613bcf9697ce0f91d212",
"revCount": 35, "revCount": 40,
"type": "git", "type": "git",
"url": "https://git.syedm.dev/syedm/kutu.rb.git" "url": "https://git.syedm.dev/syedm/kutu.rb.git"
}, },
+50
View File
@@ -0,0 +1,50 @@
{ config, pkgs, ... }:
let
batteryNotify = pkgs.writeShellScript "battery-notify" ''
BAT="/sys/class/power_supply/BAT1"
LEVEL=$(cat "$BAT/capacity")
STATUS=$(cat "$BAT/status")
if [ "$STATUS" = "Discharging" ] && [ "$LEVEL" -lt 90 ]; then
${pkgs.dunst}/bin/dunstify \
-r 9991 \
-t 0 \
-u critical \
"Battery Low" \
"Battery is at ''${LEVEL}%"
else
${pkgs.dunst}/bin/dunstify \
-C 9991 2>/dev/null || true
fi
'';
in
{
systemd.user.services.battery-notify = {
Unit = {
Description = "Low battery notification";
After = [ "dunst.service" ];
Requires = [ "dunst.service" ];
};
Service = {
Type = "oneshot";
ExecStart = batteryNotify;
};
};
systemd.user.timers.battery-notify = {
Unit = {
Description = "Check battery level every 20 seconds";
};
Timer = {
OnBootSec = "20s";
OnUnitActiveSec = "20s";
};
Install = {
WantedBy = [ "timers.target" ];
};
};
}
+2
View File
@@ -2,12 +2,14 @@
{ {
imports = [ imports = [
./battery
./btop ./btop
./dunst ./dunst
./eza ./eza
./fastfetch ./fastfetch
./fish ./fish
./kitty ./kitty
./kutu
./nvim ./nvim
./picom ./picom
./rofi ./rofi
+89
View File
@@ -0,0 +1,89 @@
bind_key 23, true, "firefox"
bind_key 24, true, :kill_window
bind_key 25, true, "kitty"
bind_key 26, true, "bash /home/me/dotfiles/scripts/power.sh"
bind_key 123, false, %q(
pactl set-sink-volume @DEFAULT_SINK@ +5%;
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | head -n1);
dunstify "Volume Adjusted" "" -h int:value:$vol -r 997
)
bind_key 122, false, %q(
pactl set-sink-volume @DEFAULT_SINK@ -5%;
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | head -n1);
dunstify "Volume Adjusted" "" -h int:value:$vol -r 997
)
bind_key 121, false, %q(
pactl set-sink-mute @DEFAULT_SINK@ toggle;
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]\+%' | head -n1);
dunstify "Volume Adjusted" "" -h int:value:$vol -r 997
)
bind_key 38, true, %Q(
maim -c 0.3,0.5,1.0,0.8 -s | tee /tmp/screenshot_temp.png | xclip -selection clipboard -t image/png;
if [ -s '/tmp/screenshot_temp.png' ]; then
mv /tmp/screenshot_temp.png ~/screenshots/$(date +%Y-%m-%d_%H:%M:%S).png;
fi
)
bind_key 232, false, %q(
brightnessctl set 5%-;
pct=$(brightnessctl -m | cut -d, -f4 | tr -d ' %');
dunstify "Brightness" "" -h int:value:$pct -r 998
)
bind_key 233, false, %q(
brightnessctl set 5%+;
pct=$(brightnessctl -m | cut -d, -f4 | tr -d ' %');
dunstify "Brightness" "" -h int:value:$pct -r 998
)
bind_key 54, true, 'kitty -e fish -c "y"'
bind_key 53, true, 'kitty -e fish -c "editor"'
bind_key 41, true, 'kitty -e fish -c "btop"'
bind_key 40, true, "bash /home/me/dotfiles/scripts/run.sh"
bind_key 56, true, :add_workspace
bind_key 57, true, :delete_workspace
bind_key 110, false, %q(
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify \
/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause;
dbus-send --print-reply --dest=$(busctl --user list | grep -oP 'org.mpris.MediaPlayer2.firefox.instance_1_\d+') \
/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
)
bind_key 173, true,
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"
bind_key 171, true,
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"
bind_key 89, true, :toggle_scratchpad
bind_key 81, true, :toggle_move_scratchpad
bind_key 118, false,
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
bind_key 86, false, :workspace_next
bind_key 86, true, :move_window_next_workspace
bind_key 82, false, :workspace_previous
bind_key 82, true, :move_window_previous_workspace
bind_key 10, true, "setxkbmap us"
bind_key 11, true, "setxkbmap ara"
bind_key 55, true, "CM_LAUNCHER=rofi clipmenu"
bind_key 39, true, :toggle_floating
bind_mouse 9, false, :workspace_next
bind_mouse 9, true, :move_window_next_workspace
bind_mouse 8, false, :workspace_previous
bind_mouse 8, true, :move_window_previous_workspace
+5
View File
@@ -0,0 +1,5 @@
{ ... }:
{
home.file.".config/kutu/config.rb".source = ./config.rb;
}
-2
View File
@@ -54,10 +54,8 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
libinput libinput
nodejs
gnupg gnupg
age age
eza
yazi yazi
gitui gitui
bind bind
-2
View File
@@ -4,8 +4,6 @@
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/battery
]; ];
boot.blacklistedKernelModules = [ boot.blacklistedKernelModules = [
-40
View File
@@ -1,40 +0,0 @@
{ config, pkgs, ... }:
let
batteryNotify = pkgs.writeShellScript "battery-notify" ''
BAT="/sys/class/power_supply/BAT1"
LEVEL=$(cat "$BAT/capacity")
STATUS=$(cat "$BAT/status")
ID=9991
if [ "$STATUS" = "Discharging" ] && [ "$LEVEL" -lt 20 ]; then
${pkgs.dunst}/bin/dunstify \
-r "$ID" -t 0 \
-u critical \
"Battery Low" \
"Battery is at ''${LEVEL}%"
else
${pkgs.dunst}/bin/dunstify \
-C "$ID" 2>/dev/null || true
fi
'';
in
{
systemd.services.battery-notify = {
description = "Low battery notification";
serviceConfig = {
Type = "oneshot";
ExecStart = batteryNotify;
};
};
systemd.timers.battery-notify = {
description = "Check battery level every 20 seconds";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "20s";
OnUnitActiveSec = "20s";
};
};
}
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
if [[ "$(xset q | awk '/timeout:/ {print $2}')" == "0" ]]; then
xset s on
xset +dpms
else
xset s off
xset -dpms
fi
+42
View File
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -euo pipefail
opts=" Lock
󰒲 Suspend
 Shutdown
󰜉 Reboot
 Hibernate
 Stop KutuWM"
sel=$(printf "%s\n" "$opts" | dmenu -i -p "Select Power Option:" \
-nf '#e0af68' -nb '#1f2335' -sb '#f7768e' -sf '#1a1b26' -fn 'AgaveNerdFont-16')
[ -z "$sel" ] && exit 0
case "$sel" in
*Shutdown*)
confirm=$(printf "No\nYes" | dmenu -i -p "Are you sure you want to shutdown? :" \
-nf '#e0af68' -nb '#1f2335' -sb '#f7768e' -sf '#1a1b26' -fn 'AgaveNerdFont-16')
[ "$confirm" = "Yes" ] && exec shutdown -h now
;;
*Reboot*)
confirm=$(printf "No\nYes" | dmenu -i -p "Are you sure you want to reboot? :" \
-nf '#e0af68' -nb '#1f2335' -sb '#f7768e' -sf '#1a1b26' -fn 'HurmitNerdFont-16')
[ "$confirm" = "Yes" ] && exec reboot
;;
*Hibernate*)
confirm=$(printf "No\nYes" | dmenu -i -p "Are you sure you want to hibernate? :" \
-nf '#e0af68' -nb '#1f2335' -sb '#f7768e' -sf '#1a1b26' -fn 'AgaveNerdFont-16')
[ "$confirm" = "Yes" ] && exec systemctl hibernate
;;
*Stop\ KutuWM*)
exec kutu-run.rb stop
;;
*Suspend*)
exec systemctl suspend
;;
*Lock*)
~/dotfiles/scripts/lock.sh &
;;
esac
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
choice=$(
(
printf "%s\n" prism
compgen -c
) |
grep -v -E '^(if|fi|case|esac|for|done|while|until|select|function|return|continue|break|time|exec|source|alias|builtin|read|export|unset|local|set|declare|typeset|:|\.|\[|coproc|l|ll|ls|then|else|elif|do|in|\{|\}|!|\[\[|\]\]|_.*|compgen)$' |
sort |
dmenu -i -p "Enter command  " \
-nf '#4abaaf' -nb '#1f2335' -sb '#7aa2f7' -sf '#102030' -fn 'AgaveNerdFont-16'
)
[ -z "$choice" ] && exit 0
fish -c "$choice" >/dev/null 2>&1 &
disown
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
xsetroot -cursor_name left_ptr
setxkbmap us