Browse Source

Hevin screensaver on one monitor

ubuntu
Kevin Mok 1 week ago
parent
commit
f1ad855f23
  1. 22
      aliases/key_aliases.tmpl
  2. 14
      aliases/key_dirs.tmpl
  3. 2
      dot_config/fish/config.fish.tmpl
  4. 8
      dot_config/fish/functions/bc-qalc.fish
  5. 3
      dot_config/fish/functions/taskopen-new.fish
  6. 10
      dot_config/i3/config.tmpl
  7. 4
      dot_config/neofetch/config.conf
  8. 3
      dot_config/ranger/rc.conf.tmpl
  9. 1
      dot_config/ranger/rifle.conf
  10. 5
      dot_taskrc
  11. 127
      scripts/executable_dual-monitor-slideshow
  12. 3
      scripts/executable_kraken

22
aliases/key_aliases.tmpl

@ -357,7 +357,8 @@ am "antimicro"
# task [[[ #
a "task"
aa "task add proj:anp"
#aa "task add proj:anp"
aa "task add proj:sniper"
aan "task add"
aal "task add proj:lnx"
aap "task add proj:"
@ -371,7 +372,7 @@ aaj "task add proj:pey +jira []"
aapp "task add proj:pogo"
aas "task add proj:sch"
aay "task add proj:pey"
ac "task context"
acx "task context"
acn "task context none && task"
ach "task context home && task"
acm "task context mny && task"
@ -485,7 +486,7 @@ pipes "pipes.sh -t 3"
pcp "pycp"
pmv "pymv"
py "python"
q "qalc '"
#q "qalc '"
#qe "qalc -e '1USD to CAD'"
qg "qalculate-gtk"
r "ranger"
@ -938,8 +939,7 @@ mm "printf '\033c' && bear make clean move_mouse_with_head && ./move_mouse_with_
#med "printf '\033c' && bear make clean eye_detector && ./eye_detector"
mft "printf '\033c' && bear make clean face_detector && ./face_detector"
rft "~/coding/face-tracker/face_detector > /tmp/move_mouse_with_head.out"
# gpsb "git push bitbucket"
gpsb "git push bot"
gpsb "git push bitbucket"
# ]]] ada-mario #
@ -1047,6 +1047,8 @@ ttrtk "timetrace report -s 2023-04-20 -p totk"
cpsdv "cp * /home/kevin/Documents/stardew-valley-sdv-saves/hevintales"
rclh "rclone copy --progress hevin:/ ."
# ]]] games #
# work [[[ #
@ -1062,13 +1064,17 @@ ttle "timetrace start leetcode@job"
ts "npx tsc"
njs "node src/download-json.js"
xi "npx ts-node src/index.ts"
xs "npx ts-node src/sync.ts"
xi "npx ts-node src/index.ts 2>&1 | tee logs/index.log"
xd "npm run dev 2>&1 | tee logs/index.log"
xs "npx ts-node src/sync.ts 2>&1 | tee logs/sync.log"
xt "npm run type-check | tee logs/type-check.log"
#xsv "nodemon --exec node --loader ts-node/esm src/server.ts"
#xsv "npx nodemon"
xsv "nodemon --exec tsx src/server.ts"
#xsv "nodemon --exec tsx src/server.ts"
xsv "npx nodemon --exitcrash --exec tsx src/server.ts"
cl "npx ts-node src/cli.ts list-nfts -p 5 -t 100"
clw "watch npx ts-node src/cli.ts list-nfts -p 5 -t 100"
vp "vercel --prod"
# ]]] work #

14
aliases/key_dirs.tmpl

@ -282,12 +282,14 @@ anb ~/coding/ai-nft-proj/backend
anf ~/coding/ai-nft-proj/frontend
tt ~/coding/try-eliza-twitter-client
me ~/coding/me-sniper
mef ~/coding/me-sniper-fe
med ~/coding/me-sniper-discord
me2 ~/coding/me-sniper-2
mu ~/coding/stakemetrix
me ~/coding/me-sniper/backend
mef ~/coding/me-sniper/frontend
mefn ~/coding/me-sniper/frontend-next-js
med ~/coding/me-sniper/discord-bot
me2 ~/coding/me-sniper/backend-copy
kb ~/coding/kanban-calendar
ac ~/coding/astral-challenge-txt
# ]]] sch #

2
dot_config/fish/config.fish.tmpl

@ -203,6 +203,7 @@ abbr adr "task-due-rm"
abbr anx "task-next"
abbr anr "task-next-rm"
abbr ant "task-notes"
abbr aon "taskopen-new"
abbr apr "task-mod-pri"
abbr aprl "task-mod-pri L"
abbr aprm "task-mod-pri M"
@ -272,6 +273,7 @@ abbr mtm "maven-test-method"
abbr pgr "grep-pdf"
abbr pgrf "grep-pdf-file"
abbr pst "pastebin"
abbr q "bc-qalc '"
abbr qh "qalc-history"
abbr qu "qalc-update"
abbr re "reminder ''"

8
dot_config/fish/functions/bc-qalc.fish

@ -0,0 +1,8 @@
#function bc-qalc
#echo "scale=4; $argv[1]" | bc
#end
function bc-qalc
set -l expression "scale=4; $argv[1]"
set -l result (echo "$expression" | bc -l)
python3 -c "print(f'{float($result):,}')"
end

3
dot_config/fish/functions/taskopen-new.fish

@ -0,0 +1,3 @@
function taskopen-new
echo "md" | taskopen -A $argv[1] && taskopen -A $argv[1]
end

10
dot_config/i3/config.tmpl

@ -21,10 +21,9 @@ exec wal -i $(/home/kevin/scripts/shuffler "$HOME/Pictures/Backgrounds/dim/editi
# exec --no-startup-id i3-msg 'workspace $ws1; exec $term'
# exec --no-startup-id i3-msg 'workspace $ws2; exec $term -e fish -c "tmux-attach fortnite"'
exec --no-startup-id i3-msg 'workspace $ws3; exec $browser'
exec --no-startup-id i3-msg 'workspace $ws3; exec chrome'
# exec --no-startup-id i3-msg 'workspace $ws5; exec $term -e twitchy'
# exec --no-startup-id i3-msg 'workspace $ws5; exec firefox -P nft'
exec --no-startup-id i3-msg workspace $ws6; exec discord
#exec --no-startup-id i3-msg workspace $ws6; exec discord
#exec --no-startup-id i3-msg 'workspace $ws6; exec signal-desktop'
# exec --no-startup-id i3-msg workspace $ws1; exec $term -e fish -c 'tmux-attach school'
@ -33,11 +32,12 @@ exec --no-startup-id i3-msg workspace $ws6; exec discord
# applications [[[ #
set $mod Mod1
set $browser "firefox"
#set $browser "firefox"
set $browser "google-chrome"
#set $browser_secondary "chromium"
set $browser_secondary "google-chrome-stable"
#set $browser_secondary "google-chrome-stable"
# set $browser "chromium"
# set $browser_secondary "firefox"
set $browser_secondary "firefox"
set $scripts_path "/home/kevin/scripts"
set $sch_dir "$HOME/Documents/School"

4
dot_config/neofetch/config.conf

@ -336,8 +336,8 @@ public_ip_host="http://ident.me"
# disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)'
#
# disk_show=('/' '/home' '/mnt/linux-files' )
disk_show=('/dev/sdc1' '/dev/sdc3' '/dev/sdd1' )
disk_show=('/' '/home' '/mnt/linux-files-2' )
#disk_show=('/dev/sda1' '/dev/sdaf' '/dev/sdd1' )
# Disk subtitle.
# What to append to the Disk subtitle.

3
dot_config/ranger/rc.conf.tmpl

@ -713,4 +713,7 @@ default_linemode devicons
set clipboard_program xclip
map tsx set editor nvim
set editor nvim
# ]]] custom #

1
dot_config/ranger/rifle.conf

@ -110,6 +110,7 @@ ext pl = perl -- "$1"
ext rb = ruby -- "$1"
ext js = node -- "$1"
ext sh = sh -- "$1"
ext tsx = nvim "$@"
ext php = php -- "$1"
#--------------------------------------------

5
dot_taskrc

@ -81,8 +81,11 @@ context.out=project:out
context.mny=project:mny
context.pey=project:pey
context.sch=project:sch
#context.sniper=project:sniper project:job
context.sniper=(project:sniper or project:job)
context=none
#context=none
context=sniper
# context=home
# context=out
#context=sch

127
scripts/executable_dual-monitor-slideshow

@ -0,0 +1,127 @@
#!/usr/bin/env fish
# Find a random image
#set image (fdfind -e jpg -e jpeg -e png -e webp . /mnt/linux-files-2/Pictures/hevin | shuf -n 1)
## Create blurred lock image
#convert "$image" -resize 1920x1080^ -gravity center -extent 1920x1080 /tmp/lock.png
## Lock with i3lock-color
#i3lock -n -i /tmp/lock.png
# --------------------
#!/usr/bin/env fish
#set WALLPAPER_DIR "/mnt/linux-files-2/Pictures/hevin"
#set CYCLE_TIME 5 # Seconds between image changes
#set LOCK_AFTER 500 # Activate real lock after 30 seconds of screensaver
## Use a transparent window to cover everything
#while true
#set image (fdfind -e jpg -e jpeg -e png -e webp . $WALLPAPER_DIR | shuf -n 1)
## Create fullscreen image
#convert "$image" -resize (xrandr | grep '*' | head -1 | awk '{print $1}')^ \
#-gravity center -extent (xrandr | grep '*' | head -1 | awk '{print $1}') \
#/tmp/screensaver.png
## Display fullscreen using feh
#feh --fullscreen --hide-pointer --no-fehbg /tmp/screensaver.png &
#set feh_pid $last_pid
## Wait for timeout or mouse movement
#sleep $CYCLE_TIME
#kill $feh_pid
## After longer timeout, activate real lock
#if test (math $CYCLE_TIME \* $count) -ge $LOCK_AFTER
#i3lock -n -i /tmp/screensaver.png
#set count 0
#else
#set count (math $count + 1)
#end
#end
# --------------------
#!/usr/bin/env fish
# Configuration
set WALLPAPER_DIR "/mnt/linux-files-2/Pictures/hevin"
set CYCLE_TIME 2 # Seconds between image changes
#set BLUR_AMOUNT "0x5" # Set to "0x0" for no blur
set BLUR_AMOUNT "0x0" # Set to "0x0" for no blur
# Get monitor information - sanitize names by replacing hyphens with underscores
set monitors (xrandr --query | grep " connected" | awk '{print $1}' | string replace -a '-' '_')
set geometries (xrandr --query | grep -A1 " connected" | grep -v " connected" | awk '{print $1}')
# Verify we found monitors
if test (count $monitors) -eq 0
echo "Error: No monitors detected!"
exit 1
end
# Create monitor geometry mapping
set -g monitor_geometries
for i in (seq (count $monitors))
set monitor $monitors[$i]
set geo $geometries[$i]
if test -z "$geo"
echo "Warning: Could not get geometry for monitor $monitor, using default 1920x1080"
set geo "1920x1080"
end
set monitor_geometries $monitor_geometries "$monitor:$geo"
end
while true
# Use only the first monitor's geometry
set entry $monitor_geometries[1]
set monitor (echo $entry | cut -d':' -f1)
set geo (echo $entry | cut -d':' -f2)
set width (echo $geo | cut -d'x' -f1)
set height (echo $geo | cut -d'x' -f2)
# Select and process image
set image (fdfind -e jpg -e jpeg -e png -e webp . $WALLPAPER_DIR | shuf -n 1)
if test -n "$image"
echo "Found image: $image"
# Get image dimensions
set img_info (identify -format "%wx%h" "$image")
set img_width (echo $img_info | cut -d'x' -f1)
set img_height (echo $img_info | cut -d'x' -f2)
# Process image based on orientation
if test $img_height -gt $img_width
# Vertical image - fit to height with black background
convert "$image" \
-resize x{$height}^ \
-gravity center \
-background black \
-extent {$width}x{$height} \
-blur $BLUR_AMOUNT \
"/tmp/screensaver-$monitor.png"
else
# Horizontal image - fit to width
convert "$image" \
-resize {$width}x^ \
-gravity center \
-extent {$width}x{$height} \
-blur $BLUR_AMOUNT \
"/tmp/screensaver-$monitor.png"
end
# Display image on single monitor
feh --no-fehbg --hide-pointer --fullscreen --title 'screensaver' "/tmp/screensaver-$monitor.png" &
set feh_pid $last_pid
# Wait for cycle time
sleep $CYCLE_TIME
# Kill feh process
kill $feh_pid 2>/dev/null
else
echo "Error: No images found in $WALLPAPER_DIR"
exit 1
end
end

3
scripts/executable_kraken

@ -32,7 +32,8 @@ elif (( $(echo "$price < 100" | bc -l) )); then
echo "$price" | tr -d '.' | awk '{print substr($0, 1, 3)}'
elif (( $(echo "$price < 1000" | bc -l) )); then
echo "$price" | numfmt --grouping | cut -c -3
#elif (( $(echo "$price < 10000" | bc -l) )); then
elif (( $(echo "$price < 10000" | bc -l) )); then
echo "$price" | numfmt --grouping | cut -c -4
elif (( $(echo "$price < 100000" | bc -l) )); then
echo "$price" | cut -c -3
elif (( $(echo "$price > 100000" | bc -l) )); then

Loading…
Cancel
Save