New install time

This commit is contained in:
Thomas Muller 2023-12-20 22:52:16 -05:00
parent 96d450c77a
commit ccb9b5b91c
22 changed files with 1137 additions and 0 deletions

6
.config/.gitignore vendored
View file

@ -10,3 +10,9 @@
# fish
!fish/
!fish/**
!i3/
!i3/**
!polybar/
!polybar/**

View file

@ -0,0 +1,4 @@
function rebar --wraps='spawn .local/polybar/launch.sh' --description 'alias rebar=spawn .local/polybar/launch.sh'
spawn .local/polybar/launch.sh $argv
end

231
.config/i3/config Normal file
View file

@ -0,0 +1,231 @@
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
font pango:mono 10
# i3status bar
# bar {
# id bar-1
# font pango:mono, pango:Font Awesome 5 Free 10
# font xft:monospace 10
# status_command i3blocks
# position top
# mode dock
# modifier none
# }
# Start on boot shit
exec --no-startup-id xcompmgr
exec --no-startup-id sxhkd
exec --no-startup-id dunst
exec --no-startup-id gnome-keyring-daemon
exec --no-startup-id lxqt-policykit-agent
exec_always keepassxc
exec_always --no-startup-id $HOME/.local/bin/polybar_launch
for_window [class="^.*"] border pixel 2
gaps inner 10
# gaps outer 5
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
# bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec st
#bindsym $mod+Shift+Return exec --no-startup-id i3-sensible-terminal -c term_floating
bindsym $mod+Shift+Return exec --no-startup-id st -c term_floating
# bindsym $mod+p exec --no-startup-id i3-sensible-terminal -c term_floating -e python
bindsym $mod+p exec --no-startup-id st -c term_floating -e python
bindsym $mod+q exec --no-startup-id st -c term_floating -e qalc
# bindsym $mod+Shift+r exec --no-startup-id i3-sensible-terminal -c term_floating -e bash record
bindsym $mod+Shift+r exec --no-startup-id st -c term_floating -e bash record
for_window [class=term_floating] floating enable
# kill focused window
bindsym $mod+Shift+q kill
# xkill
bindsym $mod+Ctrl+q --release exec --no-startup-id xkill -display $DISPLAY
# Lock the screen
#bindsym $mod+Ctrl+l exec i3lock -i $HOME/.config/lock.png
# Discord
# bindsym $mod+d exec discord
# Firefox
bindsym $mod+f exec firefox
bindsym $mod+Shift+f exec firefox --private-window
# arandr
# bindsym $mod+p exec arandr
# Screenshots
bindsym Print --release exec "scrot -f -s -F /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
bindsym Shift+Print exec "scrot -F /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
# OpenPeripherals
for_window [title="OpenPeripherals"] floating enable
# R
for_window [class="R_x11"] floating enable
# Soundboard
bindsym $mod+v exec "soundboard"
# start dmenu (a program launcher)
bindsym $mod+r exec dmenu_run
bindsym $mod+Ctrl+r exec --no-startup-id i3-dmenu-desktop
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
#bindsym $mod+Left focus left
#bindsym $mod+Down focus down
#bindsym $mod+Up focus up
#bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
bindsym $mod+Ctrl+h move workspace to output left
bindsym $mod+Ctrl+l move workspace to output right
# alternatively, you can use the cursor keys:
#bindsym $mod+Shift+Left move left
#bindsym $mod+Shift+Down move down
#bindsym $mod+Shift+Up move up
#bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+backslash split h
# split in vertical orientation
bindsym $mod+slash split v
# enter fullscreen mode for the focused container
bindsym $mod+space fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
# bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
mouse_warping output
focus_follows_mouse no
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+minus sticky toggle
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+mod1+c restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
#bindsym Left resize shrink width 10 px or 10 ppt
#bindsym Down resize grow height 10 px or 10 ppt
#bindsym Up resize shrink height 10 px or 10 ppt
#bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+Shift+r mode "default"
}
# bindsym $mod+Shift+r mode "resize"

411
.config/polybar/config Normal file
View file

@ -0,0 +1,411 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
;background = ${xrdb:color0:#222}
background = #111
background-alt = #888
;foreground = ${xrdb:color7:#222}
foreground = #dfdfdf
foreground-alt = #555
primary = #ffb52a
secondary = #e60053
alert = #bd2c40
[bar/qbar]
monitor = ${env:MONITOR:HDMI-1}
width = 100%
height = 23
;offset-x = 1%
;offset-y = 1%
radius = 0.0
fixed-center = true
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 0
border-color = #00000000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = sans:pixelsize=10;1
font-1 = inconsolata:fontformat=truetype:size=8:antialias=false;0
font-2 = SymbolsNerdFont:pixelsize=12;1
modules-left = i3
modules-center =
modules-right = filesystem pulseaudio memory cpu wlan eth date
tray-position = right
tray-padding = 2
;tray-background = #0063ff
;wm-restack = bspwm
;wm-restack = i3
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
#[module/github]
#type = internal/github
#token = b20dfb56d6f6222331fb7b7ef5a69b668accde58
#empty-notifications = true
#interval = 10
#format = <label>
#label = GH: %notifications%
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /home
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
label-occupied = %index%
label-occupied-padding = 2
label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2
; Separator in between workspaces
; label-separator = |
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = 玲
icon-stop = 栗
icon-play = 契
icon-pause = 
icon-next = 怜
label-song-maxlen = 50
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = BL
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #fff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9f78e1
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #f90000
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #4bffdc
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlp1s0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = %essid% - %local_ip%
#format-disconnected =
format-disconnected = <label-disconnected>
format-disconnected-underline = ${self.format-connected-underline}
label-disconnected = 睊 %ifname%
label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 睊
ramp-signal-1 = 直
ramp-signal-2 = 直
ramp-signal-3 = 直
ramp-signal-4 = 直
ramp-signal-foreground = ${colors.foreground-alt}
[module/eth]
type = internal/network
interface = enp4s0
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
# format-disconnected =
format-disconnected = <label-disconnected>
format-disconnected-underline = ${self.format-connected-underline}
label-disconnected =  %ifname%
label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 5
date =
date-alt = " %Y-%m-%d"
time = %H:%M
time-alt = %H:%M:%S
format-prefix = 
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #0a6cf5
label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <ramp-volume> <label-volume>
format-prefix-foreground = ${colors.foreground-alt}
label-volume = %percentage%%
label-volume-foreground = ${root.foreground}
label-muted = ﱝ
label-muted-foreground = ${colors.foreground-alt}
ramp-volume-0 = 奄
ramp-volume-1 = 奔
ramp-volume-2 = 墳
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT1
adapter = ACAD
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
#animation-discharging-0 = 
#animation-discharging-1 = 
#animation-discharging-2 = 
#animation-discharging-foreground = ${colors.foreground-alt}
#animation-discharging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = #f50a4d
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = false
format-spacing = 1
label-open = 
label-open-foreground = ${colors.secondary}
label-close = 
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 0
margin-bottom = 0
; vim:ft=dosini

12
.gitconfig Normal file
View file

@ -0,0 +1,12 @@
[user]
email = thomasmuller336@gmail.com
name = Quantum
signingkey = A73D1943BE953A78FAB16D38AF006EB730564952
[commit]
gpgSign = false
[init]
defaultBranch = master
[color]
ui = auto
[http]
sslVerify = false

6
.gitignore vendored
View file

@ -3,10 +3,16 @@
# This file
!.gitignore
.gitconfig
# .config folder
!.config/
!.config/**
# .local folder
!.local/
!.local/**
# Bash
!.bashrc
!.bash_profile

7
.local/.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
*
# This file
!.gitignore
!bin/
!bin/**

4
.local/bin/backlight Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
prev=$(xbacklight -get)
xbacklight -steps 100 -time 200 $(($prev + $1))

18
.local/bin/colortest Executable file
View file

@ -0,0 +1,18 @@
echo $(tput setaf 0) COLOR 0
echo $(tput setaf 1) COLOR 1
echo $(tput setaf 2) COLOR 2
echo $(tput setaf 3) COLOR 3
echo $(tput setaf 4) COLOR 4
echo $(tput setaf 5) COLOR 5
echo $(tput setaf 6) COLOR 6
echo $(tput setaf 7) COLOR 7
echo $(tput setaf 8) COLOR 8
echo $(tput setaf 9) COLOR 9
echo $(tput setaf 10) COLOR 1
echo $(tput setaf 11) COLOR 11
echo $(tput setaf 12) COLOR 12
echo $(tput setaf 13) COLOR 13
echo $(tput setaf 14) COLOR 14
echo $(tput setaf 15) COLOR 15
echo $(tput setaf 16) COLOR 16

11
.local/bin/csaccept Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
while true
do
xdotool mousemove 3200 600
xdotool click 1
sleep 1
xdotool mousemove 3200 610
xdotool click 1
sleep 1
done

12
.local/bin/invitespam Executable file
View file

@ -0,0 +1,12 @@
X=20
Y=130
SLEEP=0.1
while true; do
xdotool click 3;
sleep $SLEEP;
xdotool mousemove_relative $X $Y;
sleep $SLEEP;
xdotool click 1;
xdotool mousemove_relative -- -$X -$Y;
done;

14
.local/bin/polybar_launch Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar > /dev/null; do sleep 1; done
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar qbar &
done
else
polybar --reload qbar &
fi

4
.local/bin/reloadi3bar Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
killall i3bar
i3bar --bar_id=bar-1

21
.local/bin/resetusb Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
if [[ $EUID != 0 ]] ; then
echo This must be run as root!
exit 1
fi
for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
if ! cd $xhci ; then
echo Weird error. Failed to change directory to $xhci
exit 1
fi
echo Resetting devices from $xhci...
for i in ????:??:??.? ; do
echo -n "$i" > unbind
echo -n "$i" > bind
done
done

7
.local/bin/send_gpg Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
gpg --keyserver keyserver.ubuntu.com --send-keys $1
gpg --keyserver keys.gnupg.net --send-keys $1
gpg --keyserver pgp.mit.edu --send-keys $1
gpg --keyserver hkp://pgp.key-server.io:11371 --send-keys $1

141
.local/bin/share Executable file
View file

@ -0,0 +1,141 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# Variables
FPS=15
DEVICE_NUMBER=50
MONITOR_NUMBER=
FFMPEG_OPTIONS=
BORDER=false
# Options
while [ ! $# -eq 0 ]
do
case "$1" in
-h | --help)
echo "$0 - Monitor to Camera"
echo ""
echo "$0 [options] [value]"
echo ""
echo "options:"
echo "-h, --help show help"
echo "-f, --framerate=FPS set framerate"
echo "-d, --device-number=NUM set device number"
echo "-m, --monitor-number=NUM set monitor number"
echo "-r, --resolution H:W manually set output resolution"
echo "-vf, --vertical-flip vertically flip the monitor capture"
echo "-hf, --horizontal-flip horizontally flip the monitor capture"
echo "-b, --border add border when scaling to avoid stretching"
exit
;;
-f | --framerate)
FPS=$2
;;
-d | --device-number)
DEVICE_NUMBER=$2
;;
c | center)
MONITOR_NUMBER=0
;;
l | left)
MONITOR_NUMBER=1
;;
r | right)
MONITOR_NUMBER=2
;;
s | stop)
eval "pkill ffmpeg"
exit 0
;;
-m | --monitor-number)
MONITOR_NUMBER=$2
;;
-r | --resolution)
FFMPEG_OPTIONS+="-vf scale=$2"
;;
-vf | --vertical-flip)
FFMPEG_OPTIONS+="-vf vflip"
;;
-hf | --horizontal-flip)
FFMPEG_OPTIONS+="-vf hflip"
;;
-b | --border)
BORDER=true
;;
esac
shift
done
# Dependency checking
XRANDR=$(command -v xrandr)
if ! [ -x "$XRANDR" ]
then
echo "Error: xrandr is not installed."
exit 1
fi
FFMPEG=$(command -v ffmpeg)
if ! [ -x "$FFMPEG" ]
then
echo "Error: ffmpeg is not installed."
exit 1
fi
# Reload v4l2loopback if device doesn't exist
#if ! [ -f /dev/video"$DEVICE_NUMBER" ]
#then
# # Unload v4l2loopback module
# if ! $(sudo modprobe -r v4l2loopback &> /dev/null)
# then
# echo "Unable to unload v4l2loopback, Close any programs using virtual video devices and try again"
# exit 1
# fi
# Load v4lwloopback module
# sudo modprobe v4l2loopback video_nr="$DEVICE_NUMBER" 'card_label=Mon2Cam'
#fi
# Option checking
if [ "$BORDER" = true ]
then
if [ -z "$RESOLUTION" ]
then
echo "You didn't specify a resolution (-r 1920:1080)"
exit 1
fi
RES_WIDTH=$(echo "${RESOLUTION}" | cut -f2 -d'=' | cut -f1 -d':');
RES_HEIGHT=$(echo "${RESOLUTION}" | cut -f2 -d':');
RESOLUTION="${RESOLUTION}:force_original_aspect_ratio=decrease,pad=$RES_WIDTH:$RES_HEIGHT:x=($RES_WIDTH-iw)/2:y=($RES_HEIGHT-ih)/2"
fi
# Pick monitor
if [ -z "$MONITOR_NUMBER" ]
then
$XRANDR --listactivemonitors
read -r -p "Which monitor: " MONITOR_NUMBER
fi
# Monitor information
MONITOR_INFO=$(xrandr --listactivemonitors | grep "$MONITOR_NUMBER:" | cut -f4 -d' ')
MONITOR_HEIGHT=$(echo "$MONITOR_INFO" | cut -f2 -d'/' | cut -f2 -d'x')
MONITOR_WIDTH=$(echo "$MONITOR_INFO" | cut -f1 -d'/')
MONITOR_X=$(echo "$MONITOR_INFO" | cut -f2 -d'+')
MONITOR_Y=$(echo "$MONITOR_INFO" | cut -f3 -d'+')
# Use x11grab to stream screen into v4l2loopback device
echo "CTRL + C to stop"
echo "Your screen will look mirrored for you, not others"
$FFMPEG \
-f x11grab \
-r "$FPS" \
-s "$MONITOR_WIDTH"x"$MONITOR_HEIGHT" \
-i "$DISPLAY"+"$MONITOR_X","$MONITOR_Y" \
$FFMPEG_OPTIONS \
-pix_fmt yuv420p \
-f v4l2 \
-s 1920x1080 \
/dev/video"$DEVICE_NUMBER" &> /dev/null

48
.local/bin/silverspray Executable file
View file

@ -0,0 +1,48 @@
#!/usr/bin/env python3
import time
import random
from pynput.mouse import Listener
from pynput.keyboard import Controller
kbd = Controller()
def down(key):
kbd.press(key)
def up(key):
kbd.release(key)
go = False
offtime = 0
def on_click(x, y, b, p):
global go
print(x, y, b, p)
go = p
listener = Listener(on_click=on_click)
listener.start()
actuallygo = True
while True:
if go:
actuallygo = True
offtime = time.time()
if not actuallygo:
continue
if time.time() > offtime + 0.5 + (random.randint(1, 10) / 10):
actuallygo = False
if random.randint(0, 1) == 1:
key = 'a'
else:
key = 'd'
down(key)
time.sleep(random.randint(1, 10) / 40 + 0.01)
up(key)
#time.sleep(random.randint(1, 10) / 20 + 0.1)

15
.local/bin/soundboard Executable file
View file

@ -0,0 +1,15 @@
function cleanup() {
pactl unload-module module-pipe-source
pactl unload-module module-loopback
}
trap cleanup INT
pactl load-module module-pipe-source source_name=virtmic file=/tmp/virtmic format=s16le rate=48000 channels=2
pactl set-default-source virtmic
pactl load-module module-loopback
CLIP=$(ls $HOME/.config/soundboard | dmenu -l 100)
ffmpeg -re -i "$HOME/.config/soundboard/$CLIP" -f s16le -ar 48000 -ac 2 - > /tmp/virtmic
cleanup

1
.local/bin/spam Executable file
View file

@ -0,0 +1 @@
while true; do xdotool type --delay $2 "$1"; xdotool key Return; done

24
.local/bin/tablet Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
PAD="Wacom Intuos PT S Pad pad"
PEN="Wacom Intuos PT S Pen stylus"
ERASER="Wacom Intuous PT S Pen eraser"
FINGER="Wacom Intuous PT S Finger touch"
xsetwacom set "$PAD" button 3 "key shift"
xsetwacom set "$PAD" button 1 "key control"
xsetwacom set "$PAD" button 9 "key ;"
xsetwacom set "$PAD" button 8 "key '"
# xsetwacom set "$PEN" button 1 "key "
xsetwacom set "$PEN" MapToOutput 2560x1440+1920+0 #set the tablet to control the entire screen
xsetwacom set "$PEN" area 0 0 12500 9500 # set area to full tablet
xsetwacom set "$PEN" button 1 1 # click button - left click
xsetwacom set "$PEN" button 2 2 # top button - erase
xsetwacom set "$PEN" button 3 "key control pan" # bottom button - pan
xsetwacom set "$PEN" PanScrollThreshold -250
# export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus; notify-send "Wacom tablet found"

View file

@ -0,0 +1,7 @@
LANG=en_EN ldconfig 2> err.txt
for file in $(cut -d" " -f3 err.txt)
do
echo $file
pacman -S $(pacman -Fq $file) --noconfirm --overwrite "*"
done

133
.local/bin/virtplay.sh Executable file
View file

@ -0,0 +1,133 @@
#!/bin/bash
# Default variables
RESOLUTION=1920x1080
FPS=30
CHANNELS=2
RATE=48000
TIMESTAMP=0
VOLUME=1
BORDER=true
LOOPBACK=true
VIDEO=true
AUDIO=true
VIDEODEVICE=/dev/video50
AUDIODEVICE=/tmp/virtmic
BUFFERFILE=/tmp/virtplay
FFMPEGOPTIONS=""
##################
while [ ! $# == 0 ]; do
case "$1" in
-r | --resolution) RESOLUTION=$2
;;
-f | --fps) FPS=$2
;;
-b | --border) BORDER=$2
;;
-l | --loopback) LOOPBACK=$2
;;
-ar | --audio-rate) RATE=$2
;;
-c | --channels) CHANNELS=$2
;;
-ao | --audio-only) VIDEO=false; AUDIO=true
;;
-vo | --video-only) VIDEO=true; AUDIO=false
;;
-vd | --video-device) VIDEODEVICE=$2
;;
-ad | --audio-device) AUDIODEVICE=$2
;;
-bf | --buffer-file) BUFFERFILE=$2
;;
-t | --timestamp) TIMESTAMP=$2
;;
-v | --volume) VOLUME=$2
;;
-h | --help | "")
echo "VirtPlay v3 - Plays a video/audio file through a virtual webcam and microphone"
echo ""
echo "Usage: $0 [options] [value] [file]"
echo ""
echo "-h, --help | Shows this help statement"
echo "-r, --resolution [$RESOLUTION] | Changes the output resolution of the virtual webcam"
echo "-f, --fps [$FPS] | Changes the FPS of the fake webcam"
echo "-ar, --audio-rate [$RATE] | Changes the audio samping rate of the virtual microphone"
echo "-c, --channels [$CHANNELS] | Changes the number of audio channels"
echo "-b, --border [$BORDER] | Enables or disables changing the output's aspect ratio"
echo "-l, --loopback [$LOOPBACK] | Enables or disables audio loopback"
echo "-t, --timestamp | Jumps output to timestamp in either seconds or [HH:]MM:SS[.m...]"
echo "-v, --volume [$VOLUME] | Sets the volume of the virtual microphone where 1 is 100%"
echo "-ao, --audio-only | Create a virtual microphone only"
echo "-vo, --video-only | Create a virtual webcam only"
echo "-vd, --video-device [$VIDEODEVICE] | Changes which video device to output to"
echo "-ad, --audio-device [$AUDIODEVICE] | Changes the path for the fake audio device"
echo "-bf, --buffer-file [$BUFFERFILE] | Changes the path of the file that will be used when piping from stdin because bash is stupid"
exit
;;
*)
if [[ -f $1 ]]; then
FILE="$1"
fi
;;
esac
shift
done
if [[ ! $FILE ]]; then
echo "No file specified! Listening on stdin..."
FILE="$BUFFERFILE"
eval cat /dev/stdin > $BUFFERFILE
fi
trap ctrl_c INT
function ctrl_c() {
if [[ $AUDIO == true ]]; then
pactl unload-module module-pipe-source
if [[ $LOOPBACK == true ]]; then
pactl unload-module module-loopback
fi
fi
if [[ $FILE == $BUFFERFILE ]]; then
eval rm $BUFFERFILE
fi
exit
}
if [[ $VIDEO == true ]] && ffprobe -i "$FILE" -show_streams -select_streams v -loglevel error | grep STREAM 2>&1 >/dev/null; then
if ! lsmod | grep v4l2loopback; then
echo "v4l2loopback not loaded! Please run 'modprobe v4l2loopback' and try again."
exit 1
fi
FFMPEGOPTIONS+=" -map 0:v -ss $TIMESTAMP -vsync -1 -f v4l2 -pix_fmt yuv420p -s $RESOLUTION -r $FPS $VIDEODEVICE "
#ffmpeg -i $FILE -f v4l2 -pix_fmt yuv420p -s $RESOLUTION -r $FPS $VIDEODEVICE
fi
if [[ $AUDIO == true ]] && ffprobe -i "$FILE" -show_streams -select_streams a -loglevel error | grep STREAM 2>&1 >/dev/null; then
pactl load-module module-pipe-source source_name=virtmic file=$AUDIODEVICE format=s16le rate=$RATE channels=$CHANNELS
pactl set-default-source virtmic
if [[ $LOOPBACK == true ]]; then
pactl load-module module-loopback
fi
FFMPEGOPTIONS+=" -map 1:a -ss $TIMESTAMP -f s16le -af aresample=async=1000,aresample=$RATE,volume=$VOLUME -ar $RATE -ac $CHANNELS -y $AUDIODEVICE "
#eval ffmpeg -re -i "$FILE" -f s16le -ar 48000 -ac 2 -y $AUDIODEVICE
fi
sleep 1
ffmpeg -re -err_detect ignore_err -i "$FILE" -re -err_detect ignore_err -i "$FILE" $FFMPEGOPTIONS
sleep 1
if [[ $AUDIO == true ]]; then
pactl unload-module module-pipe-source
pactl unload-module module-loopback
if [[ "$FILE" = "$BUFFERFILE" ]]; then
eval rm $BUFFERFILE
fi
fi