Skip to content

Commit

Permalink
🐛 Fix NixOS path
Browse files Browse the repository at this point in the history
Add pacman-key, udisksctl, acpi, ethtool, rmmod, modinfo, alacritty
  • Loading branch information
Freed-Wu committed Oct 7, 2023
1 parent 72c55fc commit b1a236e
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ repos:
- id: check-toml
- id: check-json
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
rev: v1.5.4
hooks:
- id: remove-crlf
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -37,7 +37,7 @@ repos:
args:
- --msg-filename
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.1
rev: 2.7.2
hooks:
- id: editorconfig-checker
- repo: https://github.com/jumanjihouse/pre-commit-hooks
Expand All @@ -49,7 +49,7 @@ repos:
hooks:
- id: yamllint
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
Expand All @@ -62,8 +62,8 @@ repos:
- mdformat-black
- mdformat-config
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.7.1
rev: v0.10.0
hooks:
- id: markdownlint-cli2
additional_dependencies:
- markdown-it-texmath@0.9.1
- markdown-it-texmath
15 changes: 15 additions & 0 deletions sources/acpi.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# :fzf-tab:complete:(\\|*/|)acpi:options
case $group in
directory)
acpi -d $wod
;;
option)
case $word in
-(k|f|-(kelvin|fahrenheit)))
acpi -t $word
;;
*)
acpi $word
;;
esac
esac
6 changes: 6 additions & 0 deletions sources/alacritty-msg.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# :fzf-tab:complete:(\\|*/|)alacritty-command-msg:argument-1
case $group in
'alacritty msg commands')
alacritty msg help $word | bat --color=always -plhelp
;;
esac
6 changes: 6 additions & 0 deletions sources/alacritty.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# :fzf-tab:complete:(\\|*/|)alacritty:argument-1
case $group in
'alacritty commands')
alacritty help $word | bat --color=always -plhelp
;;
esac
6 changes: 6 additions & 0 deletions sources/ethtool.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# :fzf-tab:complete:(\\|*/|)ethtool:argument-1
case $group in
interface)
ethtool $word
;;
esac
2 changes: 1 addition & 1 deletion sources/gtk-launch.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)gtk-launch:values
less {/usr,~/.local}/share/applications/$word.desktop(N)
less {/usr,~/.local,~/.local/state/nix/profile,/run/current-system/sw}/share/applications/$word.desktop(N)
9 changes: 9 additions & 0 deletions sources/modinfo.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# :fzf-tab:complete:(\\|*/|)modinfo:argument-1
case $group in
'module file')
[[ -f $realpath ]] && modinfo $realpath | bat --color=always -plyaml || less $realpath
;;
module(|' alias'))
modinfo $word | bat --color=always -plyaml
;;
esac
5 changes: 5 additions & 0 deletions sources/pacman-key.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# :fzf-tab:complete:(\\|*/|)pacman-key:
case $group in
'keys in keyring')
pacman-key -f $word;;
esac
2 changes: 1 addition & 1 deletion sources/pkg-config.zsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# :fzf-tab:complete:(\\|*/|)pkg-config:argument-rest
case $group in
package)
less /usr/(lib|share)/pkgconfig/$word.pc
less "$(pkg-config --variable=pcfiledir $word)/$word.pc"
;;
'package file')
less ${realpath#--*=}
Expand Down
3 changes: 3 additions & 0 deletions sources/rmmod.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# :fzf-tab:complete:(\\|*/|)rmmod:argument-rest
lsmod | head -n1
lsmod | grep -E "^$word\>"
12 changes: 12 additions & 0 deletions sources/udisksctl-info.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# :fzf-tab:complete:(\\|*/|)udisksctl-info:*
case $group in
'block device')
udisksctl info -b $word | bat --color=always -plyaml
;;
'object path')
udisksctl info -p $word | bat --color=always -plyaml
;;
drive)
udisksctl info -d $word | bat --color=always -plyaml
;;
esac
2 changes: 1 addition & 1 deletion sources/xdg-settings.zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# :fzf-tab:complete:(\\|*/|)xdg-settings:
file=$(xdg-settings get $word)
[[ -n $file ]] && less {/usr,~/.local}/share/applications/$file(N)
[[ -n $file ]] && less {/usr,~/.local,~/.local/state/nix/profile,/run/current-system/sw}/share/applications/$file(N)

0 comments on commit b1a236e

Please sign in to comment.