Skip to content

Commit

Permalink
regular backup
Browse files Browse the repository at this point in the history
  • Loading branch information
keystroke3 committed Oct 26, 2024
1 parent 23c8df9 commit 0c29345
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 40 deletions.
60 changes: 37 additions & 23 deletions .aliases
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
#

sqlf(){
fuzz=$(fs -g '.sql$' | fzf --reverse --height 40%)
[ -f "$fuzz" ] || return 0
sqlformat -ask upper $fuzz -o $fuzz
sed -i 's/;--/;\n--/g' $fuzz
sed -i 's/;/;\n\n/g' $fuzz
}

wgc(){
if [ "$1" = "d" ]; then
profile=$(ip a | grep POINTOPOINT | cut -d':' -f2 | tr -d ' ')
Expand Down Expand Up @@ -60,7 +68,7 @@ o(){
}

cfg(){
fuzz=$(fs -p ~/dotfiles/ -p ~/dotfiles/.config/| fzf --reverse --height 40%)
fuzz=$(fs -p ~/dotfiles/ -p ~/dotfiles/.config/ -p ~/.bin/| fzf --reverse --height 40%)
[ -f "$fuzz" ] && ([ -n "$1" ] && $1 "$fuzz" || vim "$fuzz") || return 0
}

Expand All @@ -70,7 +78,12 @@ vsc(){
}

ovim(){
fuzz=$(fs -d -p ~/dev -p ~/work -i node_modules/ | fzf --reverse --height 40%)
fuzz=$(fs -p ~/dev -p ~/work -i node_modules/ -i '.git'| fzf --reverse --height 40%)
[ -f "$fuzz" ] && nvim "$fuzz" || return 0
}

ovimd(){
fuzz=$(fs -d -p ~/dev -p ~/work -i node_modules/ -i '.git'| fzf --reverse --height 40%)
[ -d "$fuzz" ] && nvim --cmd "cd $fuzz" "$fuzz" || return 0
}

Expand Down Expand Up @@ -148,26 +161,26 @@ py(){
$VIRTUAL_ENV/bin/python "$@"
}

remind(){
while getopts d:t:n: flag
do
case "${flag}" in
d) d=${OPTARG}
delay=$d;;
t) t=${OPTARG}
hour=$(date --date="$t" "+%H")
current_hour=$(date "+%H")
current_time=$(date "+%s")
((hour < current_hour)) &&
delay=$(($(date --date="$t 1 day" "+%s") - $current_time)) ||
delay=$(($(date --date="$t" "+%s") - $current_time));;
n) note=${OPTARG};;
*) echo 'unknown flag' && return 1
esac
done
(sleep $delay && notify-send "$note" &&
mpv --force-window=no /usr/share/sounds/freedesktop/stereo/service-login.oga) &> /dev/null & disown
}
# remind(){
# while getopts d:t:n: flag
# do
# case "${flag}" in
# d) d=${OPTARG}
# delay=$d;;
# t) t=${OPTARG}
# hour=$(date --date="$t" "+%H")
# current_hour=$(date "+%H")
# current_time=$(date "+%s")
# ((hour < current_hour)) &&
# delay=$(($(date --date="$t 1 day" "+%s") - $current_time)) ||
# delay=$(($(date --date="$t" "+%s") - $current_time));;
# n) note=${OPTARG};;
# *) echo 'unknown flag' && return 1
# esac
# done
# (sleep $delay && notify-send "$note" &&
# mpv --force-window=no /usr/share/sounds/freedesktop/stereo/service-login.oga) &> /dev/null & disown
# }
ytd(){
a=
r=
Expand Down Expand Up @@ -348,7 +361,6 @@ alias kdif="kitty +kitten diff"
alias ex="extract"
# alias less="bat --pager=always"
alias dupe="czkawka_cli"
alias pc="sudo netstat -tulnp | grep "$1""
alias ddev="ssh dino-dev"
alias dutils="ssh dino-utils"
alias dstage="ssh dino-stage"
Expand Down Expand Up @@ -406,6 +418,8 @@ alias h="cat ~/.zhistory | fzf "
alias kmarial="mariadb --defaults-file=~/.local/mariadb/local.db.cnf"
alias smarial="mariadb --defaults-file=~/work/kupiku/Shipping2/ship.cnf"
alias kmariap="mariadb --defaults-file=~/.local/mariadb/prod.db.cnf"
alias dpgl="psql -U kiss -d discogs"
alias dpgp="psql -h 95.216.65.50 -U releases -d discogs -p 5433"
alias wrandr='wlr-randr'
alias kp='cd "$(fs -p ~/work/kupiku/ -d --depth=1 | fzf)"'
alias vpnr="sudo protonvpn d && sudo protonvpn c -cc $1"
Expand Down
44 changes: 44 additions & 0 deletions .bin/ethstat
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin env python

import subprocess
import threading
import json
from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler

INTERFACE = "enp14s0"
INTERVAL = 2
KB = 1024
MB = 1024 * KB


rx_rate = 0
tx_tate = 0


def update():
last_tx = 0
last_rx = 0
while True:
all_stats = json.loads(
subprocess.run(["ifstat", "-j"], capture_output=True).stdout
)

# print(json.dumps(all_stats, indent=2))
stat = all_stats[next(iter(all_stats))][INTERFACE]
rx = stat["rx_bytes"]
tx = stat["tx_bytes"]

rx_delta = rx - last_rx
tx_delta = tx - last_tx
rx_rate = rx_delta / INTERVAL
tx_tate = tx_delta / INTERVAL
last_rx = rx
last_tx = tx


def listen():
handler = SimpleHTTPRequestHandler()
server = ThreadingHTTPServer()


threading.Thread()
11 changes: 8 additions & 3 deletions .bin/finder
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ -d ~/.cache/finders/ ] || mkdir -p ~/.cache/finders
hist_file=~/.cache/finders/dmenufinder
[ ! -f $hist_file ] && mkdir -p ~/.cache/finders && touch $hist_file
rg="$($HOME/.bin/fs -p /media -p /usb -i services --host 'zen:10002')"
rg="$($HOME/.bin/fs -p /store/media -i services -i xxx -i /store/media/downloads --host 'zen:10002')"
hist="$(head -n9 $hist_file)"
if [[ "$XDG_SESSION_TYPE" == "wayland" ]];then
fuzz="$(print $rg | fuzzel --dmenu \
Expand All @@ -19,10 +19,15 @@ else
fuzz="$(echo $hist $rg | dmenu -i -l 10 -p file: -nb '#1e1c31' -nf '#ccc' -sb '#e5c07b' -sf '#1e1c31')"
fi

if [ ! -z $fuzz ] && [ -f $fuzz ]
_fuzz=$(echo $fuzz|sed 's*/store/*/*')
echo $_fuzz

if [ ! -z $_fuzz ] && [ -f $_fuzz ]
then
echo "$hist" | grep -vF $fuzz | sed "1i$fuzz" > $hist_file
xdg-open $fuzz & disown
xdg-open $_fuzz & disown
else
echo "Not a file"
fi

# mime=$(xdg-mime query filetype "$fuzz")
Expand Down
19 changes: 19 additions & 0 deletions .bin/remind
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
while getopts d:t:n: flag
do
case "${flag}" in
d) d=${OPTARG}
delay=$d;;
t) t=${OPTARG}
hour=$(date --date="$t" "+%H")
current_hour=$(date "+%H")
current_time=$(date "+%s")
((hour < current_hour)) &&
delay=$(($(date --date="$t 1 day" "+%s") - $current_time)) ||
delay=$(($(date --date="$t" "+%s") - $current_time));;
n) note=${OPTARG};;
*) echo 'unknown flag' && return 1
esac
done
(sleep $delay && notify-send "$note" &&
mpv --force-window=no /usr/share/sounds/freedesktop/stereo/service-login.oga) &> /dev/null & disown
2 changes: 1 addition & 1 deletion .bin/startmail
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
/usr/bin/protonmail-bridge & disown
/usr/bin/protonmail-bridge-core -n & disown
sleep 20
/usr/bin/thunderbird & disown
24 changes: 24 additions & 0 deletions .bin/ytdm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
a=
r=
d=
directory=
while getopts r:a:d flag
do
case "${flag}" in
r) r=${OPTARG}
[ "$r" -eq "$r" ] &> /dev/null && continue || echo 'Resolution not an integer' && return 1 ;;
d)
d=$(fs -d -g ${OPTARG} /media/videos/music)
[ "$r" -eq "$r" ] &> /dev/null && continue || echo 'Resolution not an integer' && return 1 ;;
a)
link="${@:${OPTIND}}"
[ $link = '-a' ] && echo 'no link provided' && return 1
yt-dlp --no-playlist --audio-format mp3 -x ${@:(( OPTIND+1 ))} && return 0 ;;
?) echo "unknown flag -${OPTARG}" && return 1
esac
done
link="${@:${OPTIND}}"
[ -z $r ] && r=1080
[ -z $link ] && echo 'no link provided' && return 1
yt-dlp -f "bestvideo[height<="$r"]+bestaudio" $link
7 changes: 4 additions & 3 deletions .config/hypr/env.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland

