dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README

commit da93d38eb4e2552e9309885ee0e991f61c340d0d
parent e8174547656256d878dc3eb767a9e6c731044271
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date:   Fri,  5 Jul 2024 17:57:13 -0500

local/bin: remove unused scripts

Diffstat:
D.local/bin/displayselect | 71-----------------------------------------------------------------------
M.local/bin/imca | 2+-
M.local/bin/leticia | 2+-
D.local/bin/texmath | 11-----------
M.local/bin/thesis | 2+-
5 files changed, 3 insertions(+), 85 deletions(-)

diff --git a/.local/bin/displayselect b/.local/bin/displayselect @@ -1,71 +0,0 @@ -#!/bin/sh - -onescreen() { # If only one output available or chosen. - xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -) -} - -postrun() { # Stuff to run to clean up. - { - killall dunst - setsid -f dunst - } >/dev/null 2>&1 # Restart dunst to ensure proper location on screen -} - -# Get all possible displays -allposs=$(xrandr -q | grep "connected") - -# Get all connected screens. -screens=$(echo "$allposs" | awk '/ connected/ {print $1}') - -# If there's only one screen -[ "$(echo "$screens" | wc -l)" -lt 2 ] && - { - onescreen "$screens" - notify-send "💻 Only one screen detected." "Using it in its optimal settings..." - exit - } - -# Get user choice including multi-monitor and manual selection: -chosen=$(printf "%s\\ntwoscreens\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && - case "$chosen" in - "manual selection") - arandr - exit - ;; - "twoscreens") - mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?") - # Mirror displays using native resolution of external display and a scaled - # version for the internal display - if [ "$mirror" = "yes" ]; then - external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:") - internal=$(echo "$screens" | grep -v "$external") - - res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | - tail -n 1 | awk '{print $1}') - res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | - tail -n 1 | awk '{print $1}') - - res_ext_x=$(echo "$res_external" | sed 's/x.*//') - res_ext_y=$(echo "$res_external" | sed 's/.*x//') - res_int_x=$(echo "$res_internal" | sed 's/x.*//') - res_int_y=$(echo "$res_internal" | sed 's/.*x//') - - scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l) - scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l) - - xrandr --output "$external" --auto --scale 1.0x1.0 \ - --output "$internal" --auto --same-as "$external" \ - --scale "$scale_x"x"$scale_y" - else - - primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - secondary=$(echo "$screens" | grep -v "$primary") - direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") - xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 - fi - - ;; - *) onescreen "$chosen" ;; - esac - -postrun diff --git a/.local/bin/imca b/.local/bin/imca @@ -46,7 +46,7 @@ if ! tmux has-session -t imca; then tmux split-window -d -v -t imca:0.1 -c webpack-imca tmux send-keys -t imca:0.0 'source venv/bin/activate' C-m - tmux send-keys -t imca:0.0 'vim -S ~/.vim/session/imca.vim' C-m + tmux send-keys -t imca:0.0 'vim -S ${XDG_CONFIG_HOME}/vim/session/imca.vim' C-m tmux send-keys -t imca:0.1 'source venv/bin/activate' C-m command -v firefox >/dev/null 2>&1 && tmux send-keys -t imca:0.1 'sleep 6s && firefox 127.0.0.1:5000 &' C-m diff --git a/.local/bin/leticia b/.local/bin/leticia @@ -5,7 +5,7 @@ cd ~/dox/dev/leticia if ! tmux has-session -t leticia 2>/dev/null; then tmux new-session -s leticia -n main -d - tmux send-keys -t leticia:0.0 'vim -S ~/.vim/session/leticia.vim' C-m + tmux send-keys -t leticia:0.0 'vim -S ${XDG_CONFIG_HOME}/vim/session/leticia.vim' C-m tmux new-window -d -n 'python-leticia' -t leticia:1 -c leticia tmux send-keys -t leticia:1.0 '. venv/bin/activate; clear' C-m diff --git a/.local/bin/texmath b/.local/bin/texmath @@ -1,11 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; - -my @l = split /\$/, join( " ", <STDIN> ); -my $i = 0; -foreach (@l) { - next if $_ eq ''; - print $_ . "\n" if $i % 2; - ++$i; -} diff --git a/.local/bin/thesis b/.local/bin/thesis @@ -6,7 +6,7 @@ cd $HOME/dox/dev/thesis if ! tmux has-session -t thesis 2>/dev/null; then tmux new-session -s thesis -n editor -d - tmux send-keys -t thesis:0.0 'sleep 0.5s; vim --servername thesis -S ~/.vim/session/thesis.vim' C-m + tmux send-keys -t thesis:0.0 'sleep 0.5s; vim --servername thesis -S ${XDG_CONFIG_HOME}/vim/session/thesis.vim' C-m tmux new-window -t thesis -n pdftex mkdir -p output