mirror of
				https://git.davidovski.xyz/dot.git
				synced 2024-08-15 00:43:28 +00:00 
			
		
		
		
	Add desktop background
This commit is contained in:
		
							parent
							
								
									051ed527f6
								
							
						
					
					
						commit
						02a4a3a4c1
					
				
					 21 changed files with 65 additions and 47 deletions
				
			
		|  | @ -1,4 +1,8 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| feh --bg-fill ~/.config/bg.png | ||||
| exit | ||||
| 
 | ||||
| setbg="feh --force-aliasing --bg-tile " | ||||
| 
 | ||||
| image=~/.config/bg.gif | ||||
|  |  | |||
|  | @ -1,2 +1,2 @@ | |||
| #!/bin/sh | ||||
| bspc rule -a \* -o state=floating && $TERMINAL -e bc -liq | ||||
| bspc rule -a \* -o state=floating && $TERMINAL -e bc -l | ||||
|  |  | |||
							
								
								
									
										2
									
								
								scripts/calendar
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										2
									
								
								scripts/calendar
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,2 @@ | |||
| #!/bin/sh | ||||
| bspc rule -a \* -o state=floating && $TERMINAL -e sh -c "cal $(date +%Y); read" | ||||
|  | @ -1,3 +1,3 @@ | |||
| #!/bin/sh | ||||
| MAIN_DP=DP-1;   | ||||
| MAIN_DP=$($HOME/.scripts/primary-display.sh);   | ||||
| v=$(xrandr --current --verbose | grep "Brightness" | cut -f2 -d " " | tr '\n' '*' | rev | cut -c 2- | rev | sed -e "s/$/==1/" | bc -l | grep -q 0 && echo 1 || echo 0); xrandr | grep " connected" | cut -f1 -d " " | while read -r line; do echo $line | grep -q $MAIN_DP && : || xrandr --output $line --brightness $v; done | ||||
|  |  | |||
|  | @ -15,5 +15,5 @@ case $1 in | |||
|       ;; | ||||
| esac | ||||
| 
 | ||||
| ddcutil --bus=13 setvcp 60 ${OUT[0]} & | ||||
| ddcutil --bus=12 setvcp 60 ${OUT[0]} & | ||||
| wait | ||||
|  |  | |||
|  | @ -1,10 +1,10 @@ | |||
| #!/bin/bash | ||||
| MAIN_DP=eDP1;   | ||||
| MAIN_DP=$($HOME/.scripts/primary-display.sh);   | ||||
| 
 | ||||
| v=$1 | ||||
| 
 | ||||
| if [ $# -ne 0 ]; then | ||||
| 	xrandr --output $MAIN_DP --gamma $(paste -d" " <(xrandr | grep " connected" | cut -f1 -d " ") <(xrandr --current --verbose | grep "Gamma" | cut -f7 -d" " | cut -f1 -d":" | xargs -I % echo "1/%") | grep $MAIN_DP | cut -d" " -f2 | xargs -I % echo "%*$v" | bc -l) | ||||
| else | ||||
| 	xrandr --output $MAIN_DP --gamma 1 | ||||
| 	xrandr --output $MAIN_DP --gamma 1.1 | ||||
| fi | ||||
|  |  | |||
|  | @ -1,3 +1,3 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| printf "%s\n" "pm-suspend" "pm-hibernate" "reboot" "poweroff" | rofi -dmenu -p "power" | xargs -r  | ||||
| printf "pm-suspend reboot poweroff" | rofi -dmenu -p "power" | xargs -r  | ||||
|  |  | |||
							
								
								
									
										3
									
								
								scripts/primary-display.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								scripts/primary-display.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,3 @@ | |||
| #!/bin/sh | ||||
| xrandr | awk '/ primary / {print $1}' | ||||
| 
 | ||||
|  | @ -9,13 +9,11 @@ width=$(cat $info | grep Width | cut -d' ' -f4) | |||
| height=$(cat $info | grep Height | cut -d' ' -f4) | ||||
| 
 | ||||
| size="${width}x${height}" | ||||
| x=$(cat $info | grep "Absolute upper-left X" | cut -d' ' -f7) | ||||
| y=$(cat $info | grep "Absolute upper-left Y" | cut -d' ' -f7) | ||||
| position="+$x,$y" | ||||
| position=+$(echo $geom | cut -d'+' -f2- | sed "s/+/,/g") | ||||
| 
 | ||||
| filename=$(date +"%F_%T.mp4") | ||||
| filename=$(date +"$HOME/pics/screenshot/%F_%T.mp4") | ||||
| 
 | ||||
| echo $size and $position | ||||
| ffmpeg -y -f x11grab -video_size $size -i "$position" $filename | ||||
| ffmpeg -y -f x11grab -video_size $size -i $position $filename | ||||
| 
 | ||||
| rm $info | ||||
|  |  | |||
|  | @ -22,11 +22,12 @@ tablet_ratio = (lambda s: float(s[0]) / float(s[1]))(sys.argv[4].split(":")) if | |||
| 
 | ||||
| screens = [ | ||||
| 	(0, 0, 1920, 1080), | ||||
| 	(1920, 0, 2560, 1440), | ||||
| ] | ||||
| 
 | ||||
| #TODO find this with xrandr | ||||
| 
 | ||||
| target = screens[0] | ||||
| target = screens[1] | ||||
| 
 | ||||
| #Physical offset of the selected screen | ||||
| offsetx = target[0] | ||||
|  | @ -34,7 +35,7 @@ offsety = target[1] | |||
| 
 | ||||
| #Size of the full screen areas | ||||
| sh = 1080 | ||||
| sw = 1920 | ||||
| sw = 1920 + 2560 | ||||
| #TODO calculate using list of screens | ||||
| 
 | ||||
| #Aspect ratio of the tablet, to avoid weird scaling problems | ||||
|  |  | |||
							
								
								
									
										4
									
								
								scripts/toggle-mute.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										4
									
								
								scripts/toggle-mute.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| #!/bin/sh | ||||
| # | ||||
| pactl list sources | grep -qi 'Mute: yes' && pactl set-source-mute 0 false || pactl set-source-mute 0 true | ||||
| 
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue