Merge branch 'main' of ssh://git.nmlk.se:222/wholteza/dotfiles

This commit is contained in:
2024-12-14 19:03:07 +01:00
6 changed files with 112 additions and 5 deletions

View File

@@ -158,9 +158,6 @@ alias edit-bash='nano ~/.bashrc && source ~/.bashrc'
alias edit-requirements='nano ~/.config/requirements/install.sh' alias edit-requirements='nano ~/.config/requirements/install.sh'
export PATH="/home/wholteza/.cargo/bin:$PATH" export PATH="/home/wholteza/.cargo/bin:$PATH"
export PATH="$HOME/.dotnet/tools:$PATH"
export PATH="$HOME/.dotnet:$PATH"
export DOTNET_ROOT="$HOME/.dotnet"
### Start oh my posh ### Start oh my posh
eval "$(oh-my-posh init bash --config '~/.config/oh-my-posh/theme.omp.json')" eval "$(oh-my-posh init bash --config '~/.config/oh-my-posh/theme.omp.json')"

View File

@@ -242,7 +242,7 @@ exec_always feh --bg-fill /$wallpaper_path
#exec_always compton -f --config /home/wholteza/.config/i3/compton #exec_always compton -f --config /home/wholteza/.config/i3/compton
#KEYBINDS #KEYBINDS
bindsym $mod+Shift+z exec i3lock bindsym $mod+Shift+z exec /home/wholteza/.config/i3/lock -b=0x8 -n
bindsym Control+Mod1+s exec /home/wholteza/.config/passmenu/passmenu bindsym Control+Mod1+s exec /home/wholteza/.config/passmenu/passmenu
bindsym $mod+Shift+p exec arandr bindsym $mod+Shift+p exec arandr
bindsym $mod+p exec /home/wholteza/.config/screenlayout/screenmenu.sh bindsym $mod+p exec /home/wholteza/.config/screenlayout/screenmenu.sh
@@ -250,7 +250,7 @@ bindsym --release Print exec scrot -s /home/wholteza/Screenshots/%Y-%m-%d-%T-scr
bindsym --release Control+Mod1+i exec scrot -s /home/wholteza/Screenshots/%Y-%m-%d-%T-screenshot.png bindsym --release Control+Mod1+i exec scrot -s /home/wholteza/Screenshots/%Y-%m-%d-%T-screenshot.png
# border / titlebar # border / titlebar
title_align center title_align center
default_border normal default_border none
# hide_edge_borders vertical # hide_edge_borders vertical
bindsym Control+Shift+x [class="^.*"] border toggle bindsym Control+Shift+x [class="^.*"] border toggle
for_window [class="plasma.emojier"] floating enable for_window [class="plasma.emojier"] floating enable

104
.config/i3/lock Executable file
View File

@@ -0,0 +1,104 @@
#!/bin/bash
# Defaults
DISPLAY_RE="([0-9]+)x([0-9]+)\\+([0-9]+)\\+([0-9]+)"
IMAGE_RE="([0-9]+)x([0-9]+)"
FOLDER="$(dirname "$(readlink -f "$0")")"
LOCK="$FOLDER/lock.png"
TEXT="$FOLDER/text.png"
PARAMS=""
OUTPUT_IMAGE="/tmp/i3lock.png"
DISPLAY_TEXT=true
PIXELATE=false
BLURTYPE="1x1"
# Read user input
POSITIONAL=()
for i in "$@"
do
case $i in
-h|--help)
echo "lock: Syntax: lock [-n|--no-text] [-p|--pixelate] [-b=VAL|--blur=VAL]"
echo "for correct blur values, read: http://www.imagemagick.org/Usage/blur/#blur_args"
exit
shift
;;
-b=*|--blur=*)
VAL="${i#*=}"
BLURTYPE=(${VAL//=/ })
shift
;;
-n|--no-text)
DISPLAY_TEXT=false
shift # past argument
;;
-p|--pixelate)
PIXELATE=true
shift # past argument
;;
*) # unknown option
echo "unknown option: $i"
exit
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
#Take screenshot:
scrot -z $OUTPUT_IMAGE
#Get dimensions of the lock image:
LOCK_IMAGE_INFO=`identify $LOCK`
[[ $LOCK_IMAGE_INFO =~ $IMAGE_RE ]]
IMAGE_WIDTH=${BASH_REMATCH[1]}
IMAGE_HEIGHT=${BASH_REMATCH[2]}
if $DISPLAY_TEXT ; then
#Get dimensions of the text image:
TEXT_IMAGE_INFO=`identify $TEXT`
[[ $TEXT_IMAGE_INFO =~ $IMAGE_RE ]]
TEXT_WIDTH=${BASH_REMATCH[1]}
TEXT_HEIGHT=${BASH_REMATCH[2]}
fi
#Execute xrandr to get information about the monitors:
while read LINE
do
#If we are reading the line that contains the position information:
if [[ $LINE =~ $DISPLAY_RE ]]; then
#Extract information and append some parameters to the ones that will be given to ImageMagick:
WIDTH=${BASH_REMATCH[1]}
HEIGHT=${BASH_REMATCH[2]}
X=${BASH_REMATCH[3]}
Y=${BASH_REMATCH[4]}
POS_X=$(($X+$WIDTH/2-$IMAGE_WIDTH/2))
POS_Y=$(($Y+$HEIGHT/2-$IMAGE_HEIGHT/2))
PARAMS="$PARAMS '$LOCK' '-geometry' '+$POS_X+$POS_Y' '-composite'"
if $DISPLAY_TEXT ; then
TEXT_X=$(($X+$WIDTH/2-$TEXT_WIDTH/2))
TEXT_Y=$(($Y+$HEIGHT/2-$TEXT_HEIGHT/2+200))
PARAMS="$PARAMS '$TEXT' '-geometry' '+$TEXT_X+$TEXT_Y' '-composite'"
fi
fi
done <<<"`xrandr`"
#Execute ImageMagick:
if $PIXELATE ; then
PARAMS="'$OUTPUT_IMAGE' '-scale' '10%' '-scale' '1000%' $PARAMS '$OUTPUT_IMAGE'"
else
PARAMS="'$OUTPUT_IMAGE' '-level' '0%,100%,0.6' '-blur' '$BLURTYPE' $PARAMS '$OUTPUT_IMAGE'"
fi
eval convert $PARAMS
#Lock the screen:
i3lock -i $OUTPUT_IMAGE -t
#Remove the generated image:
rm $OUTPUT_IMAGE

View File

@@ -57,6 +57,7 @@ sudo snap install code --classic
sudo snap install moonlight sudo snap install moonlight
sudo snap install heroic sudo snap install heroic
sudo snap install freecad sudo snap install freecad
sudo snap install thunderbird
# Dependencies for cargo # Dependencies for cargo
sudo snap install rustup --classic sudo snap install rustup --classic
@@ -66,6 +67,7 @@ rustup update
# Cargo packages # Cargo packages
## Alacritty needs to be installed with cargo to get the version that supports toml configurations ## Alacritty needs to be installed with cargo to get the version that supports toml configurations
cargo install alacritty cargo install alacritty
cargo install battop
curl -s https://ohmyposh.dev/install.sh | sudo bash -s curl -s https://ohmyposh.dev/install.sh | sudo bash -s
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

View File

@@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --primary --mode 1920x1080 --pos 793x1440 --rotate normal --output HDMI-1 --off --output DP-1 --off --output DP-2 --off --output DP-1-1 --off --output DP-1-1-8 --mode 2560x1440 --pos 473x0 --rotate normal --output DP-1-1-1 --off

View File

@@ -0,0 +1,2 @@
#!/bin/sh
xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x124 --rotate normal --output HDMI-1 --off --output DP-1 --off --output DP-2 --off --output DP-1-1 --off --output DP-1-1-8 --mode 2560x1440 --pos 4480x0 --rotate normal --output DP-1-1-1 --off --output DP-1-2 --off --output DP-1-2-8 --mode 2560x1440 --pos 1920x0 --rotate normal --output DP-1-2-1 --off --output DP-1-3 --off