Compare commits
3 Commits
feature/el
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fa4cb4996 | |||
| 7b929c0b02 | |||
| 1d5f428cb1 |
@ -1,3 +1,3 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "askpass" ''
|
||||
${pkgs.wofi}/bin/wofi -d -P -L 1 -p "$(printf $1 | sed s/://)"''
|
||||
${pkgs.rofi}/bin/rofi -dmenu -password -no-fixed-num-lines -p $(printf \"$*\" | sed 's/://')''
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "rofi-emoji" ''
|
||||
SELECTED_EMOJI=$(grep -v "#" ~/.config/emoji | ${pkgs.wofi}/bin/wofi --dmenu -p "Select emoji" -i | awk '{print $1}' | tr -d '\n')
|
||||
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
||||
printf "%s" "$SELECTED_EMOJI" | ${pkgs.wl-clipboard-rs}/bin/wl-copy
|
||||
else
|
||||
printf "%s" "$SELECTED_EMOJI" | ${pkgs.xclip}/bin/xclip -sel clip
|
||||
fi
|
||||
|
||||
if [ "$XDG_SESSION_TYPE" = "wayland" ]
|
||||
then EMOJI=$(${pkgs.wl-clipboard-rs}/bin/wl-paste)
|
||||
else EMOJI=$(${pkgs.xclip}/bin/xclip -o)
|
||||
fi
|
||||
|
||||
test -z "$EMOJI" && notify-send "No emoji copied" -u low && exit
|
||||
EMOJI="$EMOJI copied to clipboard"
|
||||
${pkgs.libnotify}/bin/notify-send -u low "$EMOJI"
|
||||
''
|
||||
@ -1,6 +1,6 @@
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "ytplay" ''
|
||||
URL=$(${pkgs.wofi}/bin/wofi --dmenu -i -p "Video URL")
|
||||
URL=$(rofi -dmenu -i -p "Video URL")
|
||||
if [ -z "$URL" ]; then
|
||||
echo "You need to provide a URL"
|
||||
exit 1
|
||||
@ -9,7 +9,7 @@ pkgs.writeShellScriptBin "ytplay" ''
|
||||
grep -E "webm.*[0-9]+x[0-9]" | \
|
||||
awk '{print $3 " " $1}' | \
|
||||
sort -gu | \
|
||||
${pkgs.wofi}/bin/wofi --dmenu -i -p "Resolution")
|
||||
rofi -dmenu -i -p "Resolution")
|
||||
mapfile -t RESOLUTION <<< "$RESOLUTION_CHOICE"
|
||||
RESOLUTION_CODE=''${RESOLUTION[0]}
|
||||
${pkgs.mpv}/bin/mpv --ytdl-format="''${RESOLUTION_CODE}+bestaudio/best" "$URL"
|
||||
|
||||
@ -7,17 +7,16 @@ with lib; let
|
||||
cfg = config.home.desktop;
|
||||
in {
|
||||
imports = [
|
||||
./emoji.nix
|
||||
./eww.nix
|
||||
./hyprland.nix
|
||||
./kdeconnect.nix
|
||||
./kitty.nix
|
||||
./obs.nix
|
||||
./qt.nix
|
||||
./rofi
|
||||
./swaync.nix
|
||||
./waybar.nix
|
||||
./wlsunset.nix
|
||||
./wofi.nix
|
||||
];
|
||||
|
||||
options.home.desktop.fullDesktop = mkEnableOption "Enable options for graphical environments";
|
||||
@ -28,5 +27,6 @@ in {
|
||||
kitty.enable = mkDefault cfg.fullDesktop;
|
||||
obs.enable = mkDefault cfg.fullDesktop;
|
||||
qt.enable = mkDefault cfg.fullDesktop;
|
||||
rofi.enable = mkDefault cfg.fullDesktop;
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -6,13 +6,13 @@
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.desktop.hyprland;
|
||||
rofi-emoji = import ../cli/scripts/rofi-emoji.nix {inherit pkgs;};
|
||||
laptops = ["gampo"];
|
||||
in {
|
||||
imports = [
|
||||
./swaync.nix
|
||||
./waybar.nix
|
||||
./wlsunset.nix
|
||||
./hyprpaper.nix
|
||||
];
|
||||
|
||||
options.home.desktop.hyprland = {
|
||||
@ -34,14 +34,16 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.desktop = {
|
||||
hyprpaper.enable = true;
|
||||
rofi.enable = mkDefault true;
|
||||
swaync.enable = mkDefault true;
|
||||
waybar = {
|
||||
enable = mkDefault true;
|
||||
battery = mkDefault (builtins.elem cfg.host laptops);
|
||||
};
|
||||
wlsunset.enable = mkDefault true;
|
||||
wofi.enable = mkDefault true;
|
||||
};
|
||||
services.blueman-applet.enable = true;
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
@ -112,7 +114,7 @@ in {
|
||||
$right = r
|
||||
$up = s
|
||||
$down = t
|
||||
$menu = ${pkgs.wofi}/bin/wofi --show drun
|
||||
$menu = rofi -combi-modi drun,calc -show combi
|
||||
|
||||
bind = SUPER, Return, exec, ${pkgs.kitty}/bin/kitty ${pkgs.tmux}/bin/tmux
|
||||
bind = SUPER, Space, submap, leader
|
||||
@ -159,10 +161,14 @@ in {
|
||||
bind = , escape, submap, reset
|
||||
bind = CTRL, g, submap, reset
|
||||
submap = rofi
|
||||
bind = , e, exec, ${rofi-emoji}/bin/rofi-emoji
|
||||
bind = , b, exec, rofi-bluetooth
|
||||
bind = , b, submap, reset
|
||||
bind = , e, exec, rofi -show emoji
|
||||
bind = , e, submap, reset
|
||||
bind = , r, exec, $menu
|
||||
bind = , r, submap, reset
|
||||
bind = , s, exec, rofi -show ssh
|
||||
bind = , r, submap, reset
|
||||
bind = , y, exec, ytplay
|
||||
bind = , y, submap, reset
|
||||
bind = , escape, submap, reset
|
||||
@ -271,17 +277,5 @@ in {
|
||||
bind = SUPER_SHIFT, asterisk, movetoworkspace, 10
|
||||
'';
|
||||
};
|
||||
services = {
|
||||
blueman-applet.enable = true;
|
||||
hyprpaper = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ipc = "on";
|
||||
splash = false;
|
||||
preload = "/home/phundrak/Pictures/Wallpapers/nord/Nordic6.jpg";
|
||||
wallpaper = ", /home/phundrak/Pictures/Wallpapers/nord/Nordic6.jpg";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
87
users/modules/desktop/hyprpaper.nix
Normal file
87
users/modules/desktop/hyprpaper.nix
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.desktop.hyprpaper;
|
||||
in {
|
||||
options.home.desktop.hyprpaper = {
|
||||
enable = mkEnableOption "Enables Hyprpaper";
|
||||
default = mkOption {
|
||||
type = types.str;
|
||||
default = "/home/phundrak/Pictures/Wallpapers/nord/Nordic6.jpg";
|
||||
example = "/home/user/image.jpg";
|
||||
};
|
||||
wallpapers-dir = mkOption {
|
||||
type = types.str;
|
||||
default = "/home/phundrak/Pictures/Wallpapers/nord/";
|
||||
example = "/home/user/Pictures/";
|
||||
};
|
||||
rotation-interval = mkOption {
|
||||
type = types.str;
|
||||
default = "5m";
|
||||
example = "10m";
|
||||
description = "Interval between wallpaper rotations";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.hyprpaper = {
|
||||
inherit (cfg) enable;
|
||||
settings = {
|
||||
ipc = "on";
|
||||
splash = false;
|
||||
preload = cfg.default;
|
||||
wallpaper = ", ${cfg.default}";
|
||||
};
|
||||
};
|
||||
systemd.user = {
|
||||
services.hyprpaper-rotation = {
|
||||
Unit = {
|
||||
Description = "Rotate Hyprpaper wallpaper";
|
||||
After = "graphical-session.target";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecCondition = "pidof Hyprland";
|
||||
ExecStart = "${config.home.homeDirectory}/.config/hypr/hyprpaper-rotate.sh";
|
||||
};
|
||||
};
|
||||
|
||||
timers.hyprpaper-rotation = {
|
||||
Unit = {
|
||||
Description = "Timer for rotating Hyprpaper wallpaper";
|
||||
};
|
||||
Timer = {
|
||||
OnBootSec = cfg.rotation-interval;
|
||||
OnUnitActiveSec = cfg.rotation-interval;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["timers.target"];
|
||||
};
|
||||
};
|
||||
};
|
||||
home.file.".config/hypr/hyprpaper-rotate.sh" = {
|
||||
text = ''
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
WALLPAPER_DIR="${cfg.wallpapers-dir}"
|
||||
|
||||
# Find a random wallpaper
|
||||
WP=$(find "$WALLPAPER_DIR" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n 1)
|
||||
|
||||
if [ -z "$WP" ]; then
|
||||
echo "No wallpapers found in $WALLPAPER_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Setting wallpaper to: $WP"
|
||||
|
||||
# Load and set the wallpaper
|
||||
hyprctl hyprpaper preload "$WP" && hyprctl hyprpaper wallpaper ",$WP"
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
107
users/modules/desktop/rofi/default.nix
Normal file
107
users/modules/desktop/rofi/default.nix
Normal file
@ -0,0 +1,107 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.desktop.rofi;
|
||||
inherit (config.lib.formats.rasi) mkLiteral;
|
||||
in {
|
||||
options.home.desktop.rofi = {
|
||||
enable = mkEnableOption "Enable Rofi";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [rofi-bluetooth];
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
plugins = with pkgs; [
|
||||
rofi-calc
|
||||
rofi-emoji
|
||||
];
|
||||
terminal = "${pkgs.kitty}/bin/kitty";
|
||||
location = "center";
|
||||
modes = ["drun" "emoji" "calc" "combi"];
|
||||
extraConfig.show-icons = true;
|
||||
theme = {
|
||||
"*" = {
|
||||
font = "Cascadia Code 14";
|
||||
blur = true;
|
||||
padding = mkLiteral "10px";
|
||||
background-color = mkLiteral "transparent";
|
||||
border-radius = mkLiteral "0px";
|
||||
};
|
||||
window = {
|
||||
width = mkLiteral "1050px";
|
||||
height = mkLiteral "625px";
|
||||
location = mkLiteral "center";
|
||||
blur = true;
|
||||
border = mkLiteral "2px";
|
||||
border-radius = mkLiteral "3px";
|
||||
border-color = mkLiteral "#61afef";
|
||||
background-color = mkLiteral "transparent";
|
||||
padding = mkLiteral "0px";
|
||||
margin = mkLiteral "30px 50px";
|
||||
};
|
||||
mainbox = {
|
||||
orientation = mkLiteral "horizontal";
|
||||
children = map mkLiteral ["borderbox"];
|
||||
spacing = mkLiteral "0px";
|
||||
padding = mkLiteral "0px";
|
||||
};
|
||||
borderbox = {
|
||||
orientation = mkLiteral "horizontal";
|
||||
children = map mkLiteral ["imagebox" "contentbox"];
|
||||
padding = mkLiteral "0px";
|
||||
spacing = mkLiteral "0px";
|
||||
border-radius = mkLiteral "3px";
|
||||
};
|
||||
contentbox = {
|
||||
orientation = mkLiteral "vertical";
|
||||
children = map mkLiteral ["entry" "listview"];
|
||||
spacing = mkLiteral "0px";
|
||||
padding = mkLiteral "0px";
|
||||
expand = true;
|
||||
};
|
||||
imagebox = {
|
||||
background-image = mkLiteral "url(\"${./image.jpg}\")";
|
||||
background-repeat = false;
|
||||
size = mkLiteral "200px 625px";
|
||||
};
|
||||
element = {
|
||||
border-radius = mkLiteral "0px";
|
||||
};
|
||||
"element-text, element-icon" = {
|
||||
padding = mkLiteral "6px 8px";
|
||||
spacing = mkLiteral "2px";
|
||||
text-color = mkLiteral "#fab387";
|
||||
};
|
||||
"element selected" = {
|
||||
background-color = mkLiteral "#191919";
|
||||
text-color = mkLiteral "#e5c07b";
|
||||
border-radius = mkLiteral "3px";
|
||||
};
|
||||
prompt = {
|
||||
enabled = false;
|
||||
background-color = mkLiteral "transparent";
|
||||
text-color = mkLiteral "#61afef";
|
||||
padding = mkLiteral "5px 10px";
|
||||
};
|
||||
entry = {
|
||||
padding = mkLiteral "8px";
|
||||
expand = false;
|
||||
font = "Cascadia Code 14";
|
||||
text-color = mkLiteral "#fab387";
|
||||
border-radius = mkLiteral "0px 3px 0px 0px";
|
||||
background-color = mkLiteral "#292e36";
|
||||
};
|
||||
listview = {
|
||||
lines = mkLiteral "1";
|
||||
background-color = mkLiteral "rgba(46, 52, 64, 0.8)";
|
||||
border-radius = mkLiteral "0px 0px 3px 0px";
|
||||
padding = mkLiteral "5px";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
BIN
users/modules/desktop/rofi/image.jpg
Normal file
BIN
users/modules/desktop/rofi/image.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 228 KiB |
@ -1,76 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.desktop.wofi;
|
||||
in {
|
||||
options.home.desktop.wofi.enable = mkEnableOption "Enable wofi support";
|
||||
config.programs.wofi = mkIf cfg.enable {
|
||||
inherit (cfg) enable;
|
||||
settings = {
|
||||
modi = "ssh,drun,combi";
|
||||
sidebar-mode = false;
|
||||
width = 50;
|
||||
line-margin = 10;
|
||||
lines = 6;
|
||||
columns = 2;
|
||||
display-ssh = "";
|
||||
display-run = "";
|
||||
display-drun = "";
|
||||
display-window = "";
|
||||
display-combi = "";
|
||||
show-icons = true;
|
||||
};
|
||||
# from https://github.com/alxndr13/wofi-nord-theme
|
||||
style = ''
|
||||
* {
|
||||
font-family: "Hack", monospace;
|
||||
}
|
||||
|
||||
window {
|
||||
background-color: #3B4252;
|
||||
}
|
||||
|
||||
#input {
|
||||
margin: 5px;
|
||||
border-radius: 0px;
|
||||
border: none;
|
||||
background-color: #3B4252;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#inner-box {
|
||||
background-color: #383C4A;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
margin: 2px;
|
||||
padding: 10px;
|
||||
background-color: #383C4A;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#text {
|
||||
padding: 4px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#entry:nth-child(even){
|
||||
background-color: #404552;
|
||||
}
|
||||
|
||||
#entry:selected {
|
||||
background-color: #4C566A;
|
||||
}
|
||||
|
||||
#text:selected {
|
||||
background: transparent;
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@ -6,9 +6,35 @@
|
||||
}:
|
||||
with lib; let
|
||||
emacsDefaultPackage = with pkgs; ((emacsPackagesFor emacs).emacsWithPackages (
|
||||
epkgs: [
|
||||
epkgs.mu4e
|
||||
epkgs.pdf-tools
|
||||
epkgs:
|
||||
with epkgs; [
|
||||
mu4e
|
||||
pdf-tools
|
||||
tree-sitter
|
||||
tree-sitter-langs
|
||||
(treesit-grammars.with-grammars (grammar:
|
||||
with grammar; [
|
||||
tree-sitter-bash
|
||||
tree-sitter-c
|
||||
tree-sitter-cpp
|
||||
tree-sitter-css
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-http
|
||||
tree-sitter-javascript
|
||||
tree-sitter-jsdoc
|
||||
tree-sitter-json
|
||||
tree-sitter-just
|
||||
tree-sitter-markdown
|
||||
tree-sitter-markdown-inline
|
||||
tree-sitter-nix
|
||||
tree-sitter-rust
|
||||
tree-sitter-sql
|
||||
tree-sitter-toml
|
||||
tree-sitter-typescript
|
||||
tree-sitter-typst
|
||||
tree-sitter-vue
|
||||
tree-sitter-yaml
|
||||
]))
|
||||
]
|
||||
));
|
||||
cfg = config.home.dev.editors.emacs;
|
||||
@ -25,7 +51,10 @@ in {
|
||||
};
|
||||
|
||||
config = {
|
||||
home.packages = [pkgs.emacs-all-the-icons-fonts];
|
||||
home.packages = with pkgs; [
|
||||
emacs-all-the-icons-fonts
|
||||
emacs-lsp-booster
|
||||
];
|
||||
programs.emacs = mkIf cfg.enable {
|
||||
enable = true;
|
||||
inherit (cfg) package;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user