From 7072cf1bdf2b8e4183ccb0247d8c5fa266ae315f Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Fri, 9 May 2025 11:27:42 +1200 Subject: Initial commit --- home-manager/YATwm/config | 0 home-manager/YATwm/default.nix | 109 ++++++++++ home-manager/emacs/default.nix | 31 +++ home-manager/home.nix | 136 ++++++++++++ home-manager/hyprland/default.nix | 148 +++++++++++++ home-manager/hyprland/default.nix~ | 95 +++++++++ home-manager/hyprland/hyprlock.conf | 41 ++++ home-manager/hyprpaper/default.nix | 10 + home-manager/hyprpaper/hyprpaper.conf | 3 + home-manager/i3/config | 332 ++++++++++++++++++++++++++++++ home-manager/i3/default.nix | 41 ++++ home-manager/i3/i3-commands.nix | 16 ++ home-manager/i3/scripts/exit.sh | 20 ++ home-manager/i3/scripts/image_upload.sh | 7 + home-manager/i3/scripts/monitor-config.sh | 23 +++ home-manager/i3/scripts/workspaces.sh | 7 + home-manager/i3/scripts/workspaces.txt | 11 + home-manager/kitty/default.nix | 24 +++ home-manager/kitty/palenight.conf | 40 ++++ home-manager/picom/default.nix | 18 ++ home-manager/polybar/config.ini | 183 ++++++++++++++++ home-manager/polybar/default.nix | 20 ++ home-manager/polybar/launch.sh | 20 ++ home-manager/rofi/config/config.rasi | 145 +++++++++++++ home-manager/rofi/config/customised.rasi | 195 ++++++++++++++++++ home-manager/rofi/default.nix | 13 ++ home-manager/shells/bash.nix | 80 +++++++ home-manager/waybar/config/config.jsonc | 57 +++++ home-manager/waybar/config/style.css | 71 +++++++ home-manager/waybar/default.nix | 16 ++ 30 files changed, 1912 insertions(+) create mode 100644 home-manager/YATwm/config create mode 100644 home-manager/YATwm/default.nix create mode 100644 home-manager/emacs/default.nix create mode 100644 home-manager/home.nix create mode 100644 home-manager/hyprland/default.nix create mode 100644 home-manager/hyprland/default.nix~ create mode 100644 home-manager/hyprland/hyprlock.conf create mode 100644 home-manager/hyprpaper/default.nix create mode 100644 home-manager/hyprpaper/hyprpaper.conf create mode 100644 home-manager/i3/config create mode 100644 home-manager/i3/default.nix create mode 100644 home-manager/i3/i3-commands.nix create mode 100755 home-manager/i3/scripts/exit.sh create mode 100755 home-manager/i3/scripts/image_upload.sh create mode 100755 home-manager/i3/scripts/monitor-config.sh create mode 100755 home-manager/i3/scripts/workspaces.sh create mode 100644 home-manager/i3/scripts/workspaces.txt create mode 100644 home-manager/kitty/default.nix create mode 100644 home-manager/kitty/palenight.conf create mode 100644 home-manager/picom/default.nix create mode 100644 home-manager/polybar/config.ini create mode 100644 home-manager/polybar/default.nix create mode 100755 home-manager/polybar/launch.sh create mode 100644 home-manager/rofi/config/config.rasi create mode 100644 home-manager/rofi/config/customised.rasi create mode 100644 home-manager/rofi/default.nix create mode 100644 home-manager/shells/bash.nix create mode 100644 home-manager/waybar/config/config.jsonc create mode 100644 home-manager/waybar/config/style.css create mode 100644 home-manager/waybar/default.nix (limited to 'home-manager') diff --git a/home-manager/YATwm/config b/home-manager/YATwm/config new file mode 100644 index 0000000..e69de29 diff --git a/home-manager/YATwm/default.nix b/home-manager/YATwm/default.nix new file mode 100644 index 0000000..fa9e30f --- /dev/null +++ b/home-manager/YATwm/default.nix @@ -0,0 +1,109 @@ +{ + pkgs, + inputs, + ... +} : { + imports = [ + ../polybar + ../rofi + ../kitty + inputs.YATwm.homeManagerModules.default + ]; + home.packages = with pkgs; [ + i3lock + xss-lock + networkmanagerapplet + flameshot + picom + nitrogen + pamixer + kitty + alacritty + ]; + + xsession.windowManager.YATwm = { + enable = true; + package = inputs.YATwm.packages.x86_64-linux.YATwm; + useEmacsBinds = true; + quitKey = "s-g"; + swapMods = true; + keybinds = let + left = "h"; + right = "l"; + up = "k"; + down = "j"; + in { + # Important + "s-E" = "exit"; + "s-R" = "reload"; + + # Directions + "s-${left}" = "focChange left"; + "s-${right}" = "focChange right"; + "s-${up}" = "focChange up"; + "s-${down}" = "focChange down"; + + # Tiling + "s-t" = "toggle"; + "s-f" = "fullscreen"; + + # Application shortcuts + "s-d" = "bashSpawn rofi -i -show drun -disable-history"; + "s-D" = "bashSpawn prime-run rofi -i -show drun -disable-history"; + "s-g" = "bashSpawn ~/bin/rofi-passmenu"; + "s-RET" = "spawn alacritty"; + "s-r k" = "spawn kitty"; + "s-c" = "spawn firefox"; + "s-S--" = "bashSpawn emacsclient -c"; + "s-S" = "spawn flameshot gui"; + "s-x" = "spawn loginctl lock-session"; + "s-X" = "bashSpawn loginctl lock-session && systemctl suspend"; + "s-Q" = "kill"; + + # Workspaces + "s-1" = "changeWS 1"; + "s-S-1" = "wToWS 1"; + "s-2" = "changeWS 2"; + "s-S-2" = "wToWS 2"; + "s-3" = "changeWS 3"; + "s-S-3" = "wToWS 3"; + "s-4" = "changeWS 4"; + "s-S-4" = "wToWS 4"; + "s-5" = "changeWS 5"; + "s-S-5" = "wToWS 5"; + "s-6" = "changeWS 6"; + "s-S-6" = "wToWS 6"; + "s-7" = "changeWS 7"; + "s-S-7" = "wToWS 7"; + "s-8" = "changeWS 8"; + "s-S-8" = "wToWS 8"; + "s-9" = "changeWS 9"; + "s-S-9" = "wToWS 9"; + "s-0" = "changeWS 10"; + "s-S-0" = "wToWS 10"; + "s-p s" = "changeWS 11"; + "s-S-p s" = "wToWS 11"; + }; + workspaces = [ + {name = "1: A";} + {name = "2: B";} + {name = "3: C";} + {name = "4: D";} + {name = "5: E";} + {name = "6: F"; monitorPriorities = [2 1];} + {name = "7: G"; monitorPriorities = [2 1];} + {name = "8: H"; monitorPriorities = [2 1];} + {name = "9: I"; monitorPriorities = [2 1];} + {name = "10: J"; monitorPriorities = [2 1];} + {name = "S"; monitorPriorities = [1];} + ]; + startup = [ + #{command = ".config/polybar/launch.sh"; once = false;} + #{command = "picom --legacy-backends -fD 3"; once = false;} + #{command = "xss-lock --transfer-sleep-lock -- i3lock -eti ~/Documents/lockscreen.png --nofork"; bash = false;} + #{command = "nitrogen --restore";} + #{command = "nm-applet"; once = false; bash = false;} + ]; + #extraConfig = "bindmode normal\n" + (builtins.readFile ./config); + }; +} diff --git a/home-manager/emacs/default.nix b/home-manager/emacs/default.nix new file mode 100644 index 0000000..746e084 --- /dev/null +++ b/home-manager/emacs/default.nix @@ -0,0 +1,31 @@ +{ pkgs, config, ... } : +let + tex = (pkgs.texlive.combine { + inherit (pkgs.texlive) scheme-medium + dvisvgm dvipng # for preview and export as html + etoolbox + subfiles + wrapfig amsmath ulem hyperref capt-of; + }); + myEmacs = (pkgs.emacsPackagesFor pkgs.emacs30).emacsWithPackages (epkgs: with epkgs; [ + vterm + treesit-grammars.with-all-grammars + ]); +in +{ + services.emacs = { + enable = true; + package = myEmacs; + }; + + home.packages = with pkgs; [ + mu + emacsPackages.mu4e + isync + ispell + poppler_utils + tex + ghostscript + myEmacs + ]; +} diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..8c524aa --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,136 @@ +{ pkgs, lib, inputs, ... }: +{ + imports = [ + ./shells/bash.nix + ./emacs + #./hyprland + ./i3 + ./YATwm + ./kitty + inputs.spicetify-nix.homeManagerModules.default + #inputs.stylix.homeManagerModules.stylix + ]; + + home = { + stateVersion = "24.05"; + username = "boss"; + homeDirectory = "/home/boss"; + }; + + # The home.packages option allows you to install Nix packages into your + # environment. + nixpkgs.config.allowUnfree = true; + home.packages = with pkgs; [ + feh + pass + #spotify + playerctl + libqalculate + libreoffice + logisim-evolution + thunderbird + xdotool + discord + # (discord.override { + # withOpenASAR = true; + # }) + mumble + gimp + bottom + obs-studio + xfce.thunar + mpv + man-pages + man-pages-posix + # (inputs.plover-flake.packages.${system}.plover.with-plugins (ps: with ps;[ + # plover-dict-commands + # plover-console-ui + # plover-controller + # ])) + pavucontrol + unzip + appimage-run + lunar-client + libnotify + xclip + (openttd-jgrpp.overrideAttrs (oldAttrs: rec { + version = "0.63.3"; + src = fetchFromGitHub { + owner = "JGRennison"; + repo = "OpenTTD-patches"; + rev = "jgrpp-${version}"; + hash = "sha256-853LbApHqQn+ucb7xjFDfohB0/T1h11o4voBgvgbpSI="; + }; + })) + (python3.withPackages (ps: with ps; [ + python-lsp-server + ])) + alacritty + nyxt + wireguard-tools + brightnessctl + inputs.nil.packages.${system}.default + inputs.polymc.packages.${system}.default + jre8 + inputs.zen-browser.packages."${system}".default + ]; + + nix = { + #package = pkgs.nix; + settings.experimental-features = [ "nix-command" "flakes" ]; + }; + + home.sessionVariables = { + EDITOR = "emacsclient -c"; + MAKEFLAGS = " -j16 "; + MOZ_ENABLE_WAYLAND = 1; + }; + + + programs.home-manager.enable = true; + + programs.direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; + + services.gpg-agent.enable = true; + + services.dunst = { + enable = true; + settings = { + global = { + follow = "keyboard"; + frame_width = 0; + }; + }; + }; + + + programs.firefox.enable = true; + + stylix.targets.spicetify.enable = false; + stylix.targets.firefox.profileNames = [ "default"]; + + programs.spicetify = + let + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; + in + { + enable = true; + enabledExtensions = with spicePkgs.extensions; [ + fullAppDisplay + powerBar + addToQueueTop + ]; + enabledCustomApps = with spicePkgs.apps; [ + newReleases + lyricsPlus + betterLibrary + ]; + theme = spicePkgs.themes.nightlight; + }; + + xsession.windowManager.command = lib.mkForce "$@"; +} diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix new file mode 100644 index 0000000..9355113 --- /dev/null +++ b/home-manager/hyprland/default.nix @@ -0,0 +1,148 @@ +{ + pkgs, + lib, + inputs, + ... +}: +{ + imports = [ + ../rofi + ../kitty + ../waybar + ../hyprpaper + ]; + + home.file.".config/hypr/hyprlock.conf".source = ./hyprlock.conf; + + wayland.windowManager.hyprland= { + enable = true; + xwayland.enable = true; + systemd.variables = ["--all"]; + settings = { + "$mod" = "SUPER"; + exec-once = [ + "waybar" + "xss-lock --transfer-sleep-lock -- hyprlock" + "nm-applet" + "hyprpaper" + ]; + bind = + [ + "$mod, C, exec, firefox" + ", Print, exec, grimblast copy area" + "$mod, D, exec, rofi -i -show drun -disable-history" + "$mod Shift, E, exit" + "$mod, Return, exec, kitty" + "$mod, T, togglesplit" + "$mod Control, left, workspace, m-1" + "$mod Control, h, workspace, m-1" + "$mod Control, right, workspace, m+1" + "$mod Control, l, workspace, m+1" + "$mod, x, exec, hyprlock" + "$mod Shift, x, exec, hyprlock" + "$mod Shift, x, exec, systemctl suspend" + "$mod Shift, MINUS, exec, emacsclient -c" + "ALT, Tab, focusmonitor, +1" + "$mod, G, exec, bash /home/boss/bin/rofi-passmenu" + ", XF86AudioRaiseVolume, exec, pamixer -i 5" + ", XF86AudioLowerVolume, exec, pamixer -d 5" + "$mod Shift, Q, killactive" + "$mod, F, fullscreen" + "$mod Shift, space, togglefloating" + "$mod, mouse:272, movewindow" + ", XF86AudioPlay, exec, playerctl play-pause" + "$mod, bracketleft, exec, playerctl -p firefox play-pause" + "$mod, bracketright, exec, playerctl -p spotify play-pause" + "$mod Shift, S, exec spectacle -r" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + key = let + c = (x + 1) / 10; + in toString (x + 1 - (c * 10)); + in [ + "$mod, ${key}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${key}, movetoworkspace, ${toString (x + 1)}" + (lib.mkIf (x < 5) + "$mod Control, ${key}, workspace, ${toString (x + 6)}" + ) + "$mod Control, ${key}, workspace, ${toString (x + 1)}" + ] + ) + 10) + ) + ++ ( + builtins.map ( + x: "$mod, ${ builtins.elemAt x 0}, movefocus, ${builtins.elemAt x 1}\nbind=$mod Shift, ${builtins.elemAt x 0}, movewindow, ${builtins.elemAt x 1}" + ) + [ + ["h" "l"] + ["left" "l"] + ["j" "d"] + ["down" "d"] + ["k" "u"] + ["up" "u"] + ["l" "r"] + ["right" "r"] + ] + ); + monitor = + [ + "eDP-1, highrr, 0x0, 1" + "HDMI-A-1, highrr, 1920x0, 1" + ]; + workspace = + (builtins.genList + (x : "${toString (x + 1)},monitor:eDP-1") + 5 + ) + ++ (builtins.genList + (x : "${toString (x + 6)},monitor:HDMI-A-1") + 5 + ); + + + input = { + touchpad.natural_scroll = true; + #touchpad.scroll_factor = 0.5; + accel_profile = "flat"; + follow_mouse = true; + #sensitivity = 0.00; + }; + decoration = { + rounding = 10; + drop_shadow = false; + }; + animation = [ + "workspaces,1,5,easeOutQuint,slide" + ]; + bezier = [ + "easeInOutCubic,0.65,0,0.35,1" + "easeOutQuint,0.22,1,0.36,1" + ]; + general = { + "col.inactive_border" = "rgb(2f2e43)"; + "col.active_border" = "rgb(ab47bc)"; + border_size = 2; + gaps_in = 6; + gaps_out = 12; + }; + windowrulev2 = [ + "opacity 0.8 override 0.8 override, title:Spotify$" + ]; + }; + }; + + home.packages = with pkgs; [ + ydotool + xss-lock + pamixer + grimblast + playerctl + libsForQt5.spectacle + inputs.hyprlock.packages.${system}.hyprlock + ]; +} diff --git a/home-manager/hyprland/default.nix~ b/home-manager/hyprland/default.nix~ new file mode 100644 index 0000000..569d7ff --- /dev/null +++ b/home-manager/hyprland/default.nix~ @@ -0,0 +1,95 @@ +{ + pkgs, + ... +}: +{ + imports = [ + ../rofi + ../kitty + ../waybar + ]; + + wayland.windowManager.hyprland= { + enable = true; + xwayland.enable = true; + settings = { + "$mod" = "SUPER"; + exec-once = [ + "waybar" + "xss-lock --transfer-sleep-lock -- swaylock" + ]; + bind = + [ + "$mod, C, exec, firefox" + #", Print, exec, grimblast copy area" + "$mod, D, exec, rofi -i -show drun -disable-history" + "$mod Shift, E, exit" + "$mod, Return, exec, kitty" + "$mod, T, togglesplit" + "$mod Control, left, workspace, m-1" + "$mod Control, h, workspace, m-1" + "$mod Control, right, workspace, m+1" + "$mod Control, l, workspace, m+1" + "$mod, x, exec, swaylock" + "$mod Shift, x, exec, swaylock" + "$mod Shift, x, exec, systemctl suspend" + "$mod Shift, MINUS, exec, emacsclient -c" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) + 10) + ) + ++ ( + builtins.map ( + x: "$mod, ${ builtins.elemAt x 0}, movefocus, ${builtins.elemAt x 1}\nbind=$mod Shift, ${builtins.elemAt x 0}, movewindow, ${builtins.elemAt x 1}" + ) + [ + ["h" "l"] + ["left" "l"] + ["j" "d"] + ["down" "d"] + ["k" "u"] + ["up" "u"] + ["l" "r"] + ["right" "r"] + ] + ); + monitor = + [ + "eDP-1, 1920x1080, 0x0, 1" + "HDMI-A-1, 1920x1080, 1920x0, 1" + ]; + input = { + touchpad.natural_scroll = true; + #touchpad.scroll_factor = 0.5; + accel_profile = "flat"; + follow_mouse = true; + #sensitivity = 0.00; + }; + decoration.rounding = 10; + animation = [ + "workspaces,1,5,easeOutQuint,slide" + ]; + bezier = [ + "easeInOutCubic,0.65,0,0.35,1" + "easeOutQuint,0.22,1,0.36,1" + ]; + }; + }; + + home.packages = with pkgs; [ + swaylock + ]; +} diff --git a/home-manager/hyprland/hyprlock.conf b/home-manager/hyprland/hyprlock.conf new file mode 100644 index 0000000..dc2bc93 --- /dev/null +++ b/home-manager/hyprland/hyprlock.conf @@ -0,0 +1,41 @@ +background { + path = /home/boss/Wallpapers/lockscreen.png + blur_passes = 0 +} +input-field { + size = 200, 50 + outline_thickness = 3 + dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = false + dots_rounding = -1 # -1 default circle, -2 follow input-field rounding + outer_color = rgb(151515) + inner_color = rgb(200, 200, 200) + font_color = rgb(10, 10, 10) + fade_on_empty = true + fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered. + placeholder_text = Input Password... # Text rendered in the input box when it's empty. + hide_input = false + rounding = -1 # -1 means complete rounding (circle/oval) + check_color = rgb(204, 136, 34) + fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color + fail_text = $FAIL ($ATTEMPTS) # can be set to empty + fail_transition = 300 # transition time in ms between normal outer_color and fail_color + capslock_color = -1 + numlock_color = -1 + bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above) + invert_numlock = false # change color if numlock is off + swap_font_color = false # see below + + position = 0, -20 + halign = center + valign = center +} +label { + text = $TIME + text_align = center + color = rgb(50, 50, 50) + position = 0, 200 + halign = center + valign = center +} \ No newline at end of file diff --git a/home-manager/hyprpaper/default.nix b/home-manager/hyprpaper/default.nix new file mode 100644 index 0000000..8eed248 --- /dev/null +++ b/home-manager/hyprpaper/default.nix @@ -0,0 +1,10 @@ +{ + pkgs, + ... +}: +{ + home.file.".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf; + home.packages = with pkgs; [ + hyprpaper + ]; +} diff --git a/home-manager/hyprpaper/hyprpaper.conf b/home-manager/hyprpaper/hyprpaper.conf new file mode 100644 index 0000000..02bec8b --- /dev/null +++ b/home-manager/hyprpaper/hyprpaper.conf @@ -0,0 +1,3 @@ +preload = ~/Wallpapers/val.png + +wallpaper = ,~/Wallpapers/val.png \ No newline at end of file diff --git a/home-manager/i3/config b/home-manager/i3/config new file mode 100644 index 0000000..dafa928 --- /dev/null +++ b/home-manager/i3/config @@ -0,0 +1,332 @@ +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! +# +# This config file uses keycodes (bindsym) and was written for the QWERTY +# layout. +# +# To get a config file with the same key positions, but for your current +# layout, use the i3-config-wizard +# + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:Ubuntu 10 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -eti ~/Documents/lockscreen.png --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec_always --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +#set $refresh_i3status killall -SIGUSR1 i3status +#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% +#bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% +#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle +#bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle + +bindsym XF86AudioRaiseVolume exec --no-startup-id pamixer -i 5 +bindsym XF86AudioLowerVolume exec --no-startup-id pamixer -d 5 + +# use these keys for focus, movement, and resize directions when reaching for +# the arrows is not convenient + +set $up k +set $down j +set $left h +set $right l + +##STARTUP +#exec_always --no-startup-id "feh --bg-scale ~/Wallpapers/val.png" +#exec_always --no-startup-id nitrogen --restore +#exec_always --no-startup-id "picom --backend glx -fD 3 --vsync" +exec_always --no-startup-id "~/.config/polybar/launch.sh" +# Bind caps to super +#exec_always --no-startup-id "setxkbmap -option caps:super" +# Bind caps to control +# exec --no-startup-id "setxkbmap -option ctrl:nocaps" +# exec --no-startup-id "systemctl --user start dunst" +exec_always --no-startup-id xinput set-prop "ELAN1203:00 04F3:307A Touchpad" "libinput Tapping Enabled" 1 +exec_always --no-startup-id xinput set-prop "ELAN1203:00 04F3:307A Touchpad" "libinput Natural Scrolling Enabled" 1 +exec --no-startup-id flameshot +exec --no-startup-id rog-control-center +# Using systemd instead +#exec --no-startup-id "emacs --daemon" +exec --no-startup-id "emacsclient -c --eval '(start-scratch)'" +for_window [title="scratch-emacs"] , move scratchpad + +set $mod Mod4 + + +#GAPS + +for_window[class="-*"] border pixel 0 + +gaps inner 6 + + +#My keybinds +bindsym $mod+Control+$right workspace next +bindsym $mod+Control+Right workspace next + +#Special workspaces +bindsym $mod+p exec --no-startup-id "workspaces.sh" +bindsym $mod+Shift+p exec --no-startup-id "workspaces.sh move" + +bindsym $mod+Control+$left workspace prev +bindsym $mod+Control+Left workspace prev + +set $i3lock-cmd i3lock -eti ~/Documents/lockscreen.png + +bindsym $mod+Shift+s exec --no-startup-id flameshot gui + +bindsym $mod+x exec --no-startup-id "loginctl lock-session" +bindsym $mod+Shift+x exec --no-startup-id "loginctl lock-session; systemctl suspend" +# bindsym $mod+Shift+c exec --no-startup-id "~/.i3_commands/open-qb.sh" +bindsym $mod+c exec --no-startup-id "firefox" +bindsym $mod+Shift+minus exec --no-startup-id "emacsclient -c" + +bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl s +5 +bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl s 5- + +bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause +bindsym XF86AudioNext exec --no-startup-id playerctl next +bindsym XF86AudioPrev exec --no-startup-id playerctl previous +bindxym XF86AudioStop exec --no-startup-id playerctl stop + +bindsym $mod+bracketleft exec --no-startup-id playerctl -p firefox play-pause +bindsym $mod+bracketright exec --no-startup-id playerctl -p spotify play-pause + +#Emoji picker +#bindsym $mod+comma exec --no-startup-id "emojis.sh" + +#Monitor config +bindsym $mod+m exec --no-startup-id "monitor-config.sh" + +# use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +bindsym $mod+Return exec --no-startup-id kitty + +# Start emacs with vterm +bindsym $mod+Shift+Return exec --no-startup-id "emacsclient -c --eval '(start-terminal)'" + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id rofi -i -show drun -disable-history +bindsym $mod+Shift+d exec --no-startup-id "prime-run rofi -i -show drun -disable-history" +#bindsym $mod+Shift+c exec --no-startup-id "rofi -i -lines 0 -dmenu -p 'Search:' | xargs -I{} ~/.i3_commands/browser-open.sh '{}'" +#bindsym $mod+d exec dmenu_run -i -nb '#303239' -nf '#f3f4f5' -sb '#bf00f6' -sf '#f3f4f5' + +# Password menu +bindsym $mod+g exec --no-startup-id "~/bin/rofi-passmenu" + +# i3 command runner +bindsym $mod+Shift+semicolon exec --no-startup-id "i3-msg $(echo | rofi -l 0 -dmenu -p 'i3 command')" + +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right + +bindsym Mod1+Tab focus output left + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +# bindsym $mod+g split h + +# split in vertical orientation +# bindsym $mod+v split v + +# split toggle +bindsym $mod+t split toggle + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# move the currently focused window to the scratchpad +# bindsym $mod+Shift+minus move scratchpad + +# Show the next scratchpad window or hide the focused scratchpad window. +# If there are multiple scratchpad windows, this command cycles through them. +for_window [title="scratch-emacs"] , floating_minimum_size 1600 x 900 +bindsym $mod+minus scratchpad show + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1: " +set $ws2 "2: 󰑴" +set $ws3 "3: " +set $ws4 "4: " +set $ws5 "5: " +set $ws6 "6: " +set $ws7 "7: 󰑴" +set $ws8 "8: " +set $ws9 "9: " +set $ws10 "10: " + +# make workspaces go on correct monitors +workspace $ws1 output eDP eDP-1 eDP-1-1 +workspace $ws2 output eDP eDP-1 eDP-1-1 +workspace $ws3 output eDP eDP-1 eDP-1-1 +workspace $ws4 output eDP eDP-1 eDP-1-1 +workspace $ws5 output eDP eDP-1 eDP-1-1 +workspace $ws6 output HDMI-A-0 HDMI-1 HDMI-1-1 eDP eDP-1 eDP-1-1 +workspace $ws7 output HDMI-A-0 HDMI-1 HDMI-1-1 eDP eDP-1 eDP-1-1 +workspace $ws8 output HDMI-A-0 HDMI-1 HDMI-1-1 eDP eDP-1 eDP-1-1 +workspace $ws9 output HDMI-A-0 HDMI-1 HDMI-1-1 eDP eDP-1 eDP-1-1 +workspace $ws10 output HDMI-A-0 HDMI-1 HDMI-1-1 eDP eDP-1 eDP-1-1 + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + + +bindsym $mod+Control+1 workspace number $ws6; workspace number $ws1 +bindsym $mod+Control+2 workspace number $ws7; workspace number $ws2 +bindsym $mod+Control+3 workspace number $ws8; workspace number $ws3 +bindsym $mod+Control+4 workspace number $ws9; workspace number $ws4 +bindsym $mod+Control+5 workspace number $ws10; workspace number $ws5 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +# bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "exit.sh" +#bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym $left resize shrink width 10 px or 10 ppt + bindsym $down resize grow height 10 px or 10 ppt + bindsym $up resize shrink height 10 px or 10 ppt + bindsym $right resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +set $bg-color #303239 +set $inactive-bg-color #303239 +set $text-color #f3f4f5 +set $inactive-text-color #676E7D +set $urgent-bg-color #bf00f6 + +set $focused-border #ffcb6b + +# window colors +# border background text indicator +client.focused $bg-color $focused-border $text-color $bg-color +client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color $inactive-bg-color +client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color $inactive-bg-color +client.urgent $urgent-bg-color $urgent-bg-color $text-color $urgent-bg-color + + +hide_edge_borders none + +# bar +bar { + i3bar_command none + tray_output primary + font pango: Sauce Code Pro Nerd Font, Powerline 10 + height 19 + #status_command i3status + status_command "i3status-rs" + colors { + background $bg-color + # border background text + focused_workspace $bg-color $bg-color $text-color + inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color + urgent_workspace $urgent-bg-color $urgent-bg-color $text-color + } +} diff --git a/home-manager/i3/default.nix b/home-manager/i3/default.nix new file mode 100644 index 0000000..087415c --- /dev/null +++ b/home-manager/i3/default.nix @@ -0,0 +1,41 @@ +# let +# nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11"; +# pkgs = import nixpkgs { config = {}; overlays = []; }; +# in +# { +# i3-commands = pkgs.callPackage ./i3-commands.nix { }; +# } + + +{ + config, + pkgs, + ... +} : { + imports = [ + ../polybar + ../rofi + ../kitty + ../picom + ]; + xsession.enable = true; + xsession.windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + }; + xdg.configFile."i3/config".enable = false; + home.file.".config/i3/config" = { + source = ./config; + onChange = "${pkgs.i3-gaps}/bin/i3-msg restart"; + }; + home.packages = with pkgs; [ + i3lock + xss-lock + networkmanagerapplet + flameshot + picom + nitrogen + pamixer + (pkgs.callPackage ./i3-commands.nix { }) + ]; +} diff --git a/home-manager/i3/i3-commands.nix b/home-manager/i3/i3-commands.nix new file mode 100644 index 0000000..9b8705d --- /dev/null +++ b/home-manager/i3/i3-commands.nix @@ -0,0 +1,16 @@ +{ + stdenv +}: +stdenv.mkDerivation { + pname = "i3-commands"; + version = "0.0.1"; + + srcs = builtins.path { name = "scripts"; path = ./scripts/.; }; + + installPhase = '' +runHook preInstall +mkdir -p $out/bin +install -D -m 755 ./* $out/bin +runHook postInstall +''; +} diff --git a/home-manager/i3/scripts/exit.sh b/home-manager/i3/scripts/exit.sh new file mode 100755 index 0000000..6e1f492 --- /dev/null +++ b/home-manager/i3/scripts/exit.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +choice=$(echo -e "Sleep\nLock\nLock and sleep\nExit i3" | rofi -dmenu -i -p "What do you want to do") +case $choice in + "Sleep") + systemctl suspend + ;; + "Lock") + i3lock -eti /usr/share/backgrounds/lockscreen.png + ;; + "Lock and sleep") + i3lock -eti /usr/share/backgrounds/lockscreen.png + systemctl suspend + ;; + "Exit i3") + i3-msg exit + ;; + *) + notify-send "Canceling" + ;; +esac diff --git a/home-manager/i3/scripts/image_upload.sh b/home-manager/i3/scripts/image_upload.sh new file mode 100755 index 0000000..896f23f --- /dev/null +++ b/home-manager/i3/scripts/image_upload.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +image_name=$(rofi -dmenu -l 0 -p "Image name") +xclip -selection clipboard -t image/png -o > ~/Documents/tehbox-files/$image_name +eval $(ssh-agent) +rsync ~/Documents/tehbox-files/$image_name files@tehbox.org:/srv/files +notify-send "uploaded https://files.tehbox.org/$image_name" +echo -n "https://files.tehbox.org/$image_name" | xclip -i -selection clipboard diff --git a/home-manager/i3/scripts/monitor-config.sh b/home-manager/i3/scripts/monitor-config.sh new file mode 100755 index 0000000..8f17660 --- /dev/null +++ b/home-manager/i3/scripts/monitor-config.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +choice=$(echo -e "One monitor\nTwo monitors" | rofi -dmenu -i -p "What monitor setup to use") + +monitor1=$(xrandr | grep -E "eDP(-1(-1)?)?" | awk '{print $1 }') +monitor2=$(xrandr | grep -E "HDMI(-A-0)?(-1(-1)?)?" | awk '{print $1 }') + +case $choice in + "One monitor") + xrandr --output $monitor1 --primary --mode 1920x1080 --rate 144 --pos 0x0 --rotate normal --output $monitor2 --off + sleep 1 + i3-msg restart + ;; + "Two monitors") + xrandr --output $monitor1 --primary --mode 1920x1080 --rate 144 --pos 0x0 --rotate normal --output $monitor2 --mode 1920x1080 --rate 144 --pos 1920x0 --rotate normal + sleep 1 + i3-msg restart + ;; + *) + notify-send "Invalid response, canceling" + ;; +esac + diff --git a/home-manager/i3/scripts/workspaces.sh b/home-manager/i3/scripts/workspaces.sh new file mode 100755 index 0000000..3ad68ef --- /dev/null +++ b/home-manager/i3/scripts/workspaces.sh @@ -0,0 +1,7 @@ +choice=$(cat ~/.i3_commands/workspaces.txt | rofi -dmenu -i -p "Which workspace to switch to") +if [[ $1 == "move" ]] +then + i3-msg move container to workspace \"$choice\" +else + i3-msg workspace \"$choice\" +fi diff --git a/home-manager/i3/scripts/workspaces.txt b/home-manager/i3/scripts/workspaces.txt new file mode 100644 index 0000000..84b3bf0 --- /dev/null +++ b/home-manager/i3/scripts/workspaces.txt @@ -0,0 +1,11 @@ +1:  +2: 󰑴 +3:  +4:  +5:  +6:  +7: 󰑴 +8:  +9:  +10:  +S:  diff --git a/home-manager/kitty/default.nix b/home-manager/kitty/default.nix new file mode 100644 index 0000000..7d7326b --- /dev/null +++ b/home-manager/kitty/default.nix @@ -0,0 +1,24 @@ +{ + pkgs, + config, + ... +}: +{ + programs.kitty = { + enable = true; + keybindings = { + "control+shift+c" = "copy_to_clipboard"; + "control+shift+v" = "paste_from_clipboard"; + }; + settings = { + #font_family = "Cousine Nerd Font"; + #font_size = "10.0"; + #background_opacity = "0.8"; + term = "xterm-256color"; + enable_audio_bell = "no"; + mouse_hide_wait = 2; + window_padding_width = 4; + }; + #extraConfig = (builtins.readFile ./palenight.conf); + }; +} diff --git a/home-manager/kitty/palenight.conf b/home-manager/kitty/palenight.conf new file mode 100644 index 0000000..6a58ece --- /dev/null +++ b/home-manager/kitty/palenight.conf @@ -0,0 +1,40 @@ +# Palenight Colorscheme for Kitty +# Based on https://github.com/sindresorhus/hyper-snazzy + +foreground #959dcb +background #292d3e +selection_foreground #eceef0 +selection_background #607c8b +url_color #82aaff + +# black +color0 #434759 +color8 #434758 + +# red +color1 #f07178 +color9 #ff8b92 + +# green +color2 #c3e88d +color10 #ddffa7 + +# yellow +color3 #ffcb6b +color11 #ffe585 + +# blue +color4 #82aaff +color12 #9cc4ff + +# magenta +color5 #c792ea +color13 #e1acff + +# cyan +color6 #89ddff +color14 #a3f7ff + +# white +color7 #d0d0d0 +color15 #fefefe diff --git a/home-manager/picom/default.nix b/home-manager/picom/default.nix new file mode 100644 index 0000000..1c13407 --- /dev/null +++ b/home-manager/picom/default.nix @@ -0,0 +1,18 @@ +{ + pkgs, + config, + ... +}: +{ + services.picom = { + enable = true; + fade = true; + fadeDelta = 3; + fadeExclude = [ + "window_type *= 'tooltip'" + ]; + settings = { + corner-radius = 10; + }; + }; +} diff --git a/home-manager/polybar/config.ini b/home-manager/polybar/config.ini new file mode 100644 index 0000000..ada0268 --- /dev/null +++ b/home-manager/polybar/config.ini @@ -0,0 +1,183 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== +;;; +[colors] +background = #cc292d3e +background-alt = #cc292d3e +foreground = #676e96 +primary = #676e96 +secondary = #8ABEB7 +alert = #BF00F6 +disabled = #515772 +active = #eeffff +inactive = #515772 + +[bar/status] +width = 100% +height = 19pt +radius = 10 + +monitor = ${env:MONITOR:} + +bottom = true + +; dpi = 96 + +background = ${colors.background} +foreground = ${colors.foreground} + +border-size = 6px +border-color = #00000000 + +padding-left = 0 +padding-right = 1 +border-top-size = 0 + +module-margin = 1 + +separator = "|" +separator-foreground = ${colors.disabled} + +font-0 = Cousine Nerd Font;1 + +modules-left = xworkspaces +modules-right = pipewire xkeyboard memory cpu battery date tray +; modules-center = xwindow + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +; For center tray - also make sure to change the launch.sh +tray-position = ${env:TRAY:} + +; wm-restack = generic +; wm-restack = bspwm +wm-restack = generic + +override-redirect = false + + +[module/xworkspaces] +pin-workspaces = true +type = internal/xworkspaces + +label-active = %name% +label-active-foreground = ${colors.active} +label-active-padding = 1 + +label-occupied = %name% +label-occupied-foreground = ${colors.inactive} +label-occupied-padding = 1 + +label-urgent = %name% +label-urgent-foreground = ${colors.inactive} +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = +label-empty-foreground = ${colors.inactive} +label-empty-padding = 0 + +[module/pipewire] +type = internal/pulseaudio + +master-soundcard = hw:2 +master-mixer = Master +mapped = true + +format-volume-prefix = "VOL " +format-volume-prefix-foreground = ${colors.primary} +format-volume = + +label-volume = %percentage%% + +label-muted = muted +label-muted-foreground = ${colors.disabled} + +[module/battery] +type = internal/battery +low-at = 20 +full-at = 100 +battery = BAT1 +adapter = ACAD + +time-format = "%H:%M" + +format-charging-prefix = "BAT " +format-discharging-prefix = "BAT " +format-full-prefix = "BAT " +format-charging-prefix-foreground = ${colors.primary} +format-discharging-prefix-foreground = ${colors.primary} +format-full-prefix-foreground = ${colors.primary} +format-charging = "" +format-discharging = "" +format-full = + +label-charging = "%percentage%% - %time%" +label-discharging = "%percentage%% - %time%" +label-full = "FULL" + +[module/memory] +type = internal/memory +interval = 1 +format-prefix = "RAM " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 1 +format-prefix = "CPU " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M:%S +date-alt = %H:%M:%S %d-%m-%Y + +label = %date% +label-foreground = ${colors.primary} + +; Using polybar-git instead +; [module/tray] +; type = internal/tray +; format = ${env:TRAY:} +; tray-spacing = 5 + +[module/xwindow] +type = internal/xwindow +format =