mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-03-31 00:17:46 +02:00
profile: added source for optional env variables
This commit is contained in:
parent
d0ef41d968
commit
c6b9ffcc69
20
.config/profile/local_profile
Normal file
20
.config/profile/local_profile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# relevant for: record_replay_start, record_start
|
||||||
|
export CAPTURE_INPUT_AUDIO="easyeffects_sink.monitor"
|
||||||
|
export CAPTURE_OUTPUT_AUDIO="easyeffects_source"
|
||||||
|
export CAPTURE_DIR="$HOME/downloads"
|
||||||
|
# relevant for: monitor
|
||||||
|
export EXTERNAL_MONITOR="HDMI2"
|
||||||
|
export INTERNAL_MONITOR="LVDS1"
|
||||||
|
# relevant for: textemp
|
||||||
|
export LATEX_TEMPLATE_DIR="~/code/main/latextemplates"
|
||||||
|
# relevant for: lmc
|
||||||
|
export LOOPBACK_DEVICE="PCM2902 Audio Codec Analog Stereo"
|
||||||
|
# relevant for: disk
|
||||||
|
export STATUSBAR_DISK="/home"
|
||||||
|
# relevant for: wallpaper
|
||||||
|
export WALLPAPER_DESKTOP="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
|
||||||
|
export WALLPAPER_LOCK="${XDG_DATA_HOME:-$HOME/.local/share}/lock"
|
||||||
|
# relevant for: screenshot
|
||||||
|
export SCREENSHOT_DIR="$HOME/downloads"
|
@ -1,14 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -z "$CAPTURE_INPUT_AUDIO" ] && audio_1="easyeffects_sink.monitor" || audio_1="$CAPTURE_INPUT_AUDIO"
|
||||||
|
[ -z "$CAPTURE_OUTPUT_AUDIO" ] && audio_2="easyeffects_source" || audio_2="$CAPTURE_OUTPUT_AUDIO"
|
||||||
|
[ -z "$CAPTURE_DIR" ] && output="$HOME/downloads" || output="$CAPTURE_DIR"
|
||||||
|
|
||||||
window=$(xdotool getwindowfocus)
|
window=$(xdotool getwindowfocus)
|
||||||
fps=60
|
fps=60
|
||||||
audio_1="easyeffects_sink.monitor"
|
|
||||||
audio_2="easyeffects_source"
|
|
||||||
format="mp4"
|
format="mp4"
|
||||||
v_codec="h264"
|
v_codec="h264"
|
||||||
a_codec="opus"
|
a_codec="opus"
|
||||||
lenght=20
|
lenght=20
|
||||||
output="$HOME/downloads"
|
|
||||||
|
|
||||||
gpu-screen-recorder -w $window -f $fps -a $audio_1 -a $audio_2 -c $format -k $v_codec -ac $a_codec -r $lenght -o $output &
|
gpu-screen-recorder -w $window -f $fps -a $audio_1 -a $audio_2 -c $format -k $v_codec -ac $a_codec -r $lenght -o $output &
|
||||||
notify-send -u low 'Screen record' 'Replay started'
|
notify-send -u low 'Screen record' 'Replay started'
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -z "$CAPTURE_INPUT_AUDIO" ] && audio_1="easyeffects_sink.monitor" || audio_1="$CAPTURE_INPUT_AUDIO"
|
||||||
|
[ -z "$CAPTURE_OUTPUT_AUDIO" ] && audio_2="easyeffects_source" || audio_2="$CAPTURE_OUTPUT_AUDIO"
|
||||||
|
[ -z "$CAPTURE_DIR" ] && output_dir="$HOME/downloads" || output_dir="$CAPTURE_DIR"
|
||||||
|
|
||||||
window=$(xdotool getwindowfocus)
|
window=$(xdotool getwindowfocus)
|
||||||
fps=30
|
fps=30
|
||||||
audio_1="$(pactl get-default-sink).monitor"
|
|
||||||
audio_2="$(pactl get-default-source)"
|
|
||||||
format="mp4"
|
format="mp4"
|
||||||
v_codec="h264"
|
v_codec="h264"
|
||||||
a_codec="opus"
|
a_codec="opus"
|
||||||
output="$HOME/downloads/recording-$(date '+%Y-%m-%d_%H-%M-%S').$format"
|
output="$output_dir/recording-$(date '+%Y-%m-%d_%H-%M-%S').$format"
|
||||||
|
|
||||||
gpu-screen-recorder -w $window -c $format -k $v_codec -ac $a_codec -f $fps -a $audio_1 -a $audio_2 -o $output &
|
gpu-screen-recorder -w $window -c $format -k $v_codec -ac $a_codec -f $fps -a $audio_1 -a $audio_2 -o $output &
|
||||||
notify-send -u low 'Screen record' 'Recording started'
|
notify-send -u low 'Screen record' 'Recording started'
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
# Status bar module for disk space
|
# Status bar module for disk space
|
||||||
# $1 should be drive mountpoint
|
# $1 should be drive mountpoint
|
||||||
|
|
||||||
disk="/home"
|
[ -z "$STATUSBAR_DISK" ] && disk="/home" || disk="$STATUSBAR_DISK"
|
||||||
|
|
||||||
[ ! -z "$1" ] && disk="$1"
|
[ ! -z "$1" ] && disk="$1"
|
||||||
|
|
||||||
icon="$disk"
|
icon="$disk"
|
||||||
|
@ -4,10 +4,11 @@
|
|||||||
# Based on a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
# Based on a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
||||||
# Heavily extended and updated to a pipewire system
|
# Heavily extended and updated to a pipewire system
|
||||||
|
|
||||||
Device="Audio Adapter (Unitek Y-247A) Mono"
|
[ -z "$LOOPBACK_DEVICE" ] && device="Easy Effects Source" || device="$LOOPBACK_DEVICE"
|
||||||
Name=$(wpctl status | grep "$Device")
|
|
||||||
Id=$( echo $Name | cut -d '.' -f 1 | cut -c 5-)
|
name=$(wpctl status | grep "$device")
|
||||||
Node=$(wpctl inspect $Id | grep node.name | cut -d '=' -f 2)
|
id=$( echo $name | cut -d '.' -f 1 | cut -c 5-)
|
||||||
|
node=$(wpctl inspect $id | grep node.name | cut -d '=' -f 2)
|
||||||
|
|
||||||
[ -z "$2" ] && num="5" || num="$2"
|
[ -z "$2" ] && num="5" || num="$2"
|
||||||
|
|
||||||
@ -59,10 +60,10 @@ case "$1" in
|
|||||||
loop) playerctl loop none
|
loop) playerctl loop none
|
||||||
sleep 1
|
sleep 1
|
||||||
pkill -RTMIN+9 $STATUSBAR ;;
|
pkill -RTMIN+9 $STATUSBAR ;;
|
||||||
tap) wpctl set-volume $Id 0.2
|
tap) wpctl set-volume $id 1.0
|
||||||
touch ~/.local/state/loopback.lock
|
touch ~/.local/state/loopback.lock
|
||||||
pw-loopback -C $Node &
|
pw-loopback -C $node &
|
||||||
notify-send -u low 'sxhkd' "Started loopback of $Device" ;;
|
notify-send -u low 'sxhkd' "Started loopback of $device" ;;
|
||||||
untap) killall pw-loopback
|
untap) killall pw-loopback
|
||||||
rm ~/.local/state/loopback.lock
|
rm ~/.local/state/loopback.lock
|
||||||
notify-send -u low 'sxhkd' "Stopped all loopbacks" ;;
|
notify-send -u low 'sxhkd' "Stopped all loopbacks" ;;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
# toggle external monitor
|
# toggle external monitor
|
||||||
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
||||||
|
|
||||||
intern=LVDS1
|
[ -z "$INTERNAL_MONITOR" ] && intern="LVDS1" || intern="$EXTERNAL_MONITOR"
|
||||||
extern=HDMI2
|
[ -z "$EXTERNAL_MONITOR" ] && extern="HDMI2" || extern="$INTERNAL_MONITOR"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
toggle) (xrandr | grep "$extern disconnected")
|
toggle) (xrandr | grep "$extern disconnected")
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
# Requires maim. It lets you choose the kind of screenshot to take,
|
# Requires maim. It lets you choose the kind of screenshot to take,
|
||||||
# including copying the image or even highlighting an area to copy.
|
# including copying the image or even highlighting an area to copy.
|
||||||
|
|
||||||
output="$HOME/downloads/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
|
[ -z "$SCREENSHOT_DIR" ] && output_dir="$HOME/downloads" || output_dir="$SCREENSHOT_DIR"
|
||||||
|
|
||||||
|
output="$output_dir/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png"
|
||||||
xclip_img="xclip -sel clip -t image/png"
|
xclip_img="xclip -sel clip -t image/png"
|
||||||
xclip_txt="xclip -sel clip -t text/plain"
|
xclip_txt="xclip -sel clip -t text/plain"
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# copying latex templates from my template repository
|
# copying latex templates from my template repository
|
||||||
# (not included in the dotfiles)
|
# (not included in the dotfiles)
|
||||||
|
|
||||||
latexdir=~/code/main/latextemplates
|
[ -z "$LATEX_TEMPLATE_DIR" ] && latexdir="~/code/main/latextemplates" || latexdir="$LATEX_TEMPLATE_DIR"
|
||||||
|
|
||||||
articletemp=${latexdir}/article/*
|
articletemp=${latexdir}/article/*
|
||||||
beamertemp=${latexdir}/beamer/*
|
beamertemp=${latexdir}/beamer/*
|
||||||
|
@ -2,20 +2,23 @@
|
|||||||
|
|
||||||
# Adapted from a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
# Adapted from a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
||||||
|
|
||||||
|
[ -z "$WALLPAPER_DESKTOP" ] && wall_desk="${XDG_DATA_HOME:-$HOME/.local/share}/bg" || disk="$WALLPAPER_DESKTOP"
|
||||||
|
[ -z "$WALLPAPER_LOCK" ] && wall_desk="${XDG_DATA_HOME:-$HOME/.local/share}/lock" || disk="$WALLPAPER_LOCK"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
desktop) bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
|
desktop) wall_desk="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
|
||||||
trueloc="$(readlink -f "$2")" &&
|
trueloc="$(readlink -f "$2")" &&
|
||||||
case "$(file --mime-type -b "$trueloc")" in
|
case "$(file --mime-type -b "$trueloc")" in
|
||||||
image/* ) ln -f "$(readlink -f "$2")" "$bgloc" && notify-send -i "$bgloc" "Desktop wallpaper has been changed." ;;
|
image/* ) ln -f "$(readlink -f "$2")" "$wall_desk" && notify-send -i "$wall_desk" "Desktop wallpaper has been changed." ;;
|
||||||
inode/directory ) ln -f "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random desktop wallpaper chosen." ;;
|
inode/directory ) ln -f "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$wall_desk" && notify-send -i "$wall_desk" "Random desktop wallpaper chosen." ;;
|
||||||
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
||||||
esac
|
esac
|
||||||
xwallpaper --zoom "$bgloc" ;;
|
xwallpaper --zoom "$wall_desk" ;;
|
||||||
lock) bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/lock"
|
lock) wall_lock="${XDG_DATA_HOME:-$HOME/.local/share}/lock"
|
||||||
trueloc="$(readlink -f "$2")" &&
|
trueloc="$(readlink -f "$2")" &&
|
||||||
case "$(file --mime-type -b "$trueloc")" in
|
case "$(file --mime-type -b "$trueloc")" in
|
||||||
image/* ) ln -f "$(readlink -f "$2")" "$bgloc" && notify-send -i "$bgloc" "Lock screen wallpaper has been changed." ;;
|
image/* ) ln -f "$(readlink -f "$2")" "$wall_lock" && notify-send -i "$wall_lock" "Lock screen wallpaper has been changed." ;;
|
||||||
inode/directory ) ln -f "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random lock screen wallpaper chosen." ;;
|
inode/directory ) ln -f "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$wall_lock" && notify-send -i "$wall_lock" "Random lock screen wallpaper chosen." ;;
|
||||||
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
||||||
esac ;;
|
esac ;;
|
||||||
*) cat << EOF
|
*) cat << EOF
|
||||||
|
3
.profile
3
.profile
@ -79,5 +79,8 @@ export LESS_TERMCAP_ue="$(printf '%b' '[0m')"; a="${a%_}"
|
|||||||
echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "${HOME}/.bashrc"
|
echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "${HOME}/.bashrc"
|
||||||
echo "$0" | grep "zsh$" >/dev/null && [ -f ${ZDOTDIR}/.zshrc ] && source "${ZDOTDIR}/.zshrc"
|
echo "$0" | grep "zsh$" >/dev/null && [ -f ${ZDOTDIR}/.zshrc ] && source "${ZDOTDIR}/.zshrc"
|
||||||
|
|
||||||
|
# load optional variables
|
||||||
|
[ -f ~/.config/profile/local_profile ] && source "${HOME}/.config/profile/local_profile"
|
||||||
|
|
||||||
# Start graphical server if not already running.
|
# Start graphical server if not already running.
|
||||||
[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx
|
[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x Xorg >/dev/null && exec startx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user