env = GDK_BACKEND,wayland
env = QT_QPA_PLATFORM,wayland
env = GDK_BACKEND,wayland,X11,*
env = QT_QPA_PLATFORM,wayland,X11;xcb
env = QT_QPA_PLATFORMTHEME,qt5ct #env = QT_STYLE_OVERRIDE,kvantum
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1

env = SDL_VIDEODRIVER,wayland
# env = SDL_VIDEODRIVER,wayland
env = _JAVA_AWT_WM_NONREPARENTING,1
env = WLR_NO_HARDWARE_CURSORS,1

Expand All @@ -20,6 +20,7 @@ env = MOZ_ENABLE_WAYLAND,1
env = OZONE_PLATFORM,wayland

env = wallpaper_path,$HOME/Pictures/wallpapers/ #set wallpaper path
env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1

# env = GDK_SCALE,2
# env = XCURSOR_SIZE,16
Expand Down
5 changes: 5 additions & 0 deletions .config/hypr/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ workspace = r[6-10], monitor:DP-3

#scaling
monitor = DP-1,highres@highrr,0x0,2,bitdepth,10
monitor = HDMI-A-2,highres@highrr,0x0,2,bitdepth,10
monitor = DP-3,highres@highrr,1920x0,1


Expand All @@ -29,9 +30,13 @@ monitor = DP-3,highres@highrr,1920x0,1

