dgy
/
hexagons
Archived
1
0
Fork 0

por que multimonitor y power mgmt tienen que ser tanta paja sin un DE. posta, que carajo

This commit is contained in:
deadguy 2020-04-02 07:15:45 -03:00
parent 39f875509b
commit 844e02dc70
Signed by: dgy
GPG Key ID: 37CA55B52CF63730
12 changed files with 112 additions and 25 deletions

View File

@ -40,6 +40,10 @@
! dmenu
dmenu.font: SF Pro Text:pixelsize=16:antialias=true:autohint=true;
dmenu.background: #222222
dmenu.foreground: #bbbbbb
dmenu.selbackground: #008bbd
dmenu.selforeground: #eeeeee
Xft.autohint: 0
Xft.lcdfilter: lcddefault

View File

@ -3,19 +3,7 @@ set -euf -o pipefail
bspc rule -r "*"
monitors=("$(xrandr --listactivemonitors | awk '{print $4}' | sed '/^$/d')")
if [ "${#monitors[@]}" == "2" ]; then
bspc monitor "${monitors[0]}" -d 1 2 3 4 5
bspc monitor "${monitors[1]}" -d 6 7 8 9 10
if xrandr | grep "VGA1 connected"; then
xrandr --output LVDS1 --auto --output VGA1 --auto --right-of LVDS1
fi
setbg &
fi
bspc monitor -d 1 2 3 4 5 6 7 8 9 10
moni &
bspc config border_width 1
bspc config window_gap 6

View File

@ -246,6 +246,7 @@ map <f-9> paste
map <enter> open
map <delete> delete
map . set hidden!
map "'" set preview!
map | top
map ¿ bottom
map R reload

View File

@ -92,4 +92,4 @@ follow_now_playing_lyrics = no
store_lyrics_in_song_dir = no
lyrics_directory = ~/.local/share/lyrics
execute_on_song_change = "/home/deadguy/bin/tapa"
execute_on_song_change = "tapa"

View File

@ -54,11 +54,14 @@ super + {_,shift} + ntilde
super + {b,v,q,c}
{$BROWSER,pavucontrol,powermenu,gsimplecal}
super + {z,x}
st {-n multi -e termux,-n flota}
super + {z,n,x}
$TERMINAL -n {multi -e termux,flota -e nmtui,flota}
super + {n,m}
st -n flota -e {nmtui,brandr}
super + shift + x
tmenux
super + m
monisel
super + space
j4-dmenu-desktop --dmenu="dmenu -i -p 'Apps '" --no-generic
@ -69,8 +72,14 @@ super + r
super + s
dswitcher
super + {F1,F2,F3,F4,F5,F6,F7,F8}
{fecha,pila,tapa,notifocus,grabar,corte,touchpad,tmenux}
super + g
grabar
super + shift + g
corte
super + {F1,F2,F3,F4,F5}
{fecha,pila,tapa,notifocus,touchpad}
ctrl + alt + x
xkill

View File

@ -120,6 +120,7 @@ foreach extra (
extras.zsh
aliases.plugin.zsh
zsh-system-clipboard/zsh-system-clipboard.zsh
git-extras-completion.zsh
lf-icons.zsh
) {
source $ZDOTDIR/$extra

View File

@ -3,7 +3,8 @@ alias vdi='vimdiff'
alias gdl='gallery-dl'
alias m='neomutt'
alias rr='ranger'
alias amix='alsamixer'
alias am='alsamixer'
alias pm='pulsemixer'
alias v='$EDITOR'
alias irc='weechat -d "$XDG_CONFIG_HOME"/weechat'
alias play='ncmpcpp'

69
.local/bin/monisel Executable file
View File

@ -0,0 +1,69 @@
#!/bin/sh
# A UI for detecting and selecting all displays.
# Probes xrandr for connected displays and lets user select one to use.
twoscreen() { # If multi-monitor is selected and there are two screens.
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
}
morescreen() { # If multi-monitor is selected and there are more than two screens.
primary=$(echo "$screens" | dmenu -i -p "Select primary display: ")
secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display: ")
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on? ")
tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display: ")
xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto
}
multimon() { # Multi-monitor handler.
case "$(echo "$screens" | wc -l)" in
1) xrandr "$(echo "$allposs" | grep -v "$screens" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ')" ;;
2) twoscreen ;;
*) morescreen ;;
esac ;}
# Get all possible displays
allposs=$(xrandr -q | grep "connected")
# Get all connected screens.
screens=$(echo "$allposs" | grep " connected" | awk '{print $1}')
# Get user choice including multi-monitor and manual selection:
chosen=$(printf "%s\\nmulti-monitor" "$screens" | dmenu -i -p "Select display arangement:") &&
case "$chosen" in
"multi-monitor") multimon ;;
*) xrandr --output "$chosen" --auto --scale 1.0x1.0 "$(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ')" ;;
esac
setbg # Fix background if screen size/arangement has changed.
pgrep -x dunst >/dev/null && killall dunst && setsid dunst & # Restart dunst to ensure proper location on screen

View File

@ -1,7 +1,7 @@
#!/bin/sh
opt="bspwm mpd dunst picom fonts shell"
program="$(echo "$opt" | sed 's/ /\n/g' | fzf -m --cycle --select-1 --exit-0)"
program="$(echo "$opt" | sed 's/ /\n/g' | dmenu -i -p "Reload ")"
case $program in
bspwm) bspc wm -r;;

View File

@ -1,4 +1,4 @@
#!/bin/sh
# Sets the background. If given an argument, will set file as background.
[ -n "$1" ] && cp "$1" ~/.config/wall.png
hsetroot -fill ~/.config/wall.png >/dev/null 2>&1
# [ -n "$1" ] && cp "$1" ~/.config/wall.png
hsetroot -fill /tmp/bg >/dev/null 2>&1

14
.local/bin/tmenux Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
# open a new tmux session
# or attach to existing sessions
sessions="$(tmux ls 2> /dev/null | awk '! /attached/ { sub(":", "", $1); print $1 ; }')"
[ ! "$sessions" ] && sessions="new" || sessions="$sessions\nnew"
choice=$(printf "%b" "$sessions" | dmenu -i -p "Attach ")
[ ! "$choice" ] && exit
if [ "$choice" = "new" ]; then
$TERMINAL -e tmux
else
$TERMINAL -e tmux a -t "$choice"
fi

View File

@ -10,7 +10,6 @@ automake
autopep8
bat
bison
brandr
broot
bspwm
cadence
@ -135,6 +134,7 @@ pkgbrowser
polkit-gnome
prettier
pulseaudio-jack
pulsemixer
python-beautifulsoup4
python-glfw
python-language-server