mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 02:40:14 +00:00
move all files to new nixfmt rfc
This commit is contained in:
@ -2,14 +2,14 @@
|
||||
let
|
||||
|
||||
rofi = config.home-manager.users.${config.user}.programs.rofi.finalPackage;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
# Adapted from:
|
||||
# A rofi powered menu to execute brightness choices.
|
||||
|
||||
config.brightnessCommand = builtins.toString
|
||||
(pkgs.writeShellScript "brightness" ''
|
||||
config.brightnessCommand = builtins.toString (
|
||||
pkgs.writeShellScript "brightness" ''
|
||||
|
||||
dimmer=""
|
||||
medium=""
|
||||
@ -45,6 +45,6 @@ in {
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
|
||||
'');
|
||||
|
||||
''
|
||||
);
|
||||
}
|
||||
|
@ -2,62 +2,63 @@
|
||||
let
|
||||
|
||||
rofi = config.home-manager.users.${config.user}.programs.rofi.finalPackage;
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
# Adapted from:
|
||||
# https://gitlab.com/vahnrr/rofi-menus/-/blob/b1f0e8a676eda5552e27ef631b0d43e660b23b8e/scripts/rofi-power
|
||||
# A rofi powered menu to execute power related action.
|
||||
|
||||
config.powerCommand = builtins.toString (pkgs.writeShellScript "powermenu" ''
|
||||
power_off=''
|
||||
reboot=''
|
||||
lock=''
|
||||
suspend=''
|
||||
log_out=''
|
||||
config.powerCommand = builtins.toString (
|
||||
pkgs.writeShellScript "powermenu" ''
|
||||
power_off=''
|
||||
reboot=''
|
||||
lock=''
|
||||
suspend=''
|
||||
log_out=''
|
||||
|
||||
chosen=$(printf '%s;%s;%s;%s;%s\n' \
|
||||
"$power_off" \
|
||||
"$reboot" \
|
||||
"$lock" \
|
||||
"$suspend" \
|
||||
"$log_out" \
|
||||
| ${rofi}/bin/rofi \
|
||||
-theme-str '@import "power.rasi"' \
|
||||
-hover-select \
|
||||
-me-select-entry "" \
|
||||
-me-accept-entry MousePrimary \
|
||||
-dmenu \
|
||||
-sep ';' \
|
||||
-selected-row 2)
|
||||
chosen=$(printf '%s;%s;%s;%s;%s\n' \
|
||||
"$power_off" \
|
||||
"$reboot" \
|
||||
"$lock" \
|
||||
"$suspend" \
|
||||
"$log_out" \
|
||||
| ${rofi}/bin/rofi \
|
||||
-theme-str '@import "power.rasi"' \
|
||||
-hover-select \
|
||||
-me-select-entry "" \
|
||||
-me-accept-entry MousePrimary \
|
||||
-dmenu \
|
||||
-sep ';' \
|
||||
-selected-row 2)
|
||||
|
||||
confirm () {
|
||||
${builtins.readFile ./rofi-prompt.sh}
|
||||
}
|
||||
confirm () {
|
||||
${builtins.readFile ./rofi-prompt.sh}
|
||||
}
|
||||
|
||||
case "$chosen" in
|
||||
"$power_off")
|
||||
confirm 'Shutdown?' && doas shutdown now
|
||||
;;
|
||||
case "$chosen" in
|
||||
"$power_off")
|
||||
confirm 'Shutdown?' && doas shutdown now
|
||||
;;
|
||||
|
||||
"$reboot")
|
||||
confirm 'Reboot?' && doas reboot
|
||||
;;
|
||||
"$reboot")
|
||||
confirm 'Reboot?' && doas reboot
|
||||
;;
|
||||
|
||||
"$lock")
|
||||
${pkgs.betterlockscreen}/bin/betterlockscreen --lock --display 1 --blur 0.5 --span
|
||||
;;
|
||||
"$lock")
|
||||
${pkgs.betterlockscreen}/bin/betterlockscreen --lock --display 1 --blur 0.5 --span
|
||||
;;
|
||||
|
||||
"$suspend")
|
||||
systemctl suspend
|
||||
;;
|
||||
"$suspend")
|
||||
systemctl suspend
|
||||
;;
|
||||
|
||||
"$log_out")
|
||||
confirm 'Logout?' && i3-msg exit
|
||||
;;
|
||||
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
'');
|
||||
"$log_out")
|
||||
confirm 'Logout?' && i3-msg exit
|
||||
;;
|
||||
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
''
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user