updated script documentation to match option doc formatting
This commit is contained in:
@@ -1,49 +1,70 @@
|
|||||||
# pagedMov's Custom Command Scripts
|
# pagedMov's Custom Command Scripts
|
||||||
|
|
||||||
## icanhazip
|
- **icanhazip**
|
||||||
- Leverages ip and icanhazip.com to return relevant ip info for the current machine.
|
- **Description**:
|
||||||
- Usage:
|
- Leverages `ip` and `icanhazip.com` to return relevant IP information for the current machine.
|
||||||
- `icanhazip` - returns public ip, local ip, and default gateway
|
- **Usage**:
|
||||||
- `icanhazip -p` - returns only public ip
|
- `icanhazip` - Returns public IP, local IP, and default gateway.
|
||||||
- `icanhazip -l` - returns only local ip
|
- `icanhazip -p` - Returns only public IP.
|
||||||
- `icanhazip -d` - returns only default gateway
|
- `icanhazip -l` - Returns only local IP.
|
||||||
- Defined in 'modules/home/scripts/commands/icanhazip.nix'
|
- `icanhazip -d` - Returns only default gateway.
|
||||||
|
- *Defined in*: `modules/home/scripts/commands/icanhazip.nix`
|
||||||
|
|
||||||
## invoke
|
---
|
||||||
|
|
||||||
|
- **invoke**
|
||||||
|
- **Description**:
|
||||||
- Leverages `nix run` to run any command once. Works with arguments.
|
- Leverages `nix run` to run any command once. Works with arguments.
|
||||||
- Usage:
|
- **Usage**:
|
||||||
- `invoke <command>`
|
- `invoke <command>`
|
||||||
- Example:
|
- **Example**:
|
||||||
- `invoke hello`
|
- `invoke hello`
|
||||||
- Defined in 'modules/home/scripts/commands/invoke.nix'
|
- *Defined in*: `modules/home/scripts/commands/invoke.nix`
|
||||||
|
|
||||||
## runbg
|
---
|
||||||
- Runs a command and detaches the process from the shell silently. Works with arguments. Credit to [Frost-Phoenix](https://github.com/Frost-Phoenix) for writing this script.
|
|
||||||
- Usage:
|
- **runbg**
|
||||||
|
- **Description**:
|
||||||
|
- Runs a command and detaches the process from the shell silently. Works with arguments.
|
||||||
|
- Credit to [Frost-Phoenix](https://github.com/Frost-Phoenix) for writing this script.
|
||||||
|
- **Usage**:
|
||||||
- `runbg <command> <args>`
|
- `runbg <command> <args>`
|
||||||
- Example:
|
- **Example**:
|
||||||
- `runbg waybar`
|
- `runbg waybar`
|
||||||
- Defined in 'modules/home/scripts/commands/runbg.nix'
|
- *Defined in*: `modules/home/scripts/commands/runbg.nix`
|
||||||
|
|
||||||
## toolbelt
|
---
|
||||||
- Opens a fuzzyfinder window with some useful utilities. Meant to be used with the Super + P bind defined in hyprland.nix, and not invoked directly from the shell.
|
|
||||||
- Defined in 'modules/home/scripts/commands/toolbelt.nix'
|
|
||||||
|
|
||||||
## viconf
|
- **toolbelt**
|
||||||
- Searches the directory held in the $FLAKEPATH environment variable for a given nix file or directory name. Opens the file found in neovim, or if there are multiple matches, opens a fuzzyfinder window to allow you to choose one.
|
- **Description**:
|
||||||
- Usage:
|
- Opens a fuzzyfinder window with some useful utilities.
|
||||||
|
- Meant to be used with the `Super + P` bind defined in `hyprland.nix`, and not invoked directly from the shell.
|
||||||
|
- *Defined in*: `modules/home/scripts/commands/toolbelt.nix`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
- **viconf**
|
||||||
|
- **Description**:
|
||||||
|
- Searches the directory held in the `$FLAKEPATH` environment variable for a given Nix file or directory name.
|
||||||
|
- Opens the file in Neovim, or if there are multiple matches, opens a fuzzyfinder window to allow you to choose one.
|
||||||
|
- **Usage**:
|
||||||
- `viconf <part of path or filename>`
|
- `viconf <part of path or filename>`
|
||||||
- Examples:
|
- **Examples**:
|
||||||
- `viconf hyprland` - Opens $FLAKEPATH/modules/home/environment/hyprland.nix
|
- `viconf hyprland` - Opens `$FLAKEPATH/modules/home/environment/hyprland.nix`.
|
||||||
- `viconf sys` - Opens fuzzyfinder window containing all nix files in modules/sys and its subdirectories
|
- `viconf sys` - Opens a fuzzyfinder window containing all Nix files in `modules/sys` and its subdirectories.
|
||||||
- `viconf config` - Opens fuzzyfinder window containing all nix files called 'config.nix'
|
- `viconf config` - Opens a fuzzyfinder window containing all Nix files called `config.nix`.
|
||||||
- `viconf scripts/def` - Opens $FLAKEPATH/modules/home/scripts/default.nix
|
- `viconf scripts/def` - Opens `$FLAKEPATH/modules/home/scripts/default.nix`.
|
||||||
- Defined in 'modules/home/scripts/commands/viconf.nix'
|
- *Defined in*: `modules/home/scripts/commands/viconf.nix`
|
||||||
|
|
||||||
## vipkg
|
---
|
||||||
- Searches the pkgs directory from the nixpkgs github repository. Works almost identically to viconf with a few tweaks to accomodate the different directory structure. Useful for when you want to override a package's build attributes. Can also just be used to search for a package name.
|
|
||||||
- Usage:
|
- **vipkg**
|
||||||
|
- **Description**:
|
||||||
|
- Searches the `pkgs` directory from the Nixpkgs GitHub repository.
|
||||||
|
- Works almost identically to `viconf` with a few tweaks to accommodate the different directory structure.
|
||||||
|
- Useful for overriding a package's build attributes or searching for a package name.
|
||||||
|
- **Usage**:
|
||||||
- `vipkg <part of package name>`
|
- `vipkg <part of package name>`
|
||||||
- Example:
|
- **Example**:
|
||||||
- `vipkg neofetch` - Opens nixpkgs/pkgs/tools/misc/neofetch/default.nix
|
- `vipkg neofetch` - Opens `nixpkgs/pkgs/tools/misc/neofetch/default.nix`.
|
||||||
- Defined in 'modules/home/scripts/commands/vipkg.nix'
|
- *Defined in*: `modules/home/scripts/commands/vipkg.nix`
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# pagedMov's Nix Aliases
|
# pagedMov's Nix Aliases
|
||||||
|
|
||||||
## fetchfromgh
|
- **fetchfromgh**
|
||||||
- Given a username and repo name like someuser/somerepo, generates a full pkgs.fetchFromGitHub call. Uses the most recent commit.
|
- **Description**:
|
||||||
- Usage:
|
- Given a username and repo name like `someuser/somerepo`, generates a full `pkgs.fetchFromGitHub` call. Uses the most recent commit.
|
||||||
|
- **Usage**:
|
||||||
- `fetchfromgh someuser/somerepo`
|
- `fetchfromgh someuser/somerepo`
|
||||||
- Example:
|
- **Example**:
|
||||||
- `fetchfromgh pagedMov/nixos-config` - returns this:
|
- `fetchfromgh pagedMov/nixos-config`
|
||||||
|
- Returns:
|
||||||
|
|
||||||
```
|
```
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "pagedMov";
|
owner = "pagedMov";
|
||||||
@@ -16,25 +16,36 @@
|
|||||||
hash = "sha256-z+3E+ueSd2QNqtrbBKt8bwIfboPCXSUrGn690Hc/kl0=";
|
hash = "sha256-z+3E+ueSd2QNqtrbBKt8bwIfboPCXSUrGn690Hc/kl0=";
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
- Defined in 'modules/home/scripts/nix/fetchfromgh.nix'
|
- *Defined in*: `modules/home/scripts/nix/fetchfromgh.nix`
|
||||||
|
|
||||||
## garbage-collect
|
---
|
||||||
- Runs the Nix garbage collector and also deletes all files in .local/share/Trash
|
|
||||||
- Usage:
|
|
||||||
- `garbage-collect` - Does not take any arguments
|
|
||||||
- Defined in 'modules/home/scripts/nix/garbage-collect.nix'
|
|
||||||
|
|
||||||
## nsp
|
- **garbage-collect**
|
||||||
- Simple alias for `nix-shell -p`
|
- **Description**:
|
||||||
- Usage:
|
- Runs the Nix garbage collector and also deletes all files in `.local/share/Trash`.
|
||||||
|
- **Usage**:
|
||||||
|
- `garbage-collect` - Does not take any arguments.
|
||||||
|
- *Defined in*: `modules/home/scripts/nix/garbage-collect.nix`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
- **nsp**
|
||||||
|
- **Description**:
|
||||||
|
- Simple alias for `nix-shell -p`.
|
||||||
|
- **Usage**:
|
||||||
- `nsp <package name>`
|
- `nsp <package name>`
|
||||||
- Example:
|
- **Example**:
|
||||||
- `nsp hello`
|
- `nsp hello`
|
||||||
- Defined in 'modules/home/scripts/nix/nsp.nix'
|
- *Defined in*: `modules/home/scripts/nix/nsp.nix`
|
||||||
|
|
||||||
## rebuild
|
---
|
||||||
- nh os switch and nh home switch packaged into one command
|
|
||||||
- Usage:
|
- **rebuild**
|
||||||
|
- **Description**:
|
||||||
|
- Combines `nh os switch` and `nh home switch` into a single command.
|
||||||
|
- **Usage**:
|
||||||
- `rebuild -h` - Runs `nh home switch -c <currenthostname> $FLAKEPATH`
|
- `rebuild -h` - Runs `nh home switch -c <currenthostname> $FLAKEPATH`
|
||||||
- `rebuild -s` - Runs `nh os switch -H <currenthostname> $FLAKEPATH`
|
- `rebuild -s` - Runs `nh os switch -H <currenthostname> $FLAKEPATH`
|
||||||
- Defined in 'modules/home/scripts/nix/rebuild.nix'
|
- `rebuild -a` - Runs both of the above commands.
|
||||||
|
- Adding `n` before any flag (e.g., `rebuild -na`) performs a dry run.
|
||||||
|
- *Defined in*: `modules/home/scripts/nix/rebuild.nix`
|
||||||
|
|||||||
@@ -1,47 +1,79 @@
|
|||||||
# Custom Hyprland Controls
|
# Custom Hyprland Controls
|
||||||
|
|
||||||
None of these are meant to be invoked directly in the terminal and are mainly used as helpers for my other scripts. I will
|
*Note*: None of these are meant to be invoked directly in the terminal and are primarily used as helpers for other scripts. However, they are documented here in case you wish to use them in your own scripts.
|
||||||
still document them in case you wish to use them in your own scripts.
|
|
||||||
|
|
||||||
## chscheme
|
---
|
||||||
- Opens a fzf menu containing all of the color schemes contained in the base16schemes package in nixpkgs. The fzf preview contains the colors so you can see them in your terminal before you choose them.
|
|
||||||
- Usage:
|
- **chscheme**
|
||||||
|
- **Description**:
|
||||||
|
- Opens an `fzf` menu containing all of the color schemes available in the `base16schemes` package from Nixpkgs.
|
||||||
|
- The `fzf` preview shows the colors so you can see them in your terminal before choosing one.
|
||||||
|
- **Usage**:
|
||||||
- `chscheme` - Does not take arguments.
|
- `chscheme` - Does not take arguments.
|
||||||
- Defined in 'modules/home/scripts/wm-controls/chscheme.nix'
|
- *Defined in*: `modules/home/scripts/wm-controls/chscheme.nix`
|
||||||
|
|
||||||
## chpaper
|
---
|
||||||
- Opens a fzf menu containing all of the wallpapers held in $FLAKEPATH/assets/wallpapers. The fzf preview shows the image file that the user is hovering over.
|
|
||||||
- Usage:
|
- **chpaper**
|
||||||
|
- **Description**:
|
||||||
|
- Opens an `fzf` menu containing all wallpapers in `$FLAKEPATH/assets/wallpapers`.
|
||||||
|
- The `fzf` preview shows the image file the user is hovering over.
|
||||||
|
- **Usage**:
|
||||||
- `chpaper` - Does not take arguments.
|
- `chpaper` - Does not take arguments.
|
||||||
- Defined in 'modules/home/scripts/wm-controls/chpaper.nix'
|
- *Defined in*: `modules/home/scripts/wm-controls/chpaper.nix`
|
||||||
|
|
||||||
## keyring
|
---
|
||||||
- Opens a fzf menu containing all of the directories/files contained in ~/.password-store. Selecting one uses `pass -c` to copy it to the clipboard. The script pauses the clipboard history daemon while it does this so that the password is not added to your clipboard history. If anyone can think of a more secure way to do this, let me know. Password is cleared from the clipboard automatically after 10 seconds if not overwritten by something else.
|
|
||||||
- Usage:
|
- **keyring**
|
||||||
|
- **Description**:
|
||||||
|
- Opens an `fzf` menu containing all directories/files in `~/.password-store`.
|
||||||
|
- Selecting an entry uses `pass -c` to copy it to the clipboard.
|
||||||
|
- Temporarily pauses the clipboard history daemon to ensure the password is not added to clipboard history.
|
||||||
|
- Automatically clears the password from the clipboard after 10 seconds unless overwritten.
|
||||||
|
- **Usage**:
|
||||||
- `keyring` - Does not take arguments.
|
- `keyring` - Does not take arguments.
|
||||||
- Defined in 'modules/home/scripts/wm-controls/keyring.nix'
|
- *Defined in*: `modules/home/scripts/wm-controls/keyring.nix`
|
||||||
|
|
||||||
## mkscreenshots
|
---
|
||||||
- If workspace 4 is empty, switches to that workspace and takes some screenshots that showcase the desktop environment. These screenshots are then saved to $FLAKEPATH/assets/screens, overwriting the old ones. README.md is then updated to include the commit that the screenshots were taken on.
|
|
||||||
- Usage:
|
- **mkscreenshots**
|
||||||
|
- **Description**:
|
||||||
|
- Switches to workspace 4 (if empty) and takes screenshots showcasing the desktop environment.
|
||||||
|
- Saves the screenshots to `$FLAKEPATH/assets/screens`, overwriting the old ones.
|
||||||
|
- Updates `README.md` to include the commit hash of the current screenshots.
|
||||||
|
- **Usage**:
|
||||||
- `mkscreenshots` - Does not take arguments. Only runs if workspace 4 has no windows.
|
- `mkscreenshots` - Does not take arguments. Only runs if workspace 4 has no windows.
|
||||||
- Defined in 'modules/home/scripts/wm-controls/mkscreenshots.nix'
|
- *Defined in*: `modules/home/scripts/wm-controls/mkscreenshots.nix`
|
||||||
|
|
||||||
## moveonscreen
|
---
|
||||||
- Uses hyprctl to move the currently active window, if it is floating. The window moves relative to the cursor, and will not move past the bounds of the screen. Used by toolbelt to produce the cool window movements.
|
|
||||||
- Usage:
|
|
||||||
- `moveonscreen` - Moves the window to the cursor's position, anchored at the top-left corner. Does not leave the bounds of the screen.
|
|
||||||
- `moveonscreen --center` - Behaves the same way, except anchors at the center of the window instead of the top-left corner.
|
|
||||||
- Defined in 'modules/home/scripts/wm-controls/moveonscreen.nix'
|
|
||||||
|
|
||||||
## s_check
|
- **moveonscreen**
|
||||||
- A simple test invocation checking to see if $SOUNDS_ENABLED is 0 or 1. Don't ask why this doesn't work as a zsh alias, because it doesn't for some reason and I don't really know why. Does not return anything except for the status code from the test.
|
- **Description**:
|
||||||
- Usage:
|
- Uses `hyprctl` to move the currently active floating window relative to the cursor.
|
||||||
|
- Prevents the window from moving outside the screen bounds.
|
||||||
|
- Often used with `toolbelt` for smooth window movements.
|
||||||
|
- **Usage**:
|
||||||
|
- `moveonscreen` - Moves the window to the cursor's position, anchored at the top-left corner.
|
||||||
|
- `moveonscreen --center` - Moves the window to the cursor's position, anchored at the center of the window.
|
||||||
|
- *Defined in*: `modules/home/scripts/wm-controls/moveonscreen.nix`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
- **s_check**
|
||||||
|
- **Description**:
|
||||||
|
- Tests whether `$SOUNDS_ENABLED` is set to `0` or `1`.
|
||||||
|
- Does not return anything except the status code from the test.
|
||||||
|
- *Note*: This does not work as a Zsh alias for unknown reasons.
|
||||||
|
- **Usage**:
|
||||||
- `s_check` - Does not take arguments.
|
- `s_check` - Does not take arguments.
|
||||||
- Defined in 'modules/home/scripts/wm-controls/switchmon.nix'
|
- *Defined in*: `modules/home/scripts/wm-controls/switchmon.nix`
|
||||||
|
|
||||||
## switchmon
|
---
|
||||||
- Uses hyprctl to switch the focused monitor to the other monitor. Currently only supports setups with two monitors.
|
|
||||||
- Usage:
|
- **switchmon**
|
||||||
|
- **Description**:
|
||||||
|
- Uses `hyprctl` to switch focus between two monitors.
|
||||||
|
- Only supports setups with two monitors.
|
||||||
|
- **Usage**:
|
||||||
- `switchmon` - Does not take arguments.
|
- `switchmon` - Does not take arguments.
|
||||||
- Defined in 'modules/home/scripts/wm-controls/switchmon.nix'
|
- *Defined in*: `modules/home/scripts/wm-controls/switchmon.nix`
|
||||||
|
|||||||
Reference in New Issue
Block a user