dev: automated commit - 2025-08-16 22:19:32
This commit is contained in:
parent
e7b1106123
commit
77a15abcf4
9 changed files with 95 additions and 12 deletions
|
|
@ -262,6 +262,90 @@ function cat {
|
|||
fi
|
||||
}
|
||||
|
||||
function toggle_resolution() {
|
||||
local projector_mode=false
|
||||
|
||||
# Verificar si se pasó el flag -p o --projector
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-p|--projector)
|
||||
projector_mode=true
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
current_state=$(swaymsg -t get_outputs | jq -r '.[] | select(.name == "eDP-1") | "\(.current_mode.width)x\(.current_mode.height):\(.scale)"')
|
||||
|
||||
if [[ "$projector_mode" == true ]]; then
|
||||
echo "Switching to projector mode (1024x768)..."
|
||||
swaymsg output eDP-1 resolution 1024x768@120Hz scale 1.0
|
||||
|
||||
# Si hay proyector conectado, configurarlo también
|
||||
if swaymsg -t get_outputs | jq -r '.[].name' | grep -q "HDMI-A-1"; then
|
||||
swaymsg output HDMI-A-1 resolution 1024x768 position 0,0
|
||||
swaymsg output eDP-1 position 0,0
|
||||
echo "Projector mirror mode enabled"
|
||||
fi
|
||||
elif [[ "$current_state" == "2880x1920:2.0" ]]; then
|
||||
echo "Switching to 1920x1080 (16:9)..."
|
||||
swaymsg output eDP-1 resolution 1920x1080@120Hz scale 1.0
|
||||
else
|
||||
echo "Switching to 2880x1920 (3:2)..."
|
||||
swaymsg output eDP-1 resolution 2880x1920@120Hz scale 2.0
|
||||
fi
|
||||
}
|
||||
|
||||
function cb {
|
||||
export GTK_THEME=HighContrast
|
||||
export GDK_THEME=HighContrast
|
||||
export QT_STYLE_OVERRIDE=HighContrast
|
||||
export XDG_CURRENT_DESKTOP=GNOME
|
||||
|
||||
# Reiniciar configuración GTK
|
||||
unset GTK2_RC_FILES
|
||||
unset GTK_RC_FILES
|
||||
|
||||
exec /usr/bin/codeblocks "$@"
|
||||
}
|
||||
|
||||
|
||||
function zrepo() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: zrepo <repo>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local REPO="$1"
|
||||
local SERVER="git@zvps"
|
||||
local PATH_ON_SERVER="/var/git/$REPO.git"
|
||||
|
||||
ssh $SERVER "
|
||||
if [ -d $PATH_ON_SERVER ]; then
|
||||
echo 'Error: repo already exists'
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p $PATH_ON_SERVER &&
|
||||
git init --bare $PATH_ON_SERVER &&
|
||||
chown -R git:git $PATH_ON_SERVER &&
|
||||
chmod -R 755 $PATH_ON_SERVER
|
||||
" || return 1
|
||||
|
||||
echo "Repo created on $SERVER:$PATH_ON_SERVER"
|
||||
|
||||
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
git remote add origin "$SERVER:$PATH_ON_SERVER"
|
||||
echo "Remote 'origin' added to your local repo."
|
||||
else
|
||||
echo "Run 'git clone $SERVER:$PATH_ON_SERVER' to clone the repo."
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
function _has {
|
||||
return $( whence $1 >/dev/null )
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue