From e5f1bbba2be64cff04cc0bf7d2224c8a50a1c6dc Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 31 Aug 2022 21:20:40 +0530 Subject: setting alacritty scaling to 1.5 so it looks similar on both monitors --- .config/XMonad/lib/Defaults.hs | 2 +- .config/XMonad/lib/Scratchpads.hs | 26 +++++++++++++++++++------- .scripts/audio_dl.sh | 12 ++++++++++++ .scripts/open_terminal | 8 ++++---- .scripts/secondmonitor.sh | 2 ++ 5 files changed, 38 insertions(+), 12 deletions(-) create mode 100755 .scripts/audio_dl.sh create mode 100755 .scripts/secondmonitor.sh diff --git a/.config/XMonad/lib/Defaults.hs b/.config/XMonad/lib/Defaults.hs index de162d6..e132b09 100644 --- a/.config/XMonad/lib/Defaults.hs +++ b/.config/XMonad/lib/Defaults.hs @@ -24,7 +24,7 @@ myLockscreen = "notify-send 'to be set up!' 'to be set up!'" myColorPicker = "colorpicker --short --one-shot --preview | xsel -b" myTerminal = "open_terminal" -myTerminal' = "alacritty" +myTerminal' = "WINIT_X11_SCALE_FACTOR=1.5 alacritty" myLauncher = "dmenu_run" volUp = "pamixer -i 5" diff --git a/.config/XMonad/lib/Scratchpads.hs b/.config/XMonad/lib/Scratchpads.hs index 7ccf044..8769437 100644 --- a/.config/XMonad/lib/Scratchpads.hs +++ b/.config/XMonad/lib/Scratchpads.hs @@ -4,18 +4,30 @@ import XMonad import qualified XMonad.StackSet as W import XMonad.Util.NamedScratchpad +import Defaults + -- open a scratchpad myScratchpad :: String -> X () myScratchpad x = namedScratchpadAction myScratchpads x +-- if I try to concatinate strings directly +-- it won't compile for some reason +term0Cmd = myTerminal' ++ " -t 'Term U'" +term1Cmd = myTerminal' ++ " -t 'Term I'" +term2Cmd = myTerminal' ++ " -t 'Term O'" +term3Cmd = myTerminal' ++ " -t 'Term P'" +lfCmd = myTerminal' ++ " -t 'lf' -e 'lf'" +nmtuiCmd = myTerminal' ++ " -t 'nmtui' -e 'nmtui'" +bpytopCmd = myTerminal' ++ " -t 'BPYTOP' -e 'bpytop'" + myScratchpads = - [ NS "Term 0" "alacritty -t 'Term U'" (title =? "Term U") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) - , NS "Term 1" "alacritty -t 'Term I'" (title =? "Term I") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) - , NS "Term 2" "alacritty -t 'Term O'" (title =? "Term O") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) - , NS "Term 3" "alacritty -t 'Term P'" (title =? "Term P") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) - , NS "lf" "alacritty -t 'lf' -e 'lf'" (title =? "lf") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) - , NS "nmtui" "alacritty -t 'nmtui' -e 'nmtui'" (title =? "nmtui") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) - , NS "BPYTOP" "alacritty -t 'BPYTOP' -e 'bpytop'" (title =? "BPYTOP") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) + [ NS "Term 0" term0Cmd (title =? "Term U") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) + , NS "Term 1" term1Cmd (title =? "Term I") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) + , NS "Term 2" term2Cmd (title =? "Term O") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) + , NS "Term 3" term3Cmd (title =? "Term P") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) + , NS "lf" lfCmd (title =? "lf") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) + , NS "nmtui" nmtuiCmd (title =? "nmtui") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) + , NS "BPYTOP" bpytopCmd (title =? "BPYTOP") (customFloating $ W.RationalRect (1/16) (1/16) (7/8) (7/8)) , NS "arandr" "arandr" (className =? "Arandr") (customFloating $ W.RationalRect (1/4) (1/4) (1/2) (1/2)) , NS "calc" "galculator" (className =? "Galculator") (customFloating $ W.RationalRect (5/13) (4/13) (3/13) (6/13)) , NS "blueman" "blueman-manager" (className =? "Blueman-manager") (customFloating $ W.RationalRect (5.5/16) (4/13) (5/16) (6/13)) diff --git a/.scripts/audio_dl.sh b/.scripts/audio_dl.sh new file mode 100755 index 0000000..8e6c9eb --- /dev/null +++ b/.scripts/audio_dl.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +FILE=$@ +LINES=$(cat $FILE) + +counter=1 +for line in $LINES; do + youtube-dl -x --audio-format mp3 "https://www.youtube.com/watch?v=$line" || echo "$line" >> "$FILE""_failed" + counter=$((counter+1)) + tail -n "+$counter" "$FILE" > "$FILE""_remaining" +done +rm "$FILE""_remaining" diff --git a/.scripts/open_terminal b/.scripts/open_terminal index 62ac7cc..c816a13 100755 --- a/.scripts/open_terminal +++ b/.scripts/open_terminal @@ -8,20 +8,20 @@ then PID=$(xprop -id $ACTIVE_WINDOW | grep _NET_WM_PID | grep -oP "\d+") if [[ "$PID" == "" ]] then - alacritty + WINIT_X11_SCALE_FACTOR=1.5 alacritty fi # Get first child of terminal CHILD_PID=$(pgrep -P $PID) if [[ "$PID" == "" ]] then - alacritty + WINIT_X11_SCALE_FACTOR=1.5 alacritty fi # Get current directory of child. The first child should be the shell. pushd "/proc/${CHILD_PID}/cwd" SHELL_CWD=$(pwd -P) popd # Start alacritty with the working directory - alacritty --working-directory $SHELL_CWD + WINIT_X11_SCALE_FACTOR=1.5 alacritty --working-directory $SHELL_CWD else - alacritty + WINIT_X11_SCALE_FACTOR=1.5 alacritty fi diff --git a/.scripts/secondmonitor.sh b/.scripts/secondmonitor.sh new file mode 100755 index 0000000..ca7fac6 --- /dev/null +++ b/.scripts/secondmonitor.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output HDMI-0 --dpi 120 --mode 1920x1080 --pos 0x0 --rotate normal --output eDP-1-1 --dpi 120 --primary --mode 1920x1080 --pos 1920x679 --rotate normal -- cgit v1.2.3