Compare commits
5 Commits
1d767b3377
...
1196d79423
Author | SHA1 | Date |
---|---|---|
randomuser | 1196d79423 | |
randomuser | 08e6b7a16c | |
randomuser | ad572313d0 | |
randomuser | 7bde5419e0 | |
randomuser | 8e58e2cd77 |
1
Makefile
1
Makefile
|
@ -34,6 +34,7 @@ sh:
|
|||
cp -f sh/machine $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f sh/brightness $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f sh/git-credential-gitpass $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f sh/capture $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
check:
|
||||
shellcheck sh/*
|
||||
|
|
3
TODO
3
TODO
|
@ -1,8 +1,5 @@
|
|||
TODO LIST
|
||||
---------
|
||||
|
||||
- change statusbar program so it uses static allocations instead of dynamic ones
|
||||
- fix paste
|
||||
- make the c programs less buggy and let them not suck as much
|
||||
- add manpage for trss
|
||||
- add option to *force* syncing
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
#!/bin/sh
|
||||
|
||||
# get screen info and temporary file
|
||||
tmp=$(mktemp)
|
||||
res=$(xrandr |
|
||||
grep ' connected' |
|
||||
awk -F' ' '{print $1 " " $4}' |
|
||||
awk -F'+' '{print $1}' |
|
||||
fzy |
|
||||
awk -F' ' '{print $2}' )
|
||||
|
||||
# still or motion
|
||||
medium=$(printf ".mp4\n.png\n" | fzy)
|
||||
output="$tmp$medium"
|
||||
|
||||
# capture
|
||||
case "$medium" in
|
||||
*mp4*)
|
||||
printf "> starting video capture...\n"
|
||||
ffmpeg -video_size "$res" -f x11grab -framerate 60 -i $DISPLAY -preset ultrafast -pix_fmt yuv420p "$output"
|
||||
;;
|
||||
*png*)
|
||||
printf "> taking screenshot...\n"
|
||||
# for a screenshot, we usually want an a s t h e t i c
|
||||
ffmpeg -f x11grab -video_size "$res" -i $DISPLAY -vframes 1 "$output" -loglevel quiet # be quiet
|
||||
;;
|
||||
*)
|
||||
printf "not a choice\n"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
# what to do with the capture?
|
||||
printf "> written to %s\n" "$output"
|
||||
while true; do
|
||||
result=$(printf "delete\nmove to home directory\nupload to pastebin\nreview footage\nquit\n" | fzy --prompt="what next? ")
|
||||
case "$result" in
|
||||
*upload*)
|
||||
paste "$output" | xclip -i
|
||||
printf "> pasted! check your clipboard\n"
|
||||
;;
|
||||
*review*)
|
||||
[ "$medium" = ".mp4" ] && mpv "$output" && continue
|
||||
feh "$output"
|
||||
;;
|
||||
*delete*)
|
||||
printf "> removing target file...\n"
|
||||
rm "$output"
|
||||
exit 1
|
||||
;;
|
||||
*home*)
|
||||
printf "> warping your capture to home...\n"
|
||||
name=$(echo "capture$medium" | fzy --prompt="name please? ")
|
||||
mv "$output" "$HOME/$name"
|
||||
exit 1
|
||||
;;
|
||||
*quit*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
9
sh/disp
9
sh/disp
|
@ -15,4 +15,13 @@ if [ "$(exists "HDMI-2")" -eq 1 ] && [ "$(exists "LVDS-1")" -eq 1 ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(exists "HDMI-1")" -eq 1 ] && [ "$(exists "LVDS-1")" -eq 1 ]; then
|
||||
printf "two"
|
||||
xrandr --output HDMI-1 --right-of LVDS-1 --auto
|
||||
xrandr --output VGA-1 --off --auto
|
||||
bspc monitor LVDS-1 -d 1 2 3 4 5 6 7 8 9
|
||||
bspc monitor HDMI-1 -d 1 2 3 4 5 6 7 8 9
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# default configuration's fine
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
# wrapper script to make firefox suck less
|
||||
|
||||
RHOME="${HOME}"
|
||||
|
||||
firefox_data_location="$HOME/firefoxdumpster"
|
||||
[ -z "$3" ] || url="$3"
|
||||
|
||||
# start a profile chooser
|
||||
if [ -z "$2" ]; then
|
||||
profile=$(printf "programming\nschool\ntmp-school\ntmp\nchromium\n" | tmenu)
|
||||
else
|
||||
profile="$2"
|
||||
fi
|
||||
|
||||
[ -z "$profile" ] && exit
|
||||
|
||||
if [ "$profile" = "tmp" ]; then
|
||||
# firefox doesn't start in a directory within /tmp
|
||||
# so we create one in $HOME/.cache
|
||||
|
||||
tmp=$(basename $(mktemp))
|
||||
mkdir -p "${RHOME}/.cache/${tmp}"
|
||||
rm -r "/tmp/$tmp"
|
||||
HOME="/home/$(whoami)/.local/share/firefox" firefox --profile "${RHOME}/.cache/${tmp}" --no-remote "$url"
|
||||
rm -r "${RHOME}/.cache/${tmp}"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$profile" = "chromium" ]; then
|
||||
HOME="/home/$(whoami)/.local/share/firefox" chromium
|
||||
exit
|
||||
fi
|
||||
|
||||
# start firefox
|
||||
mkdir -p "${firefox_data_location}/profile"
|
||||
HOME="/home/$(whoami)/.local/share/firefox" firefox --profile "${firefox_data_location}/${profile}" --no-remote "$url"
|
||||
exit
|
||||
|
||||
printf "failed to specify a profile. exiting.\n"
|
||||
exit 1
|
|
@ -11,19 +11,19 @@ mod_bspwm () {
|
|||
current_desk=$(bspc query -D -d .focused --names)
|
||||
final_string=""
|
||||
current_printed=0
|
||||
cur_char='>'
|
||||
|
||||
for i in $used_desk; do
|
||||
[ "$i" = "$current_desk" ] && \
|
||||
final_string=${final_string}"*$i " && \
|
||||
final_string=${final_string}"$cur_char$i " && \
|
||||
current_printed=1 || \
|
||||
final_string=${final_string}"$i "
|
||||
done
|
||||
|
||||
[ $current_printed -eq 0 ] &&
|
||||
final_string=${final_string}"*$current_desk "
|
||||
final_string=${final_string}"$cur_char$current_desk "
|
||||
|
||||
printf "%s" "$final_string"
|
||||
set +x
|
||||
}
|
||||
|
||||
mod_period () {
|
||||
|
|
Loading…
Reference in New Issue