mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-10-05 11:18:24 +02:00
@@ -12,7 +12,7 @@
|
||||
then barHeight / 2
|
||||
else config.theme.rounding;
|
||||
in {
|
||||
imports = [./desktop-actions.nix];
|
||||
imports = [./desktop-actions.nix ./scripts.nix];
|
||||
programs.tofi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
||||
@@ -4,24 +4,6 @@
|
||||
...
|
||||
}: {
|
||||
xdg.desktopEntries = {
|
||||
focus-toggle = {
|
||||
name = "Focus Mode";
|
||||
exec = "${scripts.focus-toggle}/bin/focus-toggle";
|
||||
icon = "do-not-disturb-symbolic";
|
||||
comment = "Toggle focus mode";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
nightshift-toggle = {
|
||||
name = "Night Shift";
|
||||
exec = "${scripts.nightshift-toggle}/bin/nightshift-toggle";
|
||||
icon = "night-light-symbolic";
|
||||
comment = "Toggle night shift";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
mic-mute = {
|
||||
name = "Mute Microphone";
|
||||
exec = "${scripts.mic-mute}/bin/mic-mute";
|
||||
@@ -31,15 +13,6 @@
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
lock = {
|
||||
name = "Lock";
|
||||
exec = "${pkgs.hyprlock}/bin/hyprlock";
|
||||
icon = "system-lock-screen-symbolic";
|
||||
comment = "Lock the screen";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
reboot = {
|
||||
name = "Reboot";
|
||||
exec = "systemctl reboot";
|
||||
@@ -49,6 +22,15 @@
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
suspend = {
|
||||
name = "Suspend";
|
||||
exec = "systemctl suspend";
|
||||
icon = "system-suspend-symbolic";
|
||||
comment = "Suspend the system";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
shutdown = {
|
||||
name = "Shutdown";
|
||||
exec = "systemctl poweroff";
|
||||
@@ -67,15 +49,6 @@
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
waybar-toggle = {
|
||||
name = "Toggle Waybar";
|
||||
exec = "${scripts.waybar-toggle}/bin/waybar-toggle";
|
||||
icon = "panel-applets-symbolic";
|
||||
comment = "Show or hide the status bar";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
wifi-toggle = {
|
||||
name = "Toggle Wi-Fi";
|
||||
exec = "${scripts.wifi-toggle}/bin/wifi-toggle";
|
||||
@@ -154,16 +127,6 @@
|
||||
settings.Keywords = "record;recording;screencast;video;";
|
||||
};
|
||||
|
||||
power-cycle = {
|
||||
name = "Power Profile";
|
||||
exec = "${scripts.power-cycle}/bin/power-cycle";
|
||||
icon = "power-profile-balanced-symbolic";
|
||||
comment = "Cycle power-saver / balanced / performance";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
settings.Keywords = "power;profile;performance;battery;";
|
||||
};
|
||||
|
||||
airplane-toggle = {
|
||||
name = "Airplane Mode";
|
||||
exec = "${scripts.airplane-toggle}/bin/airplane-toggle";
|
||||
@@ -194,16 +157,6 @@
|
||||
settings.Keywords = "icon;nerdfont;glyph;symbol;";
|
||||
};
|
||||
|
||||
caffeine-toggle = {
|
||||
name = "Keep Awake";
|
||||
exec = "${scripts.caffeine-toggle}/bin/caffeine-toggle";
|
||||
icon = "my-caffeine-on-symbolic";
|
||||
comment = "Pause or resume idle locking and suspend";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
settings.Keywords = "caffeine;idle;awake;inhibit;suspend;";
|
||||
};
|
||||
|
||||
logout = {
|
||||
name = "Logout";
|
||||
exec = "${pkgs.hyprland}/bin/hyprctl dispatch exit";
|
||||
@@ -213,16 +166,6 @@
|
||||
terminal = false;
|
||||
};
|
||||
|
||||
dnd-toggle = {
|
||||
name = "Do Not Disturb";
|
||||
exec = "${scripts.dnd-toggle}/bin/dnd-toggle";
|
||||
icon = "notifications-disabled-symbolic";
|
||||
comment = "Toggle Do Not Disturb";
|
||||
categories = ["System"];
|
||||
terminal = false;
|
||||
settings.Keywords = "dnd;notifications;disturb;swaync;silence;";
|
||||
};
|
||||
|
||||
vol-mute = {
|
||||
name = "Mute Volume";
|
||||
exec = "${scripts.vol-mute}/bin/vol-mute";
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# Picker scripts built on tofi's dmenu mode: emoji and Nerd Font icon input.
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
scripts,
|
||||
...
|
||||
}: let
|
||||
tofiMenu = "${pkgs.tofi}/bin/tofi --horizontal false --anchor center --width 700 --height 500 --margin-top 0 --margin-left 0 --margin-right 0 --num-results 10";
|
||||
|
||||
nerdFontGlyphnames = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v3.4.0/glyphnames.json";
|
||||
sha256 = "sha256-4tENI/W/8L1vBnbpsB2XifzcZW3ntJiilVwncW6kQ5w=";
|
||||
};
|
||||
nerdFontIconList = pkgs.runCommand "nerd-font-icons.txt" {nativeBuildInputs = [pkgs.jq];} ''
|
||||
jq -r 'to_entries[] | select(.key != "METADATA") | "\(.value.char) \(.key)"' \
|
||||
${nerdFontGlyphnames} > "$out"
|
||||
'';
|
||||
in {
|
||||
scripts.emoji-picker = pkgs.writeShellScriptBin "emoji-picker" ''
|
||||
export PATH="${pkgs.wtype}/bin:${pkgs.wl-clipboard}/bin:$PATH"
|
||||
export BEMOJI_PICKER_CMD="${tofiMenu} --prompt-text 'emoji: '"
|
||||
# -t types the emoji, -c also copies it.
|
||||
exec ${pkgs.bemoji}/bin/bemoji -t -c
|
||||
'';
|
||||
|
||||
scripts.icon-picker = pkgs.writeShellScriptBin "icon-picker" ''
|
||||
selected=$(${tofiMenu} --font "${config.stylix.fonts.monospace.name}" --prompt-text 'icon: ' < ${nerdFontIconList})
|
||||
[ -z "$selected" ] || icon=$(printf '%s\n' "$selected" | awk '{print $1}')
|
||||
[ -n "''${icon:-}" ] || exit 0
|
||||
${pkgs.wtype}/bin/wtype "$icon"
|
||||
printf '%s' "$icon" | ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
'';
|
||||
|
||||
home.packages = [scripts.emoji-picker scripts.icon-picker];
|
||||
}
|
||||
Reference in New Issue
Block a user