mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-11 20:26:50 +02:00
Add other fish functions
This commit adds fish support for the other functions I used to use in zsh. Since my dotfiles are now separated by environment, it's easy to see which environment depends on which dotfiles, instead of stowing them one by one based on software name.
This commit is contained in:
parent
cb4278514d
commit
70757528fc
7
dots/bspwm/.config/fish/functions/1080p.fish
Normal file
7
dots/bspwm/.config/fish/functions/1080p.fish
Normal file
@ -0,0 +1,7 @@
|
||||
# Easily change the resolution to 1080p
|
||||
# Note: Also changes DPI, but not for the programs you already have open.
|
||||
function 1080p
|
||||
xrandr --output VGA-1 --mode "1920x1080" # Change the resolution
|
||||
sed -i '/Xft.dpi/c\Xft.dpi: 96' ~/.Xresources # Change the dpi line to 96
|
||||
xrdb ~/.Xresources # Reload .Xresources
|
||||
end
|
24
dots/bspwm/.config/fish/functions/4k.fish
Normal file
24
dots/bspwm/.config/fish/functions/4k.fish
Normal file
@ -0,0 +1,24 @@
|
||||
# Easily change the resolution to 4k
|
||||
# Note: Also changes DPI, but not for the programs you already have open.
|
||||
# TODO: Change this script to support fish
|
||||
function 4k
|
||||
# Get the display type (VGA-1, etc.)
|
||||
local display=$(xrandr | grep -Eo ".{0,20} connected" | awk '{print $1}')
|
||||
|
||||
# Get the default mode name for 4k
|
||||
local mode=$(cvt 3840 2160 | grep "Modeline" | awk '{print $2}')
|
||||
|
||||
# If the 4k mode hasn't been added yet
|
||||
if not (xrandr | grep -q 3840x2160)
|
||||
|
||||
# Create the new mode with cvt settings
|
||||
xrandr --newmode $(cvt 3840 2160 | grep -o '"3840x2160.*')
|
||||
|
||||
# Add the new mode to the display with xrandr
|
||||
xrandr --addmode ${display} ${mode}
|
||||
end
|
||||
|
||||
xrandr --output ${display} --mode ${mode} # Change the resolution to 4k
|
||||
sed -i '/Xft.dpi/c\Xft.dpi: 180' ~/.Xresources # Change the dpi line to 180
|
||||
xrdb ~/.Xresources # Reload .Xresources
|
||||
end
|
11
dots/common/.config/fish/functions/lab.fish
Normal file
11
dots/common/.config/fish/functions/lab.fish
Normal file
@ -0,0 +1,11 @@
|
||||
# Easily clone and cd into GitLab repositories
|
||||
# Usage: lab username/repository
|
||||
function lab --argument-names "path"
|
||||
if test -n "$path"
|
||||
git clone git@gitlab.com:$path.git
|
||||
cd (basename "$path")
|
||||
else
|
||||
echo "No repository was specified."
|
||||
echo "Usage: lab username/repository"
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user