nixos-dotfiles
nixos-dotfiles
https://git.tonybtw.com/nixos-dotfiles.git
git://git.tonybtw.com/nixos-dotfiles.git
Initial commit.
Diff
diff --git a/autostart.sh b/autostart.sh
new file mode 100755
index 0000000..43448b1
--- /dev/null
+++ b/autostart.sh
@@ -0,0 +1,3 @@
+waybar -c ~/.config/mango/config.jsonc -s ~/.config/mango/style.css >/dev/null 2>&1 &
+swaybg -i ~/walls/wall3.jpg >/dev/null 2>&1 &
+
diff --git a/config.conf b/config.conf
new file mode 100644
index 0000000..da456e6
--- /dev/null
+++ b/config.conf
@@ -0,0 +1,147 @@
+# Monitors - Uncomment this and set your monitor if on vm
+# monitorrule=Virtial-1,0.55,1,tile,0,1,0,0,1920,1080,60
+# Heavily Inspired by Argos Nothing's DWM Re-write + Fun stuff.
+# Check his out here: https://github.com/argosnothing/mango-dwm-config/
+
+# waybar & wmenu required.
+bind=SUPER,Return,spawn,foot
+bind=SUPER,d,spawn,/home/tony/.config/mango/menu.sh
+bind=SUPER,s,spawn,/home/tony/.config/mango/snip.sh
+bind=SUPER,R,spawn,/home/tony/.config/mango/rebar.sh
+
+bind=SUPER,1,comboview,1
+bind=SUPER,2,comboview,2
+bind=SUPER,3,comboview,3
+bind=SUPER,4,comboview,4
+bind=SUPER,5,comboview,5
+bind=SUPER,6,comboview,6
+bind=SUPER,7,comboview,7
+bind=SUPER,8,comboview,8
+bind=SUPER,9,comboview,9
+
+bind=SUPER,i,incnmaster,+1
+bind=SUPER,p,incnmaster,-1
+bind=SUPER,q,killclient
+bind=SUPER+SHIFT,r,reload_config
+
+# Layouts
+bind=SUPER,t,setlayout,tile
+bind=SUPER,v,setlayout,vertical_grid
+bind=SUPER,c,setlayout,spiral
+bind=SUPER,x,setlayout,scroller
+bind=SUPER,n,switch_layout
+bind=SUPER,a,togglegaps
+
+# Layouts in mango are per tag. So we'll set all tags to tile by default.
+tagrule=id:1,layout_name:tile
+tagrule=id:2,layout_name:tile
+tagrule=id:3,layout_name:tile
+tagrule=id:4,layout_name:tile
+tagrule=id:5,layout_name:tile
+tagrule=id:6,layout_name:tile
+tagrule=id:7,layout_name:tile
+tagrule=id:8,layout_name:tile
+tagrule=id:9,layout_name:tile
+
+
+animations=1
+gappih=5
+gappiv=5
+gappoh=5
+gappov=5
+borderpx=4
+no_border_when_single=0
+focuscolor=0x005577ff
+
+# Mouse Button Bindings
+mousebind=SUPER,btn_left,moveresize,curmove
+mousebind=SUPER,btn_right,moveresize,curresize
+
+# options
+repeat_rate=35
+repeat_delay=200
+
+# Effect
+blur=0
+blur_layer=1
+blur_optimized=1
+blur_params_num_passes = 2
+blur_params_radius = 5
+blur_params_noise = 0.02
+blur_params_brightness = 0.9
+blur_params_contrast = 0.9
+blur_params_saturation = 1.2
+
+shadows = 1
+layer_shadows = 1
+shadow_only_floating=1
+shadows_size = 12
+shadows_blur = 15
+shadows_position_x = 0
+shadows_position_y = 0
+shadowscolor= 0x000000ff
+
+# Animation Configuration
+animations=1
+layer_animations=1
+animation_type_open=zoom
+animation_type_close=slide
+layer_animation_type_open=slide
+layer_animation_type_close=slide
+animation_fade_in=1
+animation_fade_out=1
+tag_animation_direction=1
+zoom_initial_ratio=0.3
+zoom_end_ratio=0.7
+fadein_begin_opacity=0.6
+fadeout_begin_opacity=0.8
+animation_duration_move=500
+animation_duration_open=400
+animation_duration_tag=350
+animation_duration_close=800
+animation_curve_open=0.46,1.0,0.29,1.1
+animation_curve_move=0.46,1.0,0.29,1
+animation_curve_tag=0.46,1.0,0.29,1
+animation_curve_close=0.08,0.92,0,1
+
+# Scroller Layout Setting
+scroller_structs=20
+scroller_default_proportion=0.8
+scroller_focus_center=0
+scroller_prefer_center=1
+edge_scroller_pointer_focus=1
+scroller_default_proportion_single=1.0
+scroller_proportion_preset=0.5,0.8,1.0
+
+bind=SUPER+SHIFT,f,togglefullscreen,
+bind=SUPER,f,togglefloating,
+
+# smartmovewin
+bind=CTRL+SHIFT,k,smartmovewin,up
+bind=CTRL+SHIFT,j,smartmovewin,down
+bind=CTRL+SHIFT,h,smartmovewin,left
+bind=CTRL+SHIFT,l,smartmovewin,right
+
+# switch window focus
+bind=SUPER,j,focusstack,next
+bind=SUPER,k,focusstack,prev
+bind=SUPER,h,focusdir,left
+bind=SUPER,l,focusdir,right
+
+# swap window
+bind=SUPER+SHIFT,k,exchange_client,up
+bind=SUPER+SHIFT,j,exchange_client,down
+bind=SUPER+SHIFT,h,exchange_client,left
+bind=SUPER+SHIFT,l,exchange_client,right
+
+# Gesturebind
+gesturebind=none,left,3,focusdir,left
+gesturebind=none,right,3,focusdir,right
+gesturebind=none,up,3,focusdir,up
+gesturebind=none,down,3,focusdir,down
+gesturebind=none,left,4,viewtoleft_have_client
+gesturebind=none,right,4,viewtoright_have_client
+gesturebind=none,up,4,toggleoverview
+gesturebind=none,down,4,toggleoverview
+bind=SUPER,0,toggleoverview
+
diff --git a/config.jsonc b/config.jsonc
new file mode 100644
index 0000000..f04e150
--- /dev/null
+++ b/config.jsonc
@@ -0,0 +1,76 @@
+{
+ "modules-left": [
+ "ext/workspaces",
+ "custom/sep",
+ "dwl/window#layout",
+ "custom/sep",
+ "dwl/window#title"
+ ],
+ "modules-right": [
+ "custom/sep",
+ "battery",
+ "custom/sep",
+ "network",
+ "custom/sep",
+ "cpu",
+ "custom/sep",
+ "memory",
+ "custom/sep",
+ "disk",
+ "custom/sep",
+ "clock",
+ "custom/sep",
+ "tray"
+ ],
+
+ "clock": {
+ "format-alt": "{:%Y-%m-%d}"
+ },
+ "cpu": {
+ "format": "CPU: {usage}%",
+ "tooltip": false
+ },
+ "memory": {
+ "format": "Mem: {used}GiB"
+ },
+ "disk": {
+ "interval": 60,
+ "path": "/",
+ "format": "Disk: {free}"
+ },
+ "battery": {
+ "states": {
+ "good": 95,
+ "warning": 30,
+ "critical": 15
+ },
+ "format": "Bat: {capacity}% {icon} {time}",
+ "format-plugged": "{capacity}% ",
+ "format-alt": "Bat {capacity}%",
+ "format-time": "{H}:{M}",
+ "format-icons": ["", "", "", "", ""]
+ },
+ "network": {
+ "format": "Online",
+ "format-disconnected": "Disconnected ⚠"
+ },
+ "ext/workspaces": {
+ "format": "{icon}",
+ "ignore-hidden": false,
+ "on-click": "activate",
+ "sort-by-id": true
+ },
+ "dwl/tags": {
+ "num-tags": 9
+ },
+ "dwl/window#layout": {
+ "format": "[{layout}]"
+ },
+ "dwl/window#title": {
+ "format": "{title}"
+ },
+ "custom/sep": {
+ "format": "|",
+ "interval": 0
+ }
+}
diff --git a/menu.sh b/menu.sh
new file mode 100755
index 0000000..a3fc279
--- /dev/null
+++ b/menu.sh
@@ -0,0 +1 @@
+wmenu-run -l 10 -f "JetBrainsMono Nerd Font 18"
diff --git a/readme.org b/readme.org
new file mode 100644
index 0000000..5f2e6a2
--- /dev/null
+++ b/readme.org
@@ -0,0 +1,266 @@
+* Installation Guide per Distro:
+** Arch Linux
+
+For Arch Linux, installation is straightforward using the AUR:
+
+#+begin_src sh
+yay -S mangowc-git
+#+end_src
+
+Then install the required dependencies:
+
+#+begin_src sh
+sudo pacman -Sy foot wl-clipboard wmenu grim slurp swaybg firefox ttf-jetbrains-mono-nerd
+#+end_src
+
+** NixOS
+
+For NixOS, you'll need to add MangoWC as a flake input to your configuration.
+First, add the flake input to your =flake.nix=:
+
+#+begin_src nix
+{
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+ mangowc = {
+ url = "github:DreamMaoMao/mangowc";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = { self, nixpkgs, mangowc, ... }: {
+ nixosConfigurations.yourHostname = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [
+ ./configuration.nix
+ mangowc.nixosModules.default
+ ];
+ };
+ };
+}
+#+end_src
+
+Then enable MangoWC in your =configuration.nix=:
+
+#+begin_src nix
+{ config, pkgs, ... }:
+
+{
+ programs.mangowc.enable = true;
+
+ environment.systemPackages = with pkgs; [
+ foot
+ wmenu
+ wl-clipboard
+ grim
+ slurp
+ swaybg
+ firefox
+ ];
+
+ fonts.packages = with pkgs; [
+ nerd-fonts.jetbrains-mono
+ ];
+}
+#+end_src
+
+Rebuild your system:
+
+#+begin_src sh
+sudo nixos-rebuild switch --flake .#your_hostname
+#+end_src
+
+** Gentoo
+
+For Gentoo users, you'll need to add MangoWC via an overlay or manually compile it.
+First, install the dependencies:
+
+#+begin_src sh
+sudo emerge --ask \
+ dev-libs/wayland \
+ dev-libs/wayland-protocols \
+ gui-libs/wlroots \
+ dev-libs/libinput \
+ x11-libs/libdrm \
+ x11-libs/libxkbcommon \
+ x11-libs/pixman \
+ dev-util/meson \
+ dev-util/ninja \
+ sys-apps/hwdata \
+ sys-auth/seatd \
+ dev-libs/libpcre2 \
+ gui-apps/foot \
+ gui-apps/wmenu \
+ gui-apps/wl-clipboard \
+ gui-apps/grim \
+ gui-apps/slurp \
+ gui-apps/swaybg \
+ www-client/firefox \
+ media-fonts/jetbrains-mono
+#+end_src
+
+Then clone and build MangoWC from source:
+
+#+begin_src sh
+git clone https://github.com/DreamMaoMao/mangowc
+cd mangowc
+meson setup build
+ninja -C build
+sudo ninja -C build install
+#+end_src
+
+* My Keybinds:
+
+Here's a breakdown of all the essential keybinds for MangoWC. These are configured in your =~/.config/mango/config.conf= file:
+
+** Basic Controls
+
+| Keybind | Action | Description |
+|----------------------+---------------------+--------------------------------------------------|
+| =Super + Enter= | Launch Terminal | Opens foot terminal emulator |
+| =Super + d= | Application Launcher| Opens wmenu for launching applications |
+| =Super + q= | Kill Window | Closes the currently focused window |
+| =Super + Shift + r= | Reload Config | Reloads the MangoWC configuration file |
+| =Super + R= | Reload Waybar | Runs the rebar script to restart waybar |
+| =Super + s= | Screenshot | Takes a screenshot of selected area (using snip.sh) |
+
+** Workspace Management
+
+| Keybind | Action | Description |
+|-----------------+-----------------+------------------------------------------|
+| =Super + 1-9= | Switch Tag | Switches to workspace/tag 1 through 9 |
+| =Super + i= | Increase Master | Adds one more window to master area |
+| =Super + p= | Decrease Master | Removes one window from master area |
+| =Super + 0= | Toggle Overview | Shows overview of all windows/workspaces |
+
+** Window Management
+
+| Keybind | Action | Description |
+|-------------------------+--------------+------------------------------------------|
+| =Super + j= | Focus Next | Focuses the next window in the stack |
+| =Super + k= | Focus Previous | Focuses the previous window in the stack |
+| =Super + h= | Focus Left | Focuses the window to the left |
+| =Super + l= | Focus Right | Focuses the window to the right |
+| =Super + Shift + j= | Swap Down | Swaps current window with the one below |
+| =Super + Shift + k= | Swap Up | Swaps current window with the one above |
+| =Super + Shift + h= | Swap Left | Swaps current window with the one on the left |
+| =Super + Shift + l= | Swap Right | Swaps current window with the one on the right |
+| =Ctrl + Shift + j/k/h/l= | Smart Move | Moves window in specified direction |
+
+** Layout Controls
+
+| Keybind | Action | Description |
+|---------------------+------------------+-----------------------------------------|
+| =Super + t= | Tile Layout | Sets layout to tiled mode |
+| =Super + v= | Vertical Grid | Sets layout to vertical grid |
+| =Super + c= | Spiral Layout | Sets layout to spiral mode |
+| =Super + x= | Scroller Layout | Sets layout to scroller mode |
+| =Super + n= | Switch Layout | Cycles through available layouts |
+| =Super + a= | Toggle Gaps | Toggles window gaps on/off |
+| =Super + f= | Toggle Float | Toggles floating mode for current window |
+| =Super + Shift + f= | Toggle Fullscreen | Toggles fullscreen for current window |
+
+** Mouse Bindings
+
+| Keybind | Action | Description |
+|------------------------+---------------+------------------------------------------|
+| =Super + Left Click= | Move Window | Click and drag to move floating windows |
+| =Super + Right Click= | Resize Window | Click and drag to resize windows |
+
+** Touchpad Gestures
+
+| Gesture | Action | Description |
+|----------------------------------+-----------------+------------------------------------------|
+| 3-finger swipe left/right/up/down | Focus Direction | Focuses window in the swipe direction |
+| 4-finger swipe left | Previous Tag | Switches to previous tag with clients |
+| 4-finger swipe right | Next Tag | Switches to next tag with clients |
+| 4-finger swipe up/down | Toggle Overview | Shows/hides workspace overview |
+
+* Load MangoWC
+
+We're in mangowc now by and as you can see, it's literally just a blank screen with a mouse cursor. Super minimal.
+
+Let's jump into mango's config.conf and get started with some keybinds.
+So lets hit Alt + Enter to open foot, by defualt.
+
+Open up .config/mango/config.conf, and lets change a few keybinds, and add a wmenu script.
+
+#+begin_src conf
+bind=SUPER,Return,spawn,foot
+bind=SUPER,q,killclient,
+bind=SUPER,d,spawn,wmenu-run -l 10
+#+end_src
+
+We can reload the config file with Super R. Now we can spawn terminals with Super Enter as we are used to. Alright this is nice, but we can do better. I personally could get by just like this, with no bar, but lets add one.
+
+Let's add some custom binds for movements, and whatnot later, but for now lets move on to the bar. I encourage you to play around with this file and add/change your binds as needed, and a great place to start especially if you are coming over from dwm is to checkout ArgosNothing's DWM config conversion, and add stuff to it. He made this mango config and this article about it on my website here:
+https://tonybtw.com/community/mango
+
+* Waybar + Autostart
+
+So the file structure for the config directory is gonna be pretty simple today, we're just going to use an autostart.sh, a config.conf, and we'll put waybar's config.jsonc and style.css in here. This will allow you to use waybar with other configs as needed, and not disrupt your other wayland compositor's waybar configs.
+
+#+begin_src sh
+/home/tony/.config/mango
+├── autostart.sh
+├── config.conf
+├── config.jsonc
+├── menu.sh
+├── rebar.sh
+└── style.css
+#+end_src
+
+I already made a video about waybar, so I'm just going to clone my waybar config and start it up with autostart.sh. If you want guidance on customizing waybar, I encourage you to check out the waybar video.
+
+#+begin_src
+git clone https://github.com/tonybanters/waybar
+cp waybar/* ~/.config/mango/.
+#+end_src
+
+And let's add waybar to our autostart.sh
+
+#+begin_src
+vim ~/.config/mango/autostart.sh
+waybar -c ~/.config/mango/config.jsonc -s ~/.config/mango/style.css >/dev/null 2>&1 &
+#+end_src
+
+This will tell mango to start up with a wallpaper, and waybar.
+So we're ready to launch Mango at this point. Let's go ahead and do so, by typing `mango`
+
+* Wallpaper
+We need a wallpaper. With swaybg, we can set one, but we need to download one first. so lets open firefox, and head over to wallhaven.cc and pick one from there.
+
+Let's grab this one, and put it in ~/walls/wall1.png
+
+Now we can set that with
+
+#+begin_src sh
+swaybg -i ~/walls/wall1.png & disown
+#+end_src
+
+Let's add disown here so when we close this terminal, our wallpaper persists.
+
+But we see the issue here, we want this wallpaper to be enabled whenever we launch mangoWC. We can accomplish this simply by adding it to autostart.sh
+
+#+begin_src sh
+vim ~/.config/mango/autostart.sh
+waybar -c ~/.config/mango/config.jsonc -s ~/.config/mango/style.css >/dev/null 2>&1 &
+swaybg -i ~/walls/wall1.png >/dev/null 2>&1 &
+#+end_src
+
+Now if we relaunch mangoWC, we see our wallpaper persists.
+
+* Screenshot Script
+We can add a screenshot script here with `grim`, `slurp`, and `wl-copy`
+
+#+begin_src sh
+#!/bin/sh
+grim -l 0 -g "$(slurp)" - | wl-copy
+#+end_src
+
+And bind this screenshot in our config.conf here:
+
+#+begin_src conf
+bind=SUPER,s,spawn,snip
+#+end_src
+
diff --git a/rebar.sh b/rebar.sh
new file mode 100755
index 0000000..bc93528
--- /dev/null
+++ b/rebar.sh
@@ -0,0 +1 @@
+pkill waybar; waybar -c ~/.config/mango/config.jsonc &
diff --git a/snip.sh b/snip.sh
new file mode 100755
index 0000000..7fb60bc
--- /dev/null
+++ b/snip.sh
@@ -0,0 +1 @@
+grim -l 0 -g "$(slurp)" - | wl-copy
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..bc3631e
--- /dev/null
+++ b/style.css
@@ -0,0 +1,104 @@
+@define-color bg #1a1b26;
+@define-color fg #a9b1d6;
+@define-color blk #32344a;
+@define-color red #f7768e;
+@define-color grn #9ece6a;
+@define-color ylw #e0af68;
+@define-color blu #7aa2f7;
+@define-color mag #ad8ee6;
+@define-color cyn #0db9d7;
+@define-color brblk #444b6a;
+@define-color white #ffffff;
+
+* {
+ font-family: "JetBrainsMono Nerd Font", monospace;
+ font-size: 16px;
+ font-weight: bold;
+}
+
+window#waybar {
+ background-color: @bg;
+ color: @fg;
+}
+
+#workspaces button {
+ padding: 0 6px;
+ color: @cyn;
+ background: transparent;
+ border-bottom: 3px solid @bg;
+}
+#workspaces button.active {
+ color: @cyn;
+ border-bottom: 3px solid @mag;
+}
+#workspaces button.hidden {
+ color: @white;
+}
+#workspaces button.hidden.active {
+ color: @cyn;
+ border-bottom: 3px solid @mag;
+}
+
+#workspaces button.urgent {
+ background-color: @red;
+}
+
+button:hover {
+ background: inherit;
+ box-shadow: inset 0 -3px #ffffff;
+}
+
+#clock,
+#custom-sep,
+#battery,
+#cpu,
+#memory,
+#disk,
+#network,
+#tray {
+ padding: 0 8px;
+ color: @white;
+}
+
+#custom-sep {
+ color: @brblk;
+}
+
+#clock {
+ color: @cyn;
+ border-bottom: 4px solid @cyn;
+}
+
+#battery {
+ color: @blu;
+ border-bottom: 4px solid @blu;
+}
+
+#disk {
+ color: @ylw;
+ border-bottom: 4px solid @ylw;
+}
+
+#memory {
+ color: @mag;
+ border-bottom: 4px solid @mag;
+}
+
+#cpu {
+ color: @grn;
+ border-bottom: 4px solid @grn;
+}
+
+#network {
+ color: @red;
+ border-bottom: 4px solid @red;
+}
+
+#network.disconnected {
+ background-color: @red;
+}
+
+#tray {
+ background-color: #2980b9;
+}
+