input {
kb_layout = us # XKB layout
kb_variant=int,altgr
follow_mouse = 1
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
force_no_accel = 1
kb_options = compose:ralt
#cursor_theme = "Banana"
#cursor_size = 24
# kb_model = cherryblue # XKB model
# kb_variant = dvorak # XKB variant
# numlock_by_default = false
Expand Down
28 changes: 18 additions & 10 deletions .config/hypr/keybinds.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $term = alacritty
$volume = $scriptsDir/volume
# $screenshot = $scriptsDir/screensht
$colorpicker = $scriptsDir/colorpicker
$files = thunar
$files = nemo
$browser = firefox
$menu = fuzzel
$hyprman = $HOME/.bin/hyprman
Expand All @@ -21,16 +21,17 @@ $hyprman = $HOME/.bin/hyprman
# bind = SUPER, v, exec, wf-recorder -f $(xdg-user-dir VIDEOS)/$(date +'%H:%M:%S_%d-%m-%Y.mp4')
# bind = SUPER SHIFT, v, exec, killall -s SIGINT wf-recorder
# bind = Print, exec, grimblast copy full
bind = SUPER SHIFT, S, exec, grimblast --freeze save area - | satty --filename -
bind = SUPER SHIFT, S, exec, grimblast --freeze copy area
bind = SUPER, Print, exec, $HOME/.bin/savescreen
bind = SUPER SHIFT, Print, exec, grimblast --freeze copysave output && notify-send "Screenshot"

# █▀▄▀█ █ █▀ █▀▀
# █░▀░█ █ ▄█ █▄▄
bind = SUPER SHIFT, X, exec, $colorpicker

bind = CTRL,grave, exec, dunstctl history-pop

bind = SUPER, Return, exec, $term
bind = SUPER, E, exec, $files
bind = SUPER, period, exec, killall fuzzel || fuzzel -show emoji -emoji-format "{emoji}" -modi emoji -theme ~/.config/fuzzel/global/emoji
bind = SUPER SHIFT, B, exec, pgrep waybar && killall waybar; waybar & disown
# bind = SUPER, B, exec, killall -SIGUSR1 waybar # Hide waybar
bind = SUPER, Space, exec, $menu
Expand All @@ -39,7 +40,7 @@ bind = SUPER SHIFT, bracketleft, exec, copyq show
bind = SUPER, G, exec, ~/.bin/shuffle
bind = SUPER, R, exec, ~/.bin/open_in_mpv
bind = CTRL ALT, F, exec, firefox
bind = SUPER, Q, exec, wlogout
bind = SUPER SHIFT, X, exec, wlogout

bind = SUPER SHIFT, Space, exec, ~/.bin/vp-finder
bind = ALT SHIFT, Space, exec, ~/.bin/vp-finder resume
Expand All @@ -56,6 +57,9 @@ bind = SUPER, backslash, exec, pactl set-default-sink $(pactl list short sinks |
binde=, XF86AudioRaiseVolume, exec, bash ~/.bin/volume up
bindl=, XF86AudioLowerVolume, exec, bash ~/.bin/volume down
bindl=, XF86AudioMute, exec, bash ~/.bin/volume mute
binde=, XF86AudioPlay, exec, playerctl play-pause
binde=, XF86AudioNext, exec, playerctl next
binde=, XF86AudioPrev, exec, playerctl previous

bind = SUPER, C, exec, bash ~/.bin/wally

Expand Down Expand Up @@ -97,10 +101,10 @@ bind = SUPER SHIFT, j, swapwindow, d

# █▀█ █▀▀ █▀ █ ▀█ █▀▀
# █▀▄ ██▄ ▄█ █ █▄ ██▄
bind = SUPER CTRL, h, resizeactive, -20 0
bind = SUPER CTRL, l, resizeactive, 20 0
bind = SUPER CTRL, k, resizeactive, 0 -20
bind = SUPER CTRL, j, resizeactive, 0 20
bind = SUPER CTRL, h, resizeactive, -30 0
bind = SUPER CTRL, l, resizeactive, 30 0
bind = SUPER CTRL, k, resizeactive, 0 -30
bind = SUPER CTRL, j, resizeactive, 0 30

# ▀█▀ ▄▀█ █▄▄ █▄▄ █▀▀ █▀▄
# ░█░ █▀█ █▄█ █▄█ ██▄ █▄▀
Expand All @@ -111,13 +115,17 @@ bind = SUPER CTRL, j, resizeactive, 0 20

# █▀ █▀█ █▀▀ █▀▀ █ ▄▀█ █░░
# ▄█ █▀▀ ██▄ █▄▄ █ █▀█ █▄▄
bind = SUPER, a, togglespecialworkspace
#bind = SUPER, a, togglespecialworkspace
bind = SUPERSHIFT, a, movetoworkspace, special
bind = SUPER, a, exec, $notifycmd 'Toggled Special Workspace'
bind = SUPER, c, exec, hyprctl dispatch centerwindow


# █▀ █░█░█ █ ▀█▀ █▀▀ █░█
# ▄█ ▀▄▀▄▀ █ ░█░ █▄▄ █▀█
#


bind = SUPER, 1, focusmonitor, DP-1
bind = SUPER, 2, focusmonitor, DP-1
bind = SUPER, 3, focusmonitor, DP-1
Expand Down
1 change: 1 addition & 0 deletions .config/hypr/startup.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# █▀▀ ▀▄▀ █▀▀ █▀▀
# ██▄ █░█ ██▄ █▄▄
exec-once = easyeffects --gapplication-service
exec-once = hyprctl setcursor "Banana" 24
exec-once = ~/.config/hypr/scripts/resetxdgportal.sh # reset XDPH for screenshare
exec-once = swww init || swww img $(cat ~/.cache/last_wall) || swww img `find $wallpaper_path -type f | shuf -n 1` # Set wallpaper
exec-once = ~/.bin/hyprman &> /tmp/hyprman.log
Expand Down
7 changes: 7 additions & 0 deletions .config/waybar/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
// ]
// },
"persistent-workspaces": {
"HDMI-A-2": [
1,
2,
3,
4,
5
],
"DP-1": [
1,
2,
Expand Down

0 comments on commit 0c29345

Please sign in to comment.