mirror of
https://gitlab.com/mlunax/dotfiles.git
synced 2025-04-19 08:45:36 +00:00
add nvidia scripts
This commit is contained in:
parent
977f9c5bbe
commit
c515ec37c7
5 changed files with 21 additions and 1 deletions
14
.local/scripts/nvidia-vsync
Normal file
14
.local/scripts/nvidia-vsync
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
DPY0_COMMAND = '"DPY-0: nvidia-auto-select @1440x900 +0+0 {ViewPortIn=1440x900, ViewPortOut=1440x900+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On},DPY-1: nvidia-auto-select @1920x1080 +1440+0 {AllowGSYNC=Off, ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"'
|
||||||
|
DPY1_COMMAND = '"DPY-1: nvidia-auto-select @1920x1080 +1440+0 {AllowGSYNC=Off, ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, DPY-0: nvidia-auto-select @1440x900 +0+0 {ViewPortIn=1440x900, ViewPortOut=1440x900+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"'
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
out = subprocess.check_output("nvidia-settings --query CurrentMetaMode", shell=True).decode("utf-8").strip()
|
||||||
|
index0 = out.index("DPY-0")
|
||||||
|
index1 = out.index("DPY-1")
|
||||||
|
if index0 < index1:
|
||||||
|
subprocess.run("nvidia-settings --assign CurrentMetaMode=" + DPY0_COMMAND, shell=True)
|
||||||
|
elif index1 < index0:
|
||||||
|
subprocess.run("nvidia-settings --assign CurrentMetaMode=" + DPY1_COMMAND, shell=True)
|
|
@ -12,4 +12,4 @@ alias \
|
||||||
ytv="youtube-dl -f bestvideo" \
|
ytv="youtube-dl -f bestvideo" \
|
||||||
smpv="mpv --profile=svp --script-opts=socketPath=/tmp/mpvsocket " \
|
smpv="mpv --profile=svp --script-opts=socketPath=/tmp/mpvsocket " \
|
||||||
discord-stream="doas modprobe v4l2loopback video_nr=15; nohup ffmpeg -f x11grab -r 30 -s 1920x1080 -i :0+1440,0 -pix_fmt yuv420p -f v4l2 /dev/video15&; disown" \
|
discord-stream="doas modprobe v4l2loopback video_nr=15; nohup ffmpeg -f x11grab -r 30 -s 1920x1080 -i :0+1440,0 -pix_fmt yuv420p -f v4l2 /dev/video15&; disown" \
|
||||||
|
vim="nvim"
|
||||||
|
|
|
@ -7,3 +7,4 @@ grep -q 'gem' <<< $devTools && export PATH="$PATH:$(ruby -e 'puts Gem.user_dir')
|
||||||
grep -q 'npm' <<< $devTools && export PATH="$PATH:$HOME/.local/npm/bin"
|
grep -q 'npm' <<< $devTools && export PATH="$PATH:$HOME/.local/npm/bin"
|
||||||
grep -q 'go' <<< $devTools && export PATH="$PATH:$(go env GOPATH)/bin"
|
grep -q 'go' <<< $devTools && export PATH="$PATH:$(go env GOPATH)/bin"
|
||||||
grep -q 'android' <<< $devTools && export ANDROID_SDK_ROOT="$HOME/.android-sdk"
|
grep -q 'android' <<< $devTools && export ANDROID_SDK_ROOT="$HOME/.android-sdk"
|
||||||
|
export PATH="$PATH:$HOME/.local/scripts"
|
|
@ -10,6 +10,7 @@ function doIt() {
|
||||||
--exclude "install-code.sh" \
|
--exclude "install-code.sh" \
|
||||||
--exclude "install-packages.sh" \
|
--exclude "install-packages.sh" \
|
||||||
--exclude "configs/" \
|
--exclude "configs/" \
|
||||||
|
--exclude "install-scripts.zsh" \
|
||||||
-avh --no-perms . ~;
|
-avh --no-perms . ~;
|
||||||
if [ ! -d "${HOME}/.oh-my-zsh" ]; then
|
if [ ! -d "${HOME}/.oh-my-zsh" ]; then
|
||||||
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||||
|
|
4
install-scripts.zsh
Normal file
4
install-scripts.zsh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
mkdir -p $HOME/.local/scripts
|
||||||
|
cp -riv .local/scripts $HOME/.local
|
||||||
|
chmod -R +x $HOME/.local/scripts
|
Loading…
Add table
Reference in a new issue