Pushing to eXogit

>.<
This commit is contained in:
icxven 2024-03-03 18:50:07 +05:30
commit e285d81bde
Signed by: x
GPG key ID: 07D47D6C17A8E630
58 changed files with 4721 additions and 0 deletions

2
.config/dinit.d/boot Normal file
View file

@ -0,0 +1,2 @@
type=internal
waits-for.d=boot.d

4
.config/dinit.d/dbus Normal file
View file

@ -0,0 +1,4 @@
type = process
command = /usr/lib/dinit/user/dbus --print-address=4
ready-notification = pipefd:4
logfile = $HOME/Public/Logs/dinit/dbus.log

4
.config/dinit.d/dunst Normal file
View file

@ -0,0 +1,4 @@
type = process
command = /usr/bin/dunst -config $HOME/.config/dunst/dunstrc
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/dunst.log

View file

@ -0,0 +1,4 @@
type = process
command = /usr/bin/gammastep -P -O 4500K
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/gammastep.log

4
.config/dinit.d/incron Normal file
View file

@ -0,0 +1,4 @@
type = process
command = /usr/bin/incrond -n
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/incron.log

4
.config/dinit.d/mpd Normal file
View file

@ -0,0 +1,4 @@
type = process
command = /usr/bin/mpd --no-daemon
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/mpd.log

6
.config/dinit.d/pipewire Normal file
View file

@ -0,0 +1,6 @@
type = process
command = /usr/bin/pipewire
depends-on = dbus
smooth-recovery = true
socket-listen = $XDG_RUNTIME_DIR/pipewire-0
logfile = $HOME/Public/Logs/dinit/pipewire.log

6
.config/dinit.d/pulse Normal file
View file

@ -0,0 +1,6 @@
type = process
command = /usr/bin/pipewire-pulse -c $HOME/.config/pipewire/pipewire-pulse.conf
depends-on = dbus
smooth-recovery = true
socket-listen = $XDG_RUNTIME_DIR/pipewire-0
logfile = $HOME/Public/Logs/dinit/pulse.log

4
.config/dinit.d/swww Normal file
View file

@ -0,0 +1,4 @@
type = process
command = $HOME/.local/bin/sw
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/swww.log

View file

@ -0,0 +1,5 @@
type = process
command = /usr/bin/syncthing -logflags=0 -home=$HOME/.config/syncthing
load-options = export-passwd-vars
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/syncthing.log

5
.config/dinit.d/waybar Normal file
View file

@ -0,0 +1,5 @@
type = process
command = /usr/bin/waybar
depends-on = dbus
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/waybar.log

View file

@ -0,0 +1,5 @@
type = process
command = /usr/bin/wireplumber -c $HOME/.config/wireplumber/wireplumber.conf
smooth-recovery = true
depends-on = pipewire
logfile = $HOME/Public/Logs/dinit/wireplumber.log

4
.config/dinit.d/ytlocal Normal file
View file

@ -0,0 +1,4 @@
type = process
command = $HOME/.local/bin/YoutubeLocal
smooth-recovery = true
logfile = $HOME/Public/Logs/dinit/ytlocal.log

54
.config/dunst/dunstrc Normal file
View file

@ -0,0 +1,54 @@
[global]
monitor = 0
follow = mouse
width = 280
height = 80
origin = bottom-right
offset = 5x45
scale = 0
indicate_hidden = yes
shrink = no
separator_color = auto
separator_height = 4
line_height = 4
padding = 15
horizontal_padding = 15
frame_width = 2
sort = no
idle_threshold = 120
font = JetBrains Mono Medium 10
markup = full
format = %s\n%b
alignment = left
show_age_threshold = 60
word_wrap = yes
ignore_newline = no
stack_duplicates = false
hide_duplicate_count = yes
show_indicators = no
icon_position = left
max_icon_size = 48
sticky_history = yes
history_length = 20
browser = x-www-browser -new-tab
always_run_script = true
title = Dunst
class = Dunst
[urgency_low]
timeout = 2
background = "#1e222a"
foreground = "#c8ccd4"
frame_color = "#61afef"
[urgency_normal]
timeout = 5
background = "#1e222a"
foreground = "#c8ccd4"
frame_color = "#61afef"
[urgency_critical]
timeout = 0
background = "#1e222a"
foreground = "#c8ccd4"
frame_color = "#e06c75"

View file

@ -0,0 +1,7 @@
complete --command fisher --exclusive --long help --description "Print help"
complete --command fisher --exclusive --long version --description "Print version"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex"
complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"

View file

@ -0,0 +1,21 @@
# Autocompletion for fish shell.
#
# You may put this file to a directory in $fish_complete_path variable:
#
# mkdir -p ~/.config/fish/completions
# ln -s "/path/to/lf.fish" ~/.config/fish/completions
#
complete -c lf -o command -r -d 'command to execute on client initialization'
complete -c lf -o config -r -d 'path to the config file (instead of the usual paths)'
complete -c lf -o cpuprofile -r -d 'path to the file to write the CPU profile'
complete -c lf -o doc -d 'show documentation'
complete -c lf -o last-dir-path -r -d 'path to the file to write the last dir on exit (to use for cd)'
complete -c lf -o log -r -d 'path to the log file to write messages'
complete -c lf -o memprofile -r -d 'path to the file to write the memory profile'
complete -c lf -o remote -x -d 'send remote command to server'
complete -c lf -o selection-path -r -d 'path to the file to write selected files on open (to use as open file dialog)'
complete -c lf -o server -d 'start server (automatic)'
complete -c lf -o single -d 'start a client without server'
complete -c lf -o version -d 'show version'
complete -c lf -o help -d 'show help'

View file

@ -0,0 +1,177 @@
# fish completion for mangal -*- shell-script -*-
function __mangal_debug
set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >> $file
end
end
function __mangal_perform_completion
__mangal_debug "Starting __mangal_perform_completion"
# Extract all args except the last one
set -l args (commandline -opc)
# Extract the last arg and escape it in case it is a space
set -l lastArg (string escape -- (commandline -ct))
__mangal_debug "args: $args"
__mangal_debug "last arg: $lastArg"
# Disable ActiveHelp which is not supported for fish shell
set -l requestComp "MANGAL_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg"
__mangal_debug "Calling $requestComp"
set -l results (eval $requestComp 2> /dev/null)
# Some programs may output extra empty lines after the directive.
# Let's ignore them or else it will break completion.
# Ref: https://github.com/spf13/cobra/issues/1279
for line in $results[-1..1]
if test (string trim -- $line) = ""
# Found an empty line, remove it
set results $results[1..-2]
else
# Found non-empty line, we have our proper output
break
end
end
set -l comps $results[1..-2]
set -l directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set -l flagPrefix (string match -r -- '-.*=' "$lastArg")
__mangal_debug "Comps: $comps"
__mangal_debug "DirectiveLine: $directiveLine"
__mangal_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# This function does two things:
# - Obtain the completions and store them in the global __mangal_comp_results
# - Return false if file completion should be performed
function __mangal_prepare_completions
__mangal_debug ""
__mangal_debug "========= starting completion logic =========="
# Start fresh
set --erase __mangal_comp_results
set -l results (__mangal_perform_completion)
__mangal_debug "Completion results: $results"
if test -z "$results"
__mangal_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
return 1
end
set -l directive (string sub --start 2 $results[-1])
set --global __mangal_comp_results $results[1..-2]
__mangal_debug "Completions are: $__mangal_comp_results"
__mangal_debug "Directive is: $directive"
set -l shellCompDirectiveError 1
set -l shellCompDirectiveNoSpace 2
set -l shellCompDirectiveNoFileComp 4
set -l shellCompDirectiveFilterFileExt 8
set -l shellCompDirectiveFilterDirs 16
if test -z "$directive"
set directive 0
end
set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2)
if test $compErr -eq 1
__mangal_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
return 1
end
set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2)
set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2)
if test $filefilter -eq 1; or test $dirfilter -eq 1
__mangal_debug "File extension filtering or directory filtering not supported"
# Do full file completion instead
return 1
end
set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2)
set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2)
__mangal_debug "nospace: $nospace, nofiles: $nofiles"
# If we want to prevent a space, or if file completion is NOT disabled,
# we need to count the number of valid completions.
# To do so, we will filter on prefix as the completions we have received
# may not already be filtered so as to allow fish to match on different
# criteria than the prefix.
if test $nospace -ne 0; or test $nofiles -eq 0
set -l prefix (commandline -t | string escape --style=regex)
__mangal_debug "prefix: $prefix"
set -l completions (string match -r -- "^$prefix.*" $__mangal_comp_results)
set --global __mangal_comp_results $completions
__mangal_debug "Filtered completions are: $__mangal_comp_results"
# Important not to quote the variable for count to work
set -l numComps (count $__mangal_comp_results)
__mangal_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# We must first split on \t to get rid of the descriptions to be
# able to check what the actual completion will be.
# We don't need descriptions anyway since there is only a single
# real completion which the shell will expand immediately.
set -l split (string split --max 1 \t $__mangal_comp_results[1])
# Fish won't add a space if the completion ends with any
# of the following characters: @=/:.,
set -l lastChar (string sub -s -1 -- $split)
if not string match -r -q "[@=/:.,]" -- "$lastChar"
# In other cases, to support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__mangal_debug "Adding second completion to perform nospace directive"
set --global __mangal_comp_results $split[1] $split[1].
__mangal_debug "Completions are now: $__mangal_comp_results"
end
end
if test $numComps -eq 0; and test $nofiles -eq 0
# To be consistent with bash and zsh, we only trigger file
# completion when there are no other completions
__mangal_debug "Requesting file completion"
return 1
end
end
return 0
end
# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves
# so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found.
if type -q "mangal"
# The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "mangal " > /dev/null 2>&1
end
# Remove any pre-existing completions for the program since we will be handling all of them.
complete -c mangal -e
# The call to __mangal_prepare_completions will setup __mangal_comp_results
# which provides the program's completion choices.
complete -c mangal -n '__mangal_prepare_completions' -f -a '$__mangal_comp_results'

View file

@ -0,0 +1,335 @@
# MIT License
# Copyright (c) 2016 Francisco Lourenço & Daniel Wehner
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
if not status is-interactive
exit
end
set -g __done_version 1.19.2
function __done_run_powershell_script
set -l powershell_exe (command --search "powershell.exe")
if test $status -ne 0
and command --search wslvar
set -l powershell_exe (wslpath (wslvar windir)/System32/WindowsPowerShell/v1.0/powershell.exe)
end
if string length --quiet "$powershell_exe"
and test -x "$powershell_exe"
set cmd (string escape $argv)
eval "$powershell_exe -Command $cmd"
end
end
function __done_windows_notification -a title -a message
if test "$__done_notify_sound" -eq 1
set soundopt "<audio silent=\"false\" src=\"ms-winsoundevent:Notification.Default\" />"
else
set soundopt "<audio silent=\"true\" />"
end
__done_run_powershell_script "
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
\$toast_xml_source = @\"
<toast>
$soundopt
<visual>
<binding template=\"ToastText02\">
<text id=\"1\">$title</text>
<text id=\"2\">$message</text>
</binding>
</visual>
</toast>
\"@
\$toast_xml = New-Object Windows.Data.Xml.Dom.XmlDocument
\$toast_xml.loadXml(\$toast_xml_source)
\$toast = New-Object Windows.UI.Notifications.ToastNotification \$toast_xml
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier(\"fish\").Show(\$toast)
"
end
function __done_get_focused_window_id
if type -q lsappinfo
lsappinfo info -only bundleID (lsappinfo front | string replace 'ASN:0x0-' '0x') | cut -d '"' -f4
else if test -n "$SWAYSOCK"
and type -q jq
swaymsg --type get_tree | jq '.. | objects | select(.focused == true) | .id'
else if test -n "$HYPRLAND_INSTANCE_SIGNATURE"
hyprctl activewindow | awk 'NR==1 {print $2}'
else if begin
test "$XDG_SESSION_DESKTOP" = gnome; and type -q gdbus
end
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'global.display.focus_window.get_id()'
else if type -q xprop
and test -n "$DISPLAY"
# Test that the X server at $DISPLAY is running
and xprop -grammar >/dev/null 2>&1
xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2
else if uname -a | string match --quiet --ignore-case --regex microsoft
__done_run_powershell_script '
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class WindowsCompat {
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
}
"@
[WindowsCompat]::GetForegroundWindow()
'
else if set -q __done_allow_nongraphical
echo 12345 # dummy value
end
end
function __done_is_tmux_window_active
set -q fish_pid; or set -l fish_pid %self
# find the outermost process within tmux
# ppid != "tmux" -> pid = ppid
# ppid == "tmux" -> break
set tmux_fish_pid $fish_pid
while set tmux_fish_ppid (ps -o ppid= -p $tmux_fish_pid | string trim)
# remove leading hyphen so that basename does not treat it as an argument (e.g. -fish), and return only
# the actual command and not its arguments so that basename finds the correct command name.
# (e.g. '/usr/bin/tmux' from command '/usr/bin/tmux new-session -c /some/start/dir')
and ! string match -q "tmux*" (basename (ps -o command= -p $tmux_fish_ppid | string replace -r '^-' '' | string split ' ')[1])
set tmux_fish_pid $tmux_fish_ppid
end
# tmux session attached and window is active -> no notification
# all other combinations -> send notification
tmux list-panes -a -F "#{session_attached} #{window_active} #{pane_pid}" | string match -q "1 1 $tmux_fish_pid"
end
function __done_is_screen_window_active
string match --quiet --regex "$STY\s+\(Attached" (screen -ls)
end
function __done_is_process_window_focused
# Return false if the window is not focused
if set -q __done_allow_nongraphical
return 1
end
if set -q __done_kitty_remote_control
kitty @ --password="$__done_kitty_remote_control_password" ls | jq -e ".[].tabs[] | select(any(.windows[]; .is_self)) | .is_focused" >/dev/null
return $status
end
set __done_focused_window_id (__done_get_focused_window_id)
if test "$__done_sway_ignore_visible" -eq 1
and test -n "$SWAYSOCK"
string match --quiet --regex "^true" (swaymsg -t get_tree | jq ".. | objects | select(.id == "$__done_initial_window_id") | .visible")
return $status
else if test -n "$HYPRLAND_INSTANCE_SIGNATURE"
and test $__done_initial_window_id = (hyprctl activewindow | awk 'NR==1 {print $2}')
return $status
else if test "$__done_initial_window_id" != "$__done_focused_window_id"
return 1
end
# If inside a tmux session, check if the tmux window is focused
if type -q tmux
and test -n "$TMUX"
__done_is_tmux_window_active
return $status
end
# If inside a screen session, check if the screen window is focused
if type -q screen
and test -n "$STY"
__done_is_screen_window_active
return $status
end
return 0
end
function __done_humanize_duration -a milliseconds
set -l seconds (math --scale=0 "$milliseconds/1000" % 60)
set -l minutes (math --scale=0 "$milliseconds/60000" % 60)
set -l hours (math --scale=0 "$milliseconds/3600000")
if test $hours -gt 0
printf '%s' $hours'h '
end
if test $minutes -gt 0
printf '%s' $minutes'm '
end
if test $seconds -gt 0
printf '%s' $seconds's'
end
end
# verify that the system has graphical capabilities before initializing
if test -z "$SSH_CLIENT" # not over ssh
and count (__done_get_focused_window_id) >/dev/null # is able to get window id
set __done_enabled
end
if set -q __done_allow_nongraphical
and set -q __done_notification_command
set __done_enabled
end
if set -q __done_enabled
set -g __done_initial_window_id ''
set -q __done_min_cmd_duration; or set -g __done_min_cmd_duration 5000
set -q __done_exclude; or set -g __done_exclude '^git (?!push|pull|fetch)'
set -q __done_notify_sound; or set -g __done_notify_sound 0
set -q __done_sway_ignore_visible; or set -g __done_sway_ignore_visible 0
set -q __done_tmux_pane_format; or set -g __done_tmux_pane_format '[#{window_index}]'
set -q __done_notification_duration; or set -g __done_notification_duration 3000
function __done_started --on-event fish_preexec
set __done_initial_window_id (__done_get_focused_window_id)
end
function __done_ended --on-event fish_postexec
set -l exit_status $status
# backwards compatibility for fish < v3.0
set -q cmd_duration; or set -l cmd_duration $CMD_DURATION
if test $cmd_duration
and test $cmd_duration -gt $__done_min_cmd_duration # longer than notify_duration
and not __done_is_process_window_focused # process pane or window not focused
# don't notify if command matches exclude list
for pattern in $__done_exclude
if string match -qr $pattern $argv[1]
return
end
end
# Store duration of last command
set -l humanized_duration (__done_humanize_duration "$cmd_duration")
set -l title "Done in $humanized_duration"
set -l wd (string replace --regex "^$HOME" "~" (pwd))
set -l message "$wd/ $argv[1]"
set -l sender $__done_initial_window_id
if test $exit_status -ne 0
set title "Failed ($exit_status) after $humanized_duration"
end
if test -n "$TMUX_PANE"
set message (tmux lsw -F"$__done_tmux_pane_format" -f '#{==:#{pane_id},'$TMUX_PANE'}')" $message"
end
if set -q __done_notification_command
eval $__done_notification_command
if test "$__done_notify_sound" -eq 1
echo -e "\a" # bell sound
end
else if set -q KITTY_WINDOW_ID
printf "\x1b]99;i=done:d=0;$title\x1b\\"
printf "\x1b]99;i=done:d=1:p=body;$message\x1b\\"
else if type -q terminal-notifier # https://github.com/julienXX/terminal-notifier
if test "$__done_notify_sound" -eq 1
# pipe message into terminal-notifier to avoid escaping issues (https://github.com/julienXX/terminal-notifier/issues/134). fixes #140
echo "$message" | terminal-notifier -title "$title" -sender "$__done_initial_window_id" -sound default
else
echo "$message" | terminal-notifier -title "$title" -sender "$__done_initial_window_id"
end
else if type -q osascript # AppleScript
# escape double quotes that might exist in the message and break osascript. fixes #133
set -l message (string replace --all '"' '\"' "$message")
set -l title (string replace --all '"' '\"' "$title")
osascript -e "display notification \"$message\" with title \"$title\""
if test "$__done_notify_sound" -eq 1
osascript -e "display notification \"$message\" with title \"$title\" sound name \"Glass\""
else
osascript -e "display notification \"$message\" with title \"$title\""
end
else if type -q notify-send # Linux notify-send
# set urgency to normal
set -l urgency normal
# use user-defined urgency if set
if set -q __done_notification_urgency_level
set urgency "$__done_notification_urgency_level"
end
# override user-defined urgency level if non-zero exitstatus
if test $exit_status -ne 0
set urgency critical
if set -q __done_notification_urgency_level_failure
set urgency "$__done_notification_urgency_level_failure"
end
end
notify-send --hint=int:transient:1 --urgency=$urgency --icon=utilities-terminal --app-name=fish --expire-time=$__done_notification_duration "$title" "$message"
if test "$__done_notify_sound" -eq 1
echo -e "\a" # bell sound
end
else if type -q notify-desktop # Linux notify-desktop
set -l urgency
if test $exit_status -ne 0
set urgency "--urgency=critical"
end
notify-desktop $urgency --icon=utilities-terminal --app-name=fish "$title" "$message"
if test "$__done_notify_sound" -eq 1
echo -e "\a" # bell sound
end
else if uname -a | string match --quiet --ignore-case --regex microsoft
__done_windows_notification "$title" "$message"
else # anything else
echo -e "\a" # bell sound
end
end
end
end
function __done_uninstall -e done_uninstall
# Erase all __done_* functions
functions -e __done_ended
functions -e __done_started
functions -e __done_get_focused_window_id
functions -e __done_is_tmux_window_active
functions -e __done_is_screen_window_active
functions -e __done_is_process_window_focused
functions -e __done_windows_notification
functions -e __done_run_powershell_script
functions -e __done_humanize_duration
# Erase __done variables
set -e __done_version
end

24
.config/fish/config.fish Normal file
View file

@ -0,0 +1,24 @@
# Binary Paths
fish_add_path ~/.local/bin/
fish_add_path ~/.cache/go/bin/
# Aliases
alias ls="exa --color=auto --icons=auto"
alias a="/usr/bin/aria2c"
alias sudo="/usr/bin/doas"
alias y="/usr/bin/yt-dlp"
alias cp="cp -v"
alias lf='set old_tty (stty -g); stty sane; lfcd; stty $old_tty; commandline -f repaint'
alias c="wl-copy"
alias v="wl-paste"
# Keybindings
bind \co 'set old_tty (stty -g); stty sane; lfcd; stty $old_tty; commandline -f repaint'
# Environmental Variables
#set -gx GEM_HOME (gem env user_gemhome)
set -gx GPG_TTY (tty)
set -gx PATH "$PATH:$GEM_HOME/bin/"
set -gx GOPATH $HOME/.cache/go/
set -gx EDITOR /usr/bin/nvim
set -gx QT_QPA_PLATFORMTHEME gtk3

View file

@ -0,0 +1,2 @@
jorgebucaran/fisher
franciscolourenco/done

View file

@ -0,0 +1,240 @@
function fisher --argument-names cmd --description "A plugin manager for Fish"
set --query fisher_path || set --local fisher_path $__fish_config_dir
set --local fisher_version 4.4.4
set --local fish_plugins $__fish_config_dir/fish_plugins
switch "$cmd"
case -v --version
echo "fisher, version $fisher_version"
case "" -h --help
echo "Usage: fisher install <plugins...> Install plugins"
echo " fisher remove <plugins...> Remove installed plugins"
echo " fisher update <plugins...> Update installed plugins"
echo " fisher update Update all installed plugins"
echo " fisher list [<regex>] List installed plugins matching regex"
echo "Options:"
echo " -v, --version Print version"
echo " -h, --help Print this help message"
echo "Variables:"
echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~
case ls list
string match --entire --regex -- "$argv[2]" $_fisher_plugins
case install update remove
isatty || read --local --null --array stdin && set --append argv $stdin
set --local install_plugins
set --local update_plugins
set --local remove_plugins
set --local arg_plugins $argv[2..-1]
set --local old_plugins $_fisher_plugins
set --local new_plugins
test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins)
if ! set --query argv[2]
if test "$cmd" != update
echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1
else if ! set --query file_plugins
echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
end
set arg_plugins $file_plugins
end
for plugin in $arg_plugins
set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin)
contains -- "$plugin" $new_plugins || set --append new_plugins $plugin
end
if set --query argv[2]
for plugin in $new_plugins
if contains -- "$plugin" $old_plugins
test "$cmd" = remove &&
set --append remove_plugins $plugin ||
set --append update_plugins $plugin
else if test "$cmd" = install
set --append install_plugins $plugin
else
echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1
end
end
else
for plugin in $new_plugins
contains -- "$plugin" $old_plugins &&
set --append update_plugins $plugin ||
set --append install_plugins $plugin
end
for plugin in $old_plugins
contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin
end
end
set --local pid_list
set --local source_plugins
set --local fetch_plugins $update_plugins $install_plugins
set --local fish_path (status fish-path)
echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal)
for plugin in $fetch_plugins
set --local source (command mktemp -d)
set --append source_plugins $source
command mkdir -p $source/{completions,conf.d,themes,functions}
$fish_path --command "
if test -e $plugin
command cp -Rf $plugin/* $source
else
set temp (command mktemp -d)
set repo (string split -- \@ $plugin) || set repo[2] HEAD
if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1])
set name (string split -- / \$path)[-1]
set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz
else
set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2]
end
echo Fetching (set_color --underline)\$url(set_color normal)
if command curl -q --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null
command cp -Rf \$temp/*/* $source
else
echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2
command rm -rf $source
end
command rm -rf \$temp
end
set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files
" &
set --append pid_list (jobs --last --pid)
end
wait $pid_list 2>/dev/null
for plugin in $fetch_plugins
if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
if set --local index (contains --index -- "$plugin" $install_plugins)
set --erase install_plugins[$index]
else
set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)]
end
end
end
for plugin in $update_plugins $remove_plugins
if set --local index (contains --index -- "$plugin" $_fisher_plugins)
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
if contains -- "$plugin" $remove_plugins
for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var)
emit {$name}_uninstall
end
printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
set --erase _fisher_plugins[$index]
end
command rm -rf (string replace -- \~ ~ $$plugin_files_var)
functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var)
for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var)
complete --erase --command $name
end
set --erase $plugin_files_var
end
end
if set --query update_plugins[1] || set --query install_plugins[1]
command mkdir -p $fisher_path/{functions,themes,conf.d,completions}
end
for plugin in $update_plugins $install_plugins
set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)]
set --local files $source/{functions,themes,conf.d,completions}/*
if set --local index (contains --index -- $plugin $install_plugins)
set --local user_files $fisher_path/{functions,themes,conf.d,completions}/*
set --local conflict_files
for file in (string replace -- $source/ $fisher_path/ $files)
contains -- $file $user_files && set --append conflict_files $file
end
if set --query conflict_files[1] && set --erase install_plugins[$index]
echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2
continue
end
end
for file in (string replace -- $source/ "" $files)
command cp -RLf $source/$file $fisher_path/$file
end
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~)
contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin
contains -- $plugin $install_plugins && set --local event install || set --local event update
printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~)
source $file
if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file)
emit {$name}_$event
end
end
end
command rm -rf $source_plugins
if set --query _fisher_plugins[1]
set --local commit_plugins
for plugin in $file_plugins
contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin
end
for plugin in $_fisher_plugins
contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin
end
printf "%s\n" $commit_plugins >$fish_plugins
else
set --erase _fisher_plugins
command rm -f $fish_plugins
end
set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins)
test "$total" != "0 0 0" && echo (string join ", " (
test $total[1] = 0 || echo "Installed $total[1]") (
test $total[2] = 0 || echo "Updated $total[2]") (
test $total[3] = 0 || echo "Removed $total[3]")
) plugin/s
case \*
echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1
end
end
if ! set --query _fisher_upgraded_to_4_4
set --universal _fisher_upgraded_to_4_4
if functions --query _fisher_list
set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share
command rm -rf $XDG_DATA_HOME/fisher
functions --erase _fisher_{list,plugin_parse}
fisher update >/dev/null 2>/dev/null
else
for var in (set --names | string match --entire --regex '^_fisher_.+_files$')
set $var (string replace -- ~ \~ $$var)
end
functions --erase _fisher_fish_postexec
end
end

View file

@ -0,0 +1,27 @@
# Change working dir in fish to last dir in lf on exit (adapted from ranger).
#
# You may put this file to a directory in $fish_function_path variable:
#
# mkdir -p ~/.config/fish/functions
# ln -s "/path/to/lfcd.fish" ~/.config/fish/functions
#
# You may also like to assign a key (Ctrl-O) to this command:
#
# bind \co 'set old_tty (stty -g); stty sane; lfcd; stty $old_tty; commandline -f repaint'
#
# You may put this in a function called fish_user_key_bindings.
function lfcd
set tmp (mktemp)
# `command` is needed in case `lfcd` is aliased to `lf`
command lf -last-dir-path=$tmp $argv
if test -f "$tmp"
set dir (cat $tmp)
rm -f $tmp
if test -d "$dir"
if test "$dir" != (pwd)
cd $dir
end
end
end
end

View file

@ -0,0 +1,44 @@
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- Fallback fonts preference order -->
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Open Sans</family>
<family>Droid Sans</family>
<family>Roboto</family>
<family>Tholoth</family>
<family>Noto Sans Sinhala</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Droid Serif</family>
<family>Roboto Slab</family>
<family>Tholoth</family>
<family>Noto Sans Sinhala</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono</family>
<family>Inconsolata</family>
<family>Droid Sans Mono</family>
<family>Roboto Mono</family>
</prefer>
</alias>
<match target="pattern">
<test name="lang" compare="contains">
<string>si</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans Sinhala</string>
</edit>
</match>
<dir>~/.fonts</dir>
</fontconfig>

226
.config/foot/foot.ini Normal file
View file

@ -0,0 +1,226 @@
# -*- conf -*-
#shell=$SHELL
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
# login-shell=no
# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode
# title=foot
# locked-title=no
font=JetBrainsMono Nerd Font:pixelsize=14, Noto Sans Sinhala:pixelsize=14:letter-spacing=1
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# font-size-adjustment=0.5
# line-height=<font metrics>
#letter-spacing=1
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# underline-thickness=<font underline thickness>
# box-drawings-uses-font-glyphs=no
# dpi-aware=no
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
pad=8x8 center
# resize-delay-ms=100
# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}
# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>
# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is libutempter (Linux)
# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ulog (FreeBSD)
[environment]
# name=value
[bell]
# urgent=no
# notify=no
# visual=no
# command=
# command-focused=no
[scrollback]
# lines=1000
# multiplier=3.0
# indicator-position=relative
# indicator-format=""
[url]
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]
[cursor]
# style=block
# color=<inverse foreground/background>
# blink=no
# beam-thickness=1.5
# underline-thickness=<font underline thickness>
[mouse]
# hide-when-typing=no
# alternate-scroll-mode=yes
[touch]
# long-press-delay=400
[colors]
alpha=1.0
background=1e222a
foreground=c8ccd4
# flash=7f7f00
# flash-alpha=0.5
## Normal/regular colors (color palette 0-7)
# regular0=242424 # black
# regular1=f62b5a # red
# regular2=47b413 # green
# regular3=e3c401 # yellow
# regular4=24acd4 # blue
# regular5=f2affd # magenta
# regular6=13c299 # cyan
# regular7=e6e6e6 # white
## Bright colors (color palette 8-15)
# bright0=616161 # bright black
# bright1=ff4d51 # bright red
# bright2=35d450 # bright green
# bright3=e9e836 # bright yellow
# bright4=5dc5f8 # bright blue
# bright5=feabf2 # bright magenta
# bright6=24dfc4 # bright cyan
# bright7=ffffff # bright white
## dimmed colors (see foot.ini(5) man page)
# dim0=<not set>
# ...
# dim7=<not-set>
## The remaining 256-color palette
# 16 = <256-color palette #16>
# ...
# 255 = <256-color palette #255>
## Misc colors
# selection-foreground=<inverse foreground/background>
# selection-background=<inverse foreground/background>
# jump-labels=<regular0> <regular3> # black-on-yellow
# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue
# search-box-no-match=<regular0> <regular1> # black-on-red
# search-box-match=<regular0> <regular3> # black-on-yellow
# urls=<regular3>
[csd]
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-maximized=no
# double-click-to-maximize=yes
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
[key-bindings]
scrollback-up-line=Mod1+k
scrollback-down-line=Mod1+j
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
# clipboard-copy=Control+Shift+c XF86Copy
# clipboard-paste=Control+Shift+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# show-urls-launch=Control+Shift+o
# show-urls-copy=none
# show-urls-persistent=none
# prompt-prev=Control+Shift+z
# prompt-next=Control+Shift+x
# unicode-input=Control+Shift+u
# noop=none
[search-bindings]
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-char=Shift+Right
# extend-to-word-boundary=Control+w Control+Shift+Right
# extend-to-next-whitespace=Control+Shift+w
# extend-line-down=Shift+Down
# extend-backward-char=Shift+Left
# extend-backward-to-word-boundary=Control+Shift+Left
# extend-backward-to-next-whitespace=none
# extend-line-up=Shift+Up
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# scrollback-home=none
# scrollback-end=none
[url-bindings]
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
[text-bindings]
# \x03=Mod4+c # Map Super+c -> Ctrl+c
[mouse-bindings]
# scrollback-up-mouse=BTN_BACK
# scrollback-down-mouse=BTN_FORWARD
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-quote = BTN_LEFT-3
# select-row=BTN_LEFT-4
# vim: ft=dosini

198
.config/hypr/hyprland.conf Normal file
View file

@ -0,0 +1,198 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# start-up programs
exec-once = dinit &
exec-once = light -S 30
#exec-once = swww img $HOME/Pictures/Wallpapers/$(ls $HOME/Pictures/Wallpapers | shuf -n1)
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Set programs that you use
$terminal = foot
$fileManager = lf
$menu = wofi --show drun
$ss = /home/x/.config/wofi/modules/screenshot
# Some default env vars.
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = us
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = no
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 1
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 0
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = off
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = 0 # Set to 0 to disable the anime mascot wallpapers
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic-mouse-v1 {
sensitivity = -0.5
}
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = nomaximizerequest, class:.* # You'll probably like this.
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Return, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, Q, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, B, exec, killall -SIGUSR1 waybar
bind = $mainMod, X, exec, waylock
bind = $mainMod, F, fullscreen
bindr = SUPER, SUPER_L, exec,wofi --show drun
bind = $mainMod, S, exec, $ss
# Move focus with mainMod + arrow keys
#bind = $mainMod, j, movefocus, l
#bind = $mainMod, k, movefocus, r
#bind = $mainMod, k, movefocus, u
#bind = $mainMod, j, movefocus, d
bind = $mainMod, j, cyclenext
bind = $mainMod, k, cyclenext
# window split ratio
bind = $mainMod, L, splitratio, 0.25
bind = $mainMod, H, splitratio, -0.25
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
#bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
bind = $mainMod SHIFT, j, swapnext, none
bind = $mainMod SHIFT, k, swapnext, prev
bind = $mainMod SHIFT, SPACE, togglefloating
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Brightness & Volume
bind = ,F2,exec, brightness --inc
bind = ,F1,exec, brightness --dec
bind = ,F9,exec, volume --inc
bind = ,F8,exec, volume --dec
bind = ,F7,exec, volume --toggle
# hide window
bind = ALT, m, movetoworkspacesilent, special
bind = ALT, p, togglespecialworkspace
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Window Rules
windowrule = immediate,title:^(Need)(.*)$

3
.config/imv/config Normal file
View file

@ -0,0 +1,3 @@
[binds]
j = prev
k = next

174
.config/lf/colors Normal file
View file

@ -0,0 +1,174 @@
# vim:ft=dircolors
# (This is not a dircolors file but it helps to highlight colors and comments)
# default values from dircolors
# (entries with a leading # are not implemented in lf)
# #no 00 # NORMAL
# fi 00 # FILE
# #rs 0 # RESET
# di 01;34 # DIR
# ln 01;36 # LINK
# #mh 00 # MULTIHARDLINK
# pi 40;33 # FIFO
# so 01;35 # SOCK
# #do 01;35 # DOOR
# bd 40;33;01 # BLK
# cd 40;33;01 # CHR
# or 40;31;01 # ORPHAN
# #mi 00 # MISSING
# su 37;41 # SETUID
# sg 30;43 # SETGID
# #ca 30;41 # CAPABILITY
# tw 30;42 # STICKY_OTHER_WRITABLE
# ow 34;42 # OTHER_WRITABLE
# st 37;44 # STICKY
# ex 01;32 # EXEC
# default values from lf (with matching order)
# ln 01;36 # LINK
# or 31;01 # ORPHAN
# tw 01;34 # STICKY_OTHER_WRITABLE
# ow 01;34 # OTHER_WRITABLE
# st 01;34 # STICKY
# di 01;34 # DIR
# pi 33 # FIFO
# so 01;35 # SOCK
# bd 33;01 # BLK
# cd 33;01 # CHR
# su 01;32 # SETUID
# sg 01;32 # SETGID
# ex 01;32 # EXEC
# fi 00 # FILE
# file types (with matching order)
ln 01;36 # LINK
or 31;01 # ORPHAN
tw 34 # STICKY_OTHER_WRITABLE
ow 34 # OTHER_WRITABLE
st 01;34 # STICKY
di 01;34 # DIR
pi 33 # FIFO
so 01;35 # SOCK
bd 33;01 # BLK
cd 33;01 # CHR
su 01;32 # SETUID
sg 01;32 # SETGID
ex 01;32 # EXEC
fi 00 # FILE
# archives or compressed (dircolors defaults)
*.tar 01;31
*.tgz 01;31
*.arc 01;31
*.arj 01;31
*.taz 01;31
*.lha 01;31
*.lz4 01;31
*.lzh 01;31
*.lzma 01;31
*.tlz 01;31
*.txz 01;31
*.tzo 01;31
*.t7z 01;31
*.zip 01;31
*.z 01;31
*.dz 01;31
*.gz 01;31
*.lrz 01;31
*.lz 01;31
*.lzo 01;31
*.xz 01;31
*.zst 01;31
*.tzst 01;31
*.bz2 01;31
*.bz 01;31
*.tbz 01;31
*.tbz2 01;31
*.tz 01;31
*.deb 01;31
*.rpm 01;31
*.jar 01;31
*.war 01;31
*.ear 01;31
*.sar 01;31
*.rar 01;31
*.alz 01;31
*.ace 01;31
*.zoo 01;31
*.cpio 01;31
*.7z 01;31
*.rz 01;31
*.cab 01;31
*.wim 01;31
*.swm 01;31
*.dwm 01;31
*.esd 01;31
# image formats (dircolors defaults)
*.jpg 01;35
*.jpeg 01;35
*.mjpg 01;35
*.mjpeg 01;35
*.gif 01;35
*.bmp 01;35
*.pbm 01;35
*.pgm 01;35
*.ppm 01;35
*.tga 01;35
*.xbm 01;35
*.xpm 01;35
*.tif 01;35
*.tiff 01;35
*.png 01;35
*.svg 01;35
*.svgz 01;35
*.mng 01;35
*.pcx 01;35
*.mov 01;35
*.mpg 01;35
*.mpeg 01;35
*.m2v 01;35
*.mkv 01;35
*.webm 01;35
*.ogm 01;35
*.mp4 01;35
*.m4v 01;35
*.mp4v 01;35
*.vob 01;35
*.qt 01;35
*.nuv 01;35
*.wmv 01;35
*.asf 01;35
*.rm 01;35
*.rmvb 01;35
*.flc 01;35
*.avi 01;35
*.fli 01;35
*.flv 01;35
*.gl 01;35
*.dl 01;35
*.xcf 01;35
*.xwd 01;35
*.yuv 01;35
*.cgm 01;35
*.emf 01;35
*.ogv 01;35
*.ogx 01;35
# audio formats (dircolors defaults)
*.aac 00;36
*.au 00;36
*.flac 00;36
*.m4a 00;36
*.mid 00;36
*.midi 00;36
*.mka 00;36
*.mp3 00;36
*.mpc 00;36
*.ogg 00;36
*.ra 00;36
*.wav 00;36
*.oga 00;36
*.opus 00;36
*.spx 00;36
*.xspf 00;36

387
.config/lf/icons Normal file
View file

@ -0,0 +1,387 @@
# vim:ft=conf
# These examples require Nerd Fonts or a compatible font to be used.
# See https://www.nerdfonts.com for more information.
# default values from lf (with matching order)
# ln l # LINK
# or l # ORPHAN
# tw t # STICKY_OTHER_WRITABLE
# ow d # OTHER_WRITABLE
# st t # STICKY
# di d # DIR
# pi p # FIFO
# so s # SOCK
# bd b # BLK
# cd c # CHR
# su u # SETUID
# sg g # SETGID
# ex x # EXEC
# fi - # FILE
# file types (with matching order)
ln  # LINK
or  # ORPHAN
tw t # STICKY_OTHER_WRITABLE
ow  # OTHER_WRITABLE
st t # STICKY
di  # DIR
pi p # FIFO
so s # SOCK
bd b # BLK
cd c # CHR
su u # SETUID
sg g # SETGID
ex  # EXEC
fi  # FILE
# file extensions (vim-devicons)
*.styl 
*.sass 
*.scss 
*.htm 
*.html 
*.slim 
*.haml 
*.ejs 
*.css 
*.less 
*.md 
*.mdx 
*.markdown 
*.rmd 
*.json 
*.webmanifest 
*.js 
*.mjs 
*.jsx 
*.rb 
*.gemspec 
*.rake 
*.php 
*.py 
*.pyc 
*.pyo 
*.pyd 
*.coffee 
*.mustache 
*.hbs 
*.conf 
*.ini 
*.yml 
*.yaml 
*.toml 
*.bat 
*.mk 
*.jpg 
*.jpeg 
*.bmp 
*.png 
*.webp 
*.gif 
*.ico 
*.twig 
*.cpp 
*.c++ 
*.cxx 
*.cc 
*.cp 
*.c 
*.cs 
*.h 
*.hh 
*.hpp 
*.hxx 
*.hs 
*.lhs 
*.nix 
*.lua 
*.java 
*.sh 
*.fish 
*.bash 
*.zsh 
*.ksh 
*.csh 
*.awk 
*.ps1 
*.ml λ
*.mli λ
*.diff 
*.db 
*.sql 
*.dump 
*.clj 
*.cljc 
*.cljs 
*.edn 
*.scala 
*.go 
*.dart 
*.xul 
*.sln 
*.suo 
*.pl 
*.pm 
*.t 
*.rss 
'*.f#' 
*.fsscript 
*.fsx 
*.fs 
*.fsi 
*.rs 
*.rlib 
*.d 
*.erl 
*.hrl 
*.ex 
*.exs 
*.eex 
*.leex 
*.heex 
*.vim 
*.ai 
*.psd 
*.psb 
*.ts 
*.tsx 
*.jl 
*.pp 
*.vue ﵂
*.elm 
*.swift 
*.xcplayground 
*.tex ﭨ
*.r ﳒ
*.rproj 鉶
*.sol ﲹ
*.pem 
# file names (vim-devicons) (case-insensitive not supported in lf)
*gruntfile.coffee 
*gruntfile.js 
*gruntfile.ls 
*gulpfile.coffee 
*gulpfile.js 
*gulpfile.ls 
*mix.lock 
*dropbox 
*.ds_store 
*.gitconfig 
*.gitignore 
*.gitattributes 
*.gitlab-ci.yml 
*.bashrc 
*.zshrc 
*.zshenv 
*.zprofile 
*.vimrc 
*.gvimrc 
*_vimrc 
*_gvimrc 
*.bashprofile 
*favicon.ico 
*license 
*node_modules 
*react.jsx 
*procfile 
*dockerfile 
*docker-compose.yml 
*rakefile 
*config.ru 
*gemfile 
*makefile 
*cmakelists.txt 
*robots.txt
# file names (case-sensitive adaptations)
*Gruntfile.coffee 
*Gruntfile.js 
*Gruntfile.ls 
*Gulpfile.coffee 
*Gulpfile.js 
*Gulpfile.ls 
*Dropbox 
*.DS_Store 
*LICENSE 
*React.jsx 
*Procfile 
*Dockerfile 
*Docker-compose.yml 
*Rakefile 
*Gemfile 
*Makefile 
*CMakeLists.txt 
# file patterns (vim-devicons) (patterns not supported in lf)
# .*jquery.*\.js$ 
# .*angular.*\.js$ 
# .*backbone.*\.js$ 
# .*require.*\.js$ 
# .*materialize.*\.js$ 
# .*materialize.*\.css$ 
# .*mootools.*\.js$ 
# .*vimrc.* 
# Vagrantfile$ 
# file patterns (file name adaptations)
*jquery.min.js 
*angular.min.js 
*backbone.min.js 
*require.min.js 
*materialize.min.js 
*materialize.min.css 
*mootools.min.js 
*vimrc 
Vagrantfile 
# archives or compressed (extensions from dircolors defaults)
*.tar 
*.tgz 
*.arc 
*.arj 
*.taz 
*.lha 
*.lz4 
*.lzh 
*.lzma 
*.tlz 
*.txz 
*.tzo 
*.t7z 
*.zip 
*.z 
*.dz 
*.gz 
*.lrz 
*.lz 
*.lzo 
*.xz 
*.zst 
*.tzst 
*.bz2 
*.bz 
*.tbz 
*.tbz2 
*.tz 
*.deb 
*.rpm 
*.jar 
*.war 
*.ear 
*.sar 
*.rar 
*.alz 
*.ace 
*.zoo 
*.cpio 
*.7z 
*.rz 
*.cab 
*.wim 
*.swm 
*.dwm 
*.esd 
# image formats (extensions from dircolors defaults)
*.jpg 
*.jpeg 
*.mjpg 
*.mjpeg 
*.gif 󰵸
*.bmp 
*.pbm 
*.pgm 
*.ppm 
*.tga 
*.xbm 
*.xpm 
*.tif 
*.tiff 
*.png 
*.svg 
*.svgz 
*.mng 
*.pcx 
*.ogm 
*.qt 
*.nuv 
*.wmv 
*.asf 
*.rm 
*.rmvb 
*.flc 
*.avi 
*.fli 
*.flv 
*.gl 
*.dl 
*.xcf 
*.xwd 
*.yuv 
*.cgm 
*.emf 
*.ogv 
*.ogx 
# audio formats (extensions from dircolors defaults)
*.aac 
*.au 
*.flac 
*.m4a 
*.mid 
*.midi 
*.mka 
*.mp3 
*.mpc 
*.ogg 
*.ra 
*.wav 
*.oga 
*.opus 
*.spx 
*.xspf 
# video formats
*.web 
*.mkv 
*.flv 
*.vob 
*.ogv 
*.ogg 
*.rrc 
*.gif 
*.mng 
*.mov 
*.avi 
*.qt 
*.wmv 
*.yuv 
*.rm 
*.asf 
*.amv 
*.mp4 
*.m4p 
*.m4v 
*.mpg 
*.mp2 
*.mpe 
*.mpe 
*.mpv 
*.m4v 
*.svi 
*.3gp 
*.3g2 
*.mxf 
*.roq 
*.nsv 
*.flv 
*.f4v 
*.f4p 
*.f4a 
*.f4b 
*.mod 
# other formats
*.pdf 

131
.config/lf/lfrc Normal file
View file

@ -0,0 +1,131 @@
set shellopts '-eu'
set ifs "\n"
set scrolloff 10
set icons
set sixel
set period 1
set hiddenfiles ".*:*.aux:*.bbl:*.bcf:*.blg:*.run.xml"
set cleaner '~/.config/lf/cleaner'
set previewer '~/.cache/go/bin/pistol'
# cmds/functions
cmd open ${{
case $(file --mime-type "$(readlink -f $f)" -b) in
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) localc $fx ;;
image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;;
text/*|application/json|inode/x-empty) $EDITOR $fx;;
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;
image/svg+xml) display -- $f ;;
image/*) rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|avif\|webp\|tif\|ico\)\(_large\)*$" |
setsid -f imv -s shrink 2>/dev/null | while read -r file; do
[ -z "$file" ] && continue
lf -remote "send select \"$file\""
lf -remote "send toggle"
done &
;;
audio/*) mpv --audio-display=no $f ;;
video/*) setsid -f mpv $f -quiet >/dev/null 2>&1 ;;
application/pdf|application/vnd*|application/epub*) setsid -f zathura $fx >/dev/null 2>&1 ;;
application/pgp-encrypted) $EDITOR $fx ;;
*) for f in $fx; do setsid -f $OPENER $f >/dev/null 2>&1; done;;
esac
}}
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
cmd extract ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f
printf "%s\n\t" "$fx"
printf "extract?[y/N]"
read ans
[ $ans = "y" ] && aunpack $fx
}}
cmd moveto ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f
clear; echo "Move to where?"
dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
for x in $fx; do
eval mv -iv \"$x\" \"$dest\"
done &&
notify-send "🚚 File(s) moved." "File(s) moved to $dest."
}}
cmd copyto ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f
clear; echo "Copy to where?"
dest="$(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed 's|~|$HOME|')" &&
for x in $fx; do
eval cp -ivr \"$x\" \"$dest\"
done &&
notify-send "📋 File(s) copied." "File(s) copies to $dest."
}}
cmd catboxup ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f
catbox file "$fx"
}}
cmd webmconvert ${{
clear; tput cup $(($(tput lines)/3)); tput bold
set -f
webm "$fx"
}}
cmd recol ${{
w=$(tput cols)
if [ $w -le 80 ]; then
lf -remote "send $id set ratios 1:2"
elif [ $w -le 160 ]; then
lf -remote "send $id set ratios 1:2:3"
else
lf -remote "send $id set ratios 1:2:3:5"
fi
}}
cmd setbg "$1"
cmd bulkrename $vidir
# Bindings
map <c-f> $lf -remote "send $id select '$(fzf)'"
map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)"
map g top
map n cd
map D delete
map E extract
map C copyto
map M moveto
map z catboxup
map s clear
map Z webmconvert
map <c-n> push :mkdir<space>
map <c-r> reload
map <c-s> set hidden!
map <enter> shell
map x $$f
map X !$f
map o &mimeopen $f
map O $mimeopen --ask $f
map A rename # at the very end
map c push A<c-u> # new rename
map I push A<c-a> # at the very beginning
map i push A<a-b><a-b><a-f> # before extension
map a push A<a-b> # after extension
map B bulkrename
map b $setbg $f
map <c-e> down
map <c-y> up
map <c-o> quit
map V push :!nvim<space>
map W $setsid -f $TERMINAL >/dev/null 2>&1
map Y $printf "%s" "$fx" | xclip -selection clipboard

12
.config/lf/scope Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
case "$(file -Lb --mime-type -- "$1")" in
image/*)
chafa -f sixel -s "$2x$3" --animate off --polite on "$1"
exit 1
;;
text/html)
lynx -width="$4" -display_charset=utf-8 -dump "$1"
;;
esac

18
.config/mpd/mpd.conf Normal file
View file

@ -0,0 +1,18 @@
music_directory "~/Music"
playlist_directory "~/.config/mpd/playlists"
db_file "~/.config/mpd/mpd.db"
log_file "~/.config/mpd/mpd.log"
pid_file "~/.config/mpd/mpd.pid"
state_file "~/.config/mpd/mpdstate"
audio_output {
type "pulse"
name "pulse audio"
}
audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}

179
.config/mpv/input.conf Normal file
View file

@ -0,0 +1,179 @@
# mpv keybindings
#
# Location of user-defined bindings: ~/.config/mpv/input.conf
#
# Lines starting with # are comments. Use SHARP to assign the # key.
# Copy this file and uncomment and edit the bindings you want to change.
#
# List of commands and further details: DOCS/man/input.rst
# List of special keys: --input-keylist
# Keybindings testing mode: mpv --input-test --force-window --idle
#
# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore').
#
# Strings need to be quoted and escaped:
# KEY show-text "This is a single backslash: \\ and a quote: \" !"
#
# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with
# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal).
#
# The default keybindings are hardcoded into the mpv binary.
# You can disable them completely with: --no-input-default-bindings
# Developer note:
# On compilation, this file is baked into the mpv binary, and all lines are
# uncommented (unless '#' is followed by a space) - thus this file defines the
# default key bindings.
# If this is enabled, treat all the following bindings as default.
#default-bindings start
#MBTN_LEFT ignore # don't do anything
#MBTN_LEFT_DBL cycle fullscreen # toggle fullscreen
#MBTN_RIGHT cycle pause # toggle pause/playback mode
#MBTN_BACK playlist-prev # skip to the previous file
#MBTN_FORWARD playlist-next # skip to the next file
# Mouse wheels, touchpad or other input devices that have axes
# if the input devices supports precise scrolling it will also scale the
# numeric value accordingly
#WHEEL_UP seek 10 # seek 10 seconds forward
#WHEEL_DOWN seek -10 # seek 10 seconds backward
#WHEEL_LEFT add volume -2
#WHEEL_RIGHT add volume 2
## Seek units are in seconds, but note that these are limited by keyframes
#RIGHT seek 5 # seek 5 seconds forward
#LEFT seek -5 # seek 5 seconds backward
#UP seek 60 # seek 1 minute forward
#DOWN seek -60 # seek 1 minute backward
# Do smaller, always exact (non-keyframe-limited), seeks with shift.
# Don't show them on the OSD (no-osd).
#Shift+RIGHT no-osd seek 1 exact # seek exactly 1 second forward
#Shift+LEFT no-osd seek -1 exact # seek exactly 1 second backward
#Shift+UP no-osd seek 5 exact # seek exactly 5 seconds forward
#Shift+DOWN no-osd seek -5 exact # seek exactly 5 seconds backward
#Ctrl+LEFT no-osd sub-seek -1 # seek to the previous subtitle
#Ctrl+RIGHT no-osd sub-seek 1 # seek to the next subtitle
#Ctrl+Shift+LEFT sub-step -1 # change subtitle timing such that the previous subtitle is displayed
#Ctrl+Shift+RIGHT sub-step 1 # change subtitle timing such that the next subtitle is displayed
#Alt+left add video-pan-x 0.1 # move the video right
#Alt+right add video-pan-x -0.1 # move the video left
#Alt+up add video-pan-y 0.1 # move the video down
#Alt+down add video-pan-y -0.1 # move the video up
#Alt++ add video-zoom 0.1 # zoom in
#Alt+- add video-zoom -0.1 # zoom out
#Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 # reset zoom and pan settings
#PGUP add chapter 1 # seek to the next chapter
#PGDWN add chapter -1 # seek to the previous chapter
#Shift+PGUP seek 600 # seek 10 minutes forward
#Shift+PGDWN seek -600 # seek 10 minutes backward
#[ multiply speed 1/1.1 # decrease the playback speed
#] multiply speed 1.1 # increase the playback speed
#{ multiply speed 0.5 # halve the playback speed
#} multiply speed 2.0 # double the playback speed
#BS set speed 1.0 # reset the speed to normal
#Shift+BS revert-seek # undo the previous (or marked) seek
#Shift+Ctrl+BS revert-seek mark # mark the position for revert-seek
#q quit
#Q quit-watch-later # exit and remember the playback position
#q {encode} quit 4
#ESC set fullscreen no # leave fullscreen
#ESC {encode} quit 4
#p cycle pause # toggle pause/playback mode
#. frame-step # advance one frame and pause
#, frame-back-step # go back by one frame and pause
#SPACE cycle pause # toggle pause/playback mode
#> playlist-next # skip to the next file
#ENTER playlist-next # skip to the next file
#< playlist-prev # skip to the previous file
#O no-osd cycle-values osd-level 3 1 # toggle displaying the OSD on user interaction or always
#o show-progress # show playback progress
#P show-progress # show playback progress
#i script-binding stats/display-stats # display information and statistics
#I script-binding stats/display-stats-toggle # toggle displaying information and statistics
#` script-binding console/enable # open the console
#z add sub-delay -0.1 # shift subtitles 100 ms earlier
#Z add sub-delay +0.1 # delay subtitles by 100 ms
#x add sub-delay +0.1 # delay subtitles by 100 ms
#ctrl++ add audio-delay 0.100 # change audio/video sync by delaying the audio
#ctrl+- add audio-delay -0.100 # change audio/video sync by shifting the audio earlier
#Shift+g add sub-scale +0.1 # increase the subtitle font size
#Shift+f add sub-scale -0.1 # decrease the subtitle font size
#9 add volume -2
#/ add volume -2
#0 add volume 2
#* add volume 2
#m cycle mute # toggle mute
#1 add contrast -1
#2 add contrast 1
#3 add brightness -1
#4 add brightness 1
#5 add gamma -1
#6 add gamma 1
#7 add saturation -1
#8 add saturation 1
#Alt+0 set current-window-scale 0.5 # halve the window size
#Alt+1 set current-window-scale 1.0 # reset the window size
#Alt+2 set current-window-scale 2.0 # double the window size
#d cycle deinterlace # toggle the deinterlacing filter
#r add sub-pos -1 # move subtitles up
#R add sub-pos +1 # move subtitles down
#t add sub-pos +1 # move subtitles down
#v cycle sub-visibility # hide or show the subtitles
#Alt+v cycle secondary-sub-visibility # hide or show the secondary subtitles
#V cycle sub-ass-vsfilter-aspect-compat # toggle stretching SSA/ASS subtitles with anamorphic videos to match the historical renderer
#u cycle-values sub-ass-override "force" "no" # toggle overriding SSA/ASS subtitle styles with the normal styles
#j cycle sub # switch subtitle track
#J cycle sub down # switch subtitle track backwards
#SHARP cycle audio # switch audio track
#_ cycle video # switch video track
#T cycle ontop # toggle placing the video on top of other windows
#f cycle fullscreen # toggle fullscreen
#s screenshot # take a screenshot of the video in its original resolution with subtitles
#S screenshot video # take a screenshot of the video in its original resolution without subtitles
#Ctrl+s screenshot window # take a screenshot of the window with OSD and subtitles
#Alt+s screenshot each-frame # automatically screenshot every frame; issue this command again to stop taking screenshots
#w add panscan -0.1 # decrease panscan
#W add panscan +0.1 # shrink black bars by cropping the video
#e add panscan +0.1 # shrink black bars by cropping the video
#A cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1" # cycle the video aspect ratio ("-1" is the container aspect)
#POWER quit
#PLAY cycle pause # toggle pause/playback mode
#PAUSE cycle pause # toggle pause/playback mode
#PLAYPAUSE cycle pause # toggle pause/playback mode
#PLAYONLY set pause no # unpause
#PAUSEONLY set pause yes # pause
#STOP quit
#FORWARD seek 60 # seek 1 minute forward
#REWIND seek -60 # seek 1 minute backward
#NEXT playlist-next # skip to the next file
#PREV playlist-prev # skip to the previous file
#VOLUME_UP add volume 2
#VOLUME_DOWN add volume -2
#MUTE cycle mute # toggle mute
#CLOSE_WIN quit
#CLOSE_WIN {encode} quit 4
#ctrl+w quit
#E cycle edition # switch edition
#l ab-loop # set/clear A-B loop points
#L cycle-values loop-file "inf" "no" # toggle infinite looping
#ctrl+c quit 4
#DEL script-binding osc/visibility # cycle OSC visibility between never, auto (mouse-move) and always
#ctrl+h cycle-values hwdec "auto" "no" # toggle hardware decoding
#F8 show-text ${playlist} # show the playlist
#F9 show-text ${track-list} # show the list of video, audio and sub tracks
#
# Legacy bindings (may or may not be removed in the future)
#
#! add chapter -1 # seek to the previous chapter
#@ add chapter 1 # seek to the next chapter
#
# Not assigned by default
# (not an exhaustive list of unbound commands)
#
# ? cycle sub-forced-only # toggle DVD forced subs
# ? stop # stop playback (quit or enter idle mode)

View file

@ -0,0 +1,93 @@
##
## MPlayer-style key bindings
##
## Save it as ~/.config/mpv/input.conf to use it.
##
## Generally, it's recommended to use this as reference-only.
##
RIGHT seek +10
LEFT seek -10
DOWN seek -60
UP seek +60
PGUP seek 600
PGDWN seek -600
m cycle mute
SHARP cycle audio # switch audio streams
+ add audio-delay 0.100
= add audio-delay 0.100
- add audio-delay -0.100
[ multiply speed 0.9091 # scale playback speed
] multiply speed 1.1
{ multiply speed 0.5
} multiply speed 2.0
BS set speed 1.0 # reset speed to normal
q quit
ESC quit
ENTER playlist-next force # skip to next file
p cycle pause
. frame-step # advance one frame and pause
SPACE cycle pause
HOME set playlist-pos 0 # not the same as MPlayer
#END pt_up_step -1
> playlist-next # skip to next file
< playlist-prev # previous
#INS alt_src_step 1
#DEL alt_src_step -1
o osd
I show-text "${filename}" # display filename in osd
P show-progress
z add sub-delay -0.1 # subtract 100 ms delay from subs
x add sub-delay +0.1 # add
9 add volume -1
/ add volume -1
0 add volume 1
* add volume 1
1 add contrast -1
2 add contrast 1
3 add brightness -1
4 add brightness 1
5 add hue -1
6 add hue 1
7 add saturation -1
8 add saturation 1
( add balance -0.1 # adjust audio balance in favor of left
) add balance +0.1 # right
d cycle framedrop
D cycle deinterlace # toggle deinterlacer (auto-inserted filter)
r add sub-pos -1 # move subtitles up
t add sub-pos +1 # down
#? sub-step +1 # immediately display next subtitle
#? sub-step -1 # previous
#? add sub-scale +0.1 # increase subtitle font size
#? add sub-scale -0.1 # decrease subtitle font size
f cycle fullscreen
T cycle ontop # toggle video window ontop of other windows
w add panscan -0.1 # zoom out with -panscan 0 -fs
e add panscan +0.1 # in
c cycle stream-capture # save (and append) file/stream to stream.dump with -capture
s screenshot # take a screenshot (if you want PNG, use "--screenshot-format=png")
S screenshot - each-frame # S will take a png screenshot of every frame
h cycle tv-channel 1
l cycle tv-channel -1
n cycle tv-norm
#b tv_step_chanlist
#? add chapter -1 # skip to previous dvd chapter
#? add chapter +1 # next
##
## Advanced seek
## Uncomment the following lines to be able to seek to n% of the media with
## the Fx keys.
##
#F1 seek 10 absolute-percent
#F2 seek 20 absolute-percent
#F3 seek 30 absolute-percent
#F4 seek 40 absolute-percent
#F5 seek 50 absolute-percent
#F6 seek 60 absolute-percent
#F7 seek 70 absolute-percent
#F8 seek 80 absolute-percent
#F9 seek 90 absolute-percent

55
.config/mpv/mpv.conf Normal file
View file

@ -0,0 +1,55 @@
# General Stuff
# profile=gpu-hq
# vo=gpu
# gpu-api=opengl
# vd-lavc-dr=yes
# spirv-compiler=auto
# Resizers
# scale=ewa_lanczos
# dscale=ewa_lanczos
# cscale=sinc
# cscale-window=blackman
# cscale-radius=3
# Debanding
# deband=yes
# deband-iterations=4
# deband-threshold=48
# deband-range=18
# deband-grain=32
# starting volume
volume=30
volume-max=200
audio-file-auto=fuzzy
audio-pitch-correction=yes
# Subtitles
demuxer-mkv-subtitle-preroll=yes
sub-ass-vsfilter-blur-compat=yes
sub-fix-timing=yes
# Track Selection
slang=en,eng
alang=ja,jpn,ko,kor,en,eng
# Screenshot
screenshot-format=png
screenshot-high-bit-depth=yes
screenshot-tag-colorspace=yes
screenshot-png-compression=9
screenshot-directory="~/Pictures/Screenshots/mpv/"
#screenshot-template="mpvshot-%03n %tHh%tMm%tSs"
screenshot-template="%F-%03n %tHh%tMm%tSs"
# Streaming
hls-bitrate=max
ytdl-raw-options=ignore-errors=
load-unsafe-playlists=yes
ytdl-format=bestvideo[height<=?1080]+bestaudio/best
user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36"
# Other
save-position-on-quit

View file

@ -0,0 +1,61 @@
# This file contains all bindings that were removed after a certain release.
# If you want MPlayer bindings, use mplayer-input.conf
# Pick the bindings you want back and add them to your own input.conf. Append
# this file to your input.conf if you want them all back:
#
# cat restore-old-bindings.conf >> ~/.config/mpv/input.conf
#
# Older installations use ~/.mpv/input.conf instead.
# changed in mpv 0.27.0 (macOS and Wayland only)
# WHEEL_UP seek 10
# WHEEL_DOWN seek -10
# WHEEL_LEFT seek 5
# WHEEL_RIGHT seek -5
# changed in mpv 0.26.0
h cycle tv-channel -1 # previous channel
k cycle tv-channel +1 # next channel
H cycle dvb-channel-name -1 # previous channel
K cycle dvb-channel-name +1 # next channel
I show-text "${filename}" # display filename in osd
# changed in mpv 0.24.0
L cycle-values loop "inf" "no"
# changed in mpv 0.10.0
O osd
D cycle deinterlace
d cycle framedrop
# changed in mpv 0.7.0
ENTER playlist-next force
# changed in mpv 0.6.0
ESC quit
# changed in mpv 0.5.0
PGUP seek 600
PGDWN seek -600
RIGHT seek 10
LEFT seek -10
+ add audio-delay 0.100
- add audio-delay -0.100
( add balance -0.1
) add balance 0.1
F cycle sub-forced-only
TAB cycle program
A cycle angle
U stop
o osd
I show-text "${filename}"

View file

@ -0,0 +1,170 @@
# PulseAudio config file for PipeWire version "1.0.3" #
#
# Copy and edit this file in /etc/pipewire for system-wide changes
# or in ~/.config/pipewire for local changes.
#
# It is also possible to place a file with an updated section in
# /etc/pipewire/pipewire-pulse.conf.d/ for system-wide changes or in
# ~/.config/pipewire/pipewire-pulse.conf.d/ for local changes.
#
context.properties = {
## Configure properties in the system.
#mem.warn-mlock = false
#mem.allow-mlock = true
#mem.mlock-all = false
#log.level = 2
#default.clock.quantum-limit = 8192
}
context.spa-libs = {
audio.convert.* = audioconvert/libspa-audioconvert
support.* = support/libspa-support
}
context.modules = [
{ name = libpipewire-module-rt
args = {
nice.level = -11
#rt.prio = 88
rt.prio = 65
#rt.time.soft = -1
#rt.time.hard = -1
#uclamp.min = 0
#uclamp.max = 1024
}
flags = [ ifexists nofail ]
}
{ name = libpipewire-module-protocol-native }
{ name = libpipewire-module-client-node }
{ name = libpipewire-module-adapter }
{ name = libpipewire-module-metadata }
{ name = libpipewire-module-protocol-pulse
args = {
# contents of pulse.properties can also be placed here
# to have config per server.
}
}
]
# Extra scripts can be started here. Setup in default.pa can be moved in
# a script or in pulse.cmd below
context.exec = [
#{ path = "pactl" args = "load-module module-always-sink" }
#{ path = "pactl" args = "upload-sample my-sample.wav my-sample" }
#{ path = "/usr/bin/sh" args = "~/.config/pipewire/default.pw" }
]
# Extra commands can be executed here.
# load-module : loads a module with args and flags
# args = "<module-name> <module-args>"
# ( flags = [ nofail ] )
pulse.cmd = [
{ cmd = "load-module" args = "module-always-sink" flags = [ ] }
#{ cmd = "load-module" args = "module-switch-on-connect" }
#{ cmd = "load-module" args = "module-gsettings" flags = [ nofail ] }
]
stream.properties = {
#node.latency = 1024/48000
#node.autoconnect = true
#resample.quality = 4
#channelmix.normalize = false
#channelmix.mix-lfe = true
#channelmix.upmix = true
#channelmix.upmix-method = psd # none, simple
#channelmix.lfe-cutoff = 150
#channelmix.fc-cutoff = 12000
#channelmix.rear-delay = 12.0
#channelmix.stereo-widen = 0.0
#channelmix.hilbert-taps = 0
#dither.noise = 0
}
pulse.properties = {
# the addresses this server listens on
server.address = [
"unix:native"
#"unix:/tmp/something" # absolute paths may be used
#"tcp:4713" # IPv4 and IPv6 on all addresses
#"tcp:[::]:9999" # IPv6 on all addresses
#"tcp:127.0.0.1:8888" # IPv4 on a single address
#
#{ address = "tcp:4713" # address
# max-clients = 64 # maximum number of clients
# listen-backlog = 32 # backlog in the server listen queue
# client.access = "restricted" # permissions for clients
#}
]
#server.dbus-name = "org.pulseaudio.Server"
#pulse.min.req = 128/48000 # 2.7ms
#pulse.default.req = 960/48000 # 20 milliseconds
#pulse.min.frag = 128/48000 # 2.7ms
#pulse.default.frag = 96000/48000 # 2 seconds
#pulse.default.tlength = 96000/48000 # 2 seconds
#pulse.min.quantum = 128/48000 # 2.7ms
#pulse.idle.timeout = 0 # don't pause after underruns
#pulse.default.format = F32
#pulse.default.position = [ FL FR ]
# These overrides are only applied when running in a vm.
vm.overrides = {
pulse.min.quantum = 1024/48000 # 22ms
}
}
# client/stream specific properties
pulse.rules = [
{
matches = [
{
# all keys must match the value. ! negates. ~ starts regex.
#client.name = "Firefox"
#application.process.binary = "teams"
#application.name = "~speech-dispatcher.*"
}
]
actions = {
update-props = {
#node.latency = 512/48000
}
# Possible quirks:"
# force-s16-info forces sink and source info as S16 format
# remove-capture-dont-move removes the capture DONT_MOVE flag
# block-source-volume blocks updates to source volume
# block-sink-volume blocks updates to sink volume
#quirks = [ ]
}
}
{
# skype does not want to use devices that don't have an S16 sample format.
matches = [
{ application.process.binary = "teams" }
{ application.process.binary = "teams-insiders" }
{ application.process.binary = "skypeforlinux" }
]
actions = { quirks = [ force-s16-info ] }
}
{
# firefox marks the capture streams as don't move and then they
# can't be moved with pavucontrol or other tools.
matches = [ { application.process.binary = "firefox" } ]
actions = { quirks = [ remove-capture-dont-move ] }
}
{
# speech dispatcher asks for too small latency and then underruns.
matches = [ { application.name = "~speech-dispatcher.*" } ]
actions = {
update-props = {
pulse.min.req = 512/48000 # 10.6ms
pulse.min.quantum = 512/48000 # 10.6ms
pulse.idle.timeout = 5 # pause after 5 seconds of underrun
}
}
}
#{
# matches = [ { application.process.binary = "Discord" } ]
# actions = { quirks = [ block-source-volume ] }
#}
]

View file

@ -0,0 +1,318 @@
# Daemon config file for PipeWire version "1.0.3" #
#
# Copy and edit this file in /etc/pipewire for system-wide changes
# or in ~/.config/pipewire for local changes.
#
# It is also possible to place a file with an updated section in
# /etc/pipewire/pipewire.conf.d/ for system-wide changes or in
# ~/.config/pipewire/pipewire.conf.d/ for local changes.
#
context.properties = {
## Configure properties in the system.
#library.name.system = support/libspa-support
#context.data-loop.library.name.system = support/libspa-support
#support.dbus = true
#link.max-buffers = 64
link.max-buffers = 16 # version < 3 clients can't handle more
#mem.warn-mlock = false
#mem.allow-mlock = true
#mem.mlock-all = false
#clock.power-of-two-quantum = true
#log.level = 2
#cpu.zero.denormals = false
core.daemon = true # listening for socket connections
core.name = pipewire-0 # core name and socket name
## Properties for the DSP configuration.
#default.clock.rate = 48000
#default.clock.allowed-rates = [ 48000 ]
#default.clock.quantum = 1024
#default.clock.min-quantum = 32
#default.clock.max-quantum = 2048
#default.clock.quantum-limit = 8192
#default.video.width = 640
#default.video.height = 480
#default.video.rate.num = 25
#default.video.rate.denom = 1
#
#settings.check-quantum = false
#settings.check-rate = false
#
# These overrides are only applied when running in a vm.
vm.overrides = {
default.clock.min-quantum = 1024
}
# keys checked below to disable module loading
module.x11.bell = true
# enables autoloading of access module, when disabled an alternative
# access module needs to be loaded.
module.access = true
# enables autoloading of module-jackdbus-detect
module.jackdbus-detect = true
}
context.spa-libs = {
#<factory-name regex> = <library-name>
#
# Used to find spa factory names. It maps an spa factory name
# regular expression to a library name that should contain
# that factory.
#
audio.convert.* = audioconvert/libspa-audioconvert
avb.* = avb/libspa-avb
api.alsa.* = alsa/libspa-alsa
api.v4l2.* = v4l2/libspa-v4l2
api.libcamera.* = libcamera/libspa-libcamera
api.bluez5.* = bluez5/libspa-bluez5
api.vulkan.* = vulkan/libspa-vulkan
api.jack.* = jack/libspa-jack
support.* = support/libspa-support
#videotestsrc = videotestsrc/libspa-videotestsrc
#audiotestsrc = audiotestsrc/libspa-audiotestsrc
}
context.modules = [
#{ name = <module-name>
# ( args = { <key> = <value> ... } )
# ( flags = [ ( ifexists ) ( nofail ) ] )
# ( condition = [ { <key> = <value> ... } ... ] )
#}
#
# Loads a module with the given parameters.
# If ifexists is given, the module is ignored when it is not found.
# If nofail is given, module initialization failures are ignored.
# If condition is given, the module is loaded only when the context
# properties all match the match rules.
#
# Uses realtime scheduling to boost the audio thread priorities. This uses
# RTKit if the user doesn't have permission to use regular realtime
# scheduling. You can also clamp utilisation values to improve scheduling
# on embedded and heterogeneous systems, e.g. Arm big.LITTLE devices.
{ name = libpipewire-module-rt
args = {
nice.level = -11
#rt.prio = 88
#rt.time.soft = -1
#rt.time.hard = -1
#uclamp.min = 0
#uclamp.max = 1024
}
flags = [ ifexists nofail ]
}
# The native communication protocol.
{ name = libpipewire-module-protocol-native
args = {
# List of server Unix sockets, and optionally permissions
#sockets = [ { name = "pipewire-0" }, { name = "pipewire-0-manager" } ]
}
}
# The profile module. Allows application to access profiler
# and performance data. It provides an interface that is used
# by pw-top and pw-profiler.
{ name = libpipewire-module-profiler }
# Allows applications to create metadata objects. It creates
# a factory for Metadata objects.
{ name = libpipewire-module-metadata }
# Creates a factory for making devices that run in the
# context of the PipeWire server.
{ name = libpipewire-module-spa-device-factory }
# Creates a factory for making nodes that run in the
# context of the PipeWire server.
{ name = libpipewire-module-spa-node-factory }
# Allows creating nodes that run in the context of the
# client. Is used by all clients that want to provide
# data to PipeWire.
{ name = libpipewire-module-client-node }
# Allows creating devices that run in the context of the
# client. Is used by the session manager.
{ name = libpipewire-module-client-device }
# The portal module monitors the PID of the portal process
# and tags connections with the same PID as portal
# connections.
{ name = libpipewire-module-portal
flags = [ ifexists nofail ]
}
# The access module can perform access checks and block
# new clients.
{ name = libpipewire-module-access
args = {
# Socket-specific access permissions
#access.socket = { pipewire-0 = "default", pipewire-0-manager = "unrestricted" }
# Deprecated legacy mode (not socket-based),
# for now enabled by default if access.socket is not specified
#access.legacy = true
}
condition = [ { module.access = true } ]
}
# Makes a factory for wrapping nodes in an adapter with a
# converter and resampler.
{ name = libpipewire-module-adapter }
# Makes a factory for creating links between ports.
{ name = libpipewire-module-link-factory }
# Provides factories to make session manager objects.
{ name = libpipewire-module-session-manager }
# Use libcanberra to play X11 Bell
{ name = libpipewire-module-x11-bell
args = {
#sink.name = "@DEFAULT_SINK@"
#sample.name = "bell-window-system"
#x11.display = null
#x11.xauthority = null
}
flags = [ ifexists nofail ]
condition = [ { module.x11.bell = true } ]
}
{ name = libpipewire-module-jackdbus-detect
args = {
#jack.library = libjack.so.0
#jack.server = null
#jack.client-name = PipeWire
#jack.connect = true
#tunnel.mode = duplex # source|sink|duplex
source.props = {
#audio.channels = 2
#midi.ports = 1
#audio.position = [ FL FR ]
# extra sink properties
}
sink.props = {
#audio.channels = 2
#midi.ports = 1
#audio.position = [ FL FR ]
# extra sink properties
}
}
flags = [ ifexists nofail ]
condition = [ { module.jackdbus-detect = true } ]
}
]
context.objects = [
#{ factory = <factory-name>
# ( args = { <key> = <value> ... } )
# ( flags = [ ( nofail ) ] )
# ( condition = [ { <key> = <value> ... } ... ] )
#}
#
# Creates an object from a PipeWire factory with the given parameters.
# If nofail is given, errors are ignored (and no object is created).
# If condition is given, the object is created only when the context properties
# all match the match rules.
#
#{ factory = spa-node-factory args = { factory.name = videotestsrc node.name = videotestsrc node.description = videotestsrc "Spa:Pod:Object:Param:Props:patternType" = 1 } }
#{ factory = spa-device-factory args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] }
#{ factory = spa-device-factory args = { factory.name = api.alsa.enum.udev } }
#{ factory = spa-node-factory args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } }
#{ factory = adapter args = { factory.name = audiotestsrc node.name = my-test node.description = audiotestsrc } }
#{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } }
# A default dummy driver. This handles nodes marked with the "node.always-process"
# property when no other driver is currently active. JACK clients need this.
{ factory = spa-node-factory
args = {
factory.name = support.node.driver
node.name = Dummy-Driver
node.group = pipewire.dummy
priority.driver = 20000
#clock.id = monotonic # realtime | tai | monotonic-raw | boottime
#clock.name = "clock.system.monotonic"
}
}
{ factory = spa-node-factory
args = {
factory.name = support.node.driver
node.name = Freewheel-Driver
priority.driver = 19000
node.group = pipewire.freewheel
node.freewheel = true
}
}
# This creates a new Source node. It will have input ports
# that you can link, to provide audio for this source.
#{ factory = adapter
# args = {
# factory.name = support.null-audio-sink
# node.name = "my-mic"
# node.description = "Microphone"
# media.class = "Audio/Source/Virtual"
# audio.position = "FL,FR"
# }
#}
# This creates a single PCM source device for the given
# alsa device path hw:0. You can change source to sink
# to make a sink in the same way.
#{ factory = adapter
# args = {
# factory.name = api.alsa.pcm.source
# node.name = "alsa-source"
# node.description = "PCM Source"
# media.class = "Audio/Source"
# api.alsa.path = "hw:0"
# api.alsa.period-size = 1024
# api.alsa.headroom = 0
# api.alsa.disable-mmap = false
# api.alsa.disable-batch = false
# audio.format = "S16LE"
# audio.rate = 48000
# audio.channels = 2
# audio.position = "FL,FR"
# }
#}
# Use the metadata factory to create metadata and some default values.
#{ factory = metadata
# args = {
# metadata.name = my-metadata
# metadata.values = [
# { key = default.audio.sink value = { name = somesink } }
# { key = default.audio.source value = { name = somesource } }
# ]
# }
#}
]
context.exec = [
#{ path = <program-name>
# ( args = "<arguments>" )
# ( condition = [ { <key> = <value> ... } ... ] )
#}
#
# Execute the given program with arguments.
# If condition is given, the program is executed only when the context
# properties all match the match rules.
#
# You can optionally start the session manager here,
# but it is better to start it as a systemd service.
# Run the session manager with -h for options.
#
#{ path = "/usr/bin/pipewire-media-session" args = ""
# condition = [ { exec.session-manager = null } { exec.session-manager = true } ] }
#
# You can optionally start the pulseaudio-server here as well
# but it is better to start it as a systemd service.
# It can be interesting to start another daemon here that listens
# on another address with the -a option (eg. -a tcp:4713).
#
#{ path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf"
# condition = [ { exec.pipewire-pulse = null } { exec.pipewire-pulse = true } ] }
]

View file

@ -0,0 +1,2 @@
image/.* chafa -f sixel -s %pistol-extra0%x%pistol-extra1% --animate off --polite on %pistol-filename%
text/html lynx -width=%pistol-extra2% -display_charset=utf-8 -dump %pistol-filename%

173
.config/waybar/config Normal file
View file

@ -0,0 +1,173 @@
{
"layer": "top",
"position": "top",
"mod": "dock",
"height": 38,
"width": 1328,
"spacing": 4,
"reload_style_on_change": true,
"margin-top": 15,
"modules-left": ["hyprland/workspaces", "mpd"],
"modules-center": ["hyprland/window"],
"modules-right": ["battery", "backlight", "cpu", "network", "clock", "tray"],
"hyprland/workspaces": {
"disable-scroll": false,
"all-outputs": true,
"warp-on-scroll": false,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"urgent": "",
"focused": "",
"default": ""
},
"persistent-workspaces": {
"*": 3
}
},
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"hyprland/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"hyprland/scratchpad": {
"format": "{icon} {count}",
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {artist} - {title}",
"format-disconnected": "Disconnected ",
"format-stopped": "Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
},
"random-icons": {
"off": "<span color=\"#f53c3c\"></span> ",
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
"icon-size": 25,
"spacing": 5
},
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "CPU | {usage}%",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ipaddr}/{cidr} ",
"tooltip-format": "{ifname} via {gwaddr} ",
"format-linked": "{ifname} (No IP) ",
"format-disconnected": "Disconnected ⚠",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
},
"pulseaudio": {
// "scroll-step": 1, // %, can be a float
"format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
}
}

283
.config/waybar/style.css Normal file
View file

@ -0,0 +1,283 @@
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: JetBrainsMono Nerd Font, FontAwesome;
font-size: 13px;
padding: 2px;
}
window#waybar {
background-color: #1e222a;
color: #ffffff;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #FFFFFF;
}
*/
window#waybar.termite {
background-color: #1e222a;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
button {
/* Use box-shadow instead of border so the text isn't offset */
box-shadow: inset 0 -1px transparent;
/* Avoid rounded borders under each button name */
border: none;
border-radius: 0;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
button:hover {
background: inherit;
}
#workspaces button {
padding: 0 1px;
color: #ffffff;
}
#workspaces button.empty {
padding: 0 1px;
background-color: transparent;
color: #939494;
}
#workspaces button:hover {
background: #ffffff;
color: #000000;
border-radius: 6px;
}
#workspaces button.active {
box-shadow: inset 0 -1px #ffffff;
}
#workspaces button.urgent {
background-color: #eb4d4b;
border-radius: 6px;
}
#mode {
background-color: #64727D;
border-bottom: 3px solid #ffffff;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#wireplumber,
#custom-media,
#tray,
#mode,
#idle_inhibitor,
#scratchpad,
#mpd {
padding: 0 10px;
color: #ffffff;
}
#window,
#workspaces {
margin: 0 2px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
#clock {
color: #ffffff;
}
#battery {
color: #e06e6e;
}
#battery.charging, #battery.plugged {
color: #e06e6e;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#cpu {
background-color: #2ecc71;
color: #000000;
border-radius: 8px;
}
#memory {
background-color: #9b59b6;
}
#disk {
background-color: #964B00;
}
#backlight {
color: #6da4cd;
}
#network {
background-color: #2980b9;
border-radius: 8px;
}
#network.disconnected {
background-color: #f53c3c;
}
#pulseaudio {
background-color: #f1c40f;
color: #000000;
}
#pulseaudio.muted {
background-color: #90b1b1;
color: #2a5c45;
}
#wireplumber {
background-color: #fff0f5;
color: #000000;
}
#wireplumber.muted {
background-color: #f53c3c;
}
#custom-media {
background-color: #66cc99;
color: #2a5c45;
min-width: 100px;
}
#custom-media.custom-spotify {
background-color: #66cc99;
}
#custom-media.custom-vlc {
background-color: #ffa000;
}
#temperature {
background-color: #f0932b;
}
#temperature.critical {
background-color: #eb4d4b;
}
#tray {
color: #ffffff;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
#idle_inhibitor {
background-color: #2d3436;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}
#mpd {
color: #ffffff;
}
#mpd.disconnected {
}
#mpd.stopped {
}
#mpd.paused {
}
#language {
background: #00b093;
color: #740864;
padding: 0 5px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state {
background: #97e1ad;
color: #000000;
padding: 0 0px;
margin: 0 5px;
min-width: 16px;
}
#keyboard-state > label {
padding: 0 5px;
}
#keyboard-state > label.locked {
background: rgba(0, 0, 0, 0.2);
}
#scratchpad {
background: rgba(0, 0, 0, 0.2);
}
#scratchpad.empty {
background-color: transparent;
}

View file

@ -0,0 +1,96 @@
# WirePlumber daemon context configuration #
context.properties = {
## Properties to configure the PipeWire context and some modules
#application.name = WirePlumber
log.level = 2
wireplumber.script-engine = lua-scripting
#wireplumber.export-core = true
#mem.mlock-all = false
#support.dbus = true
}
context.spa-libs = {
#<factory-name regex> = <library-name>
#
# Used to find spa factory names. It maps an spa factory name
# regular expression to a library name that should contain
# that factory.
#
api.alsa.* = alsa/libspa-alsa
api.bluez5.* = bluez5/libspa-bluez5
api.v4l2.* = v4l2/libspa-v4l2
api.libcamera.* = libcamera/libspa-libcamera
audio.convert.* = audioconvert/libspa-audioconvert
support.* = support/libspa-support
}
context.modules = [
#{ name = <module-name>
# [ args = { <key> = <value> ... } ]
# [ flags = [ [ ifexists ] [ nofail ] ]
#}
#
# PipeWire modules to load.
# If ifexists is given, the module is ignored when it is not found.
# If nofail is given, module initialization failures are ignored.
#
# Uses RTKit to boost the data thread priority. Also allows clamping
# of utilisation when using the Completely Fair Scheduler on Linux.
{ name = libpipewire-module-rt
args = {
nice.level = -11
#rt.prio = 88
#rt.time.soft = -1
#rt.time.hard = -1
#uclamp.min = 0
#uclamp.max = 1024
}
flags = [ ifexists nofail ]
}
# The native communication protocol.
{ name = libpipewire-module-protocol-native }
# Allows creating nodes that run in the context of the
# client. Is used by all clients that want to provide
# data to PipeWire.
{ name = libpipewire-module-client-node }
# Allows creating devices that run in the context of the
# client. Is used by the session manager.
{ name = libpipewire-module-client-device }
# Makes a factory for wrapping nodes in an adapter with a
# converter and resampler.
{ name = libpipewire-module-adapter }
# Allows applications to create metadata objects. It creates
# a factory for Metadata objects.
{ name = libpipewire-module-metadata }
# Provides factories to make session manager objects.
{ name = libpipewire-module-session-manager }
# Provides factories to make SPA node objects.
{ name = libpipewire-module-spa-node-factory }
]
wireplumber.components = [
#{ name = <component-name>, type = <component-type> }
#
# WirePlumber components to load
#
# The lua scripting engine
{ name = libwireplumber-module-lua-scripting, type = module }
# The lua configuration file(s)
# Other components are loaded from there
{ name = main.lua, type = config/lua }
{ name = policy.lua, type = config/lua }
{ name = bluetooth.lua, type = config/lua }
]

9
.config/wofi/config Normal file
View file

@ -0,0 +1,9 @@
width=35%
location=center
show=drun
prompt=> search
allow_images=true
image_size=25
no_actions=true
dynamic_lines=true
key_exit=Escape

18
.config/wofi/modules/screenshot Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
entries="\n\n\n\n"
selected=$(echo -e $entries | wofi -c $HOME/.config/wofi/modules/screenshot.config --style $HOME/.config/wofi/modules/screenshot.css)
case $selected in
)
sleep 1 && $HOME/.local/bin/screenshot --now;;
)
sleep 1 && $HOME/.local/bin/screenshot --area;;
)
sleep 1 && $HOME/.local/bin/screenshot --win;;
)
$HOME/.local/bin/screenshot --in5;;
)
$HOME/.local/bin/screenshot --in10;;
esac

View file

@ -0,0 +1,10 @@
show=dmenu
height=100
width=400
hide_search=true
hide_scroll=true
orientation=horizontal
valign=center
no_actions=true
key_hide_search=Tab
key_exit=Super_L+S

View file

@ -0,0 +1,32 @@
#window {
margin: 0px;
border: 1px solid #88c0d0;
background-color: #1e222a;
border-radius: 10px;
}
#outer-box {
margin: 5px;
border: none;
background-color: #1e222a;
}
#text {
font-size: 50px;
margin: 5px;
border: none;
color: #d8dee9;
}
#input {
border: none;
}
#entry {
padding-left: 10px;
}
#entry:selected {
background-color: #61afef;
border-radius: 5px;
}

45
.config/wofi/style.css Normal file
View file

@ -0,0 +1,45 @@
#window {
margin: 0px;
border: 1px solid #88c0d0;
background-color: #1e222a;
border-radius: 10px;
}
#input {
margin: 5px;
border: none;
color: #d8dee9;
background-color: #262A32;
}
#inner-box {
margin: 5px;
border: none;
background-color: #1e222a;
}
#outer-box {
margin: 5px;
border: none;
background-color: #1e222a;
}
#scroll {
margin: 0px;
border: none;
}
#text {
margin: 5px;
border: none;
color: #d8dee9;
}
#entry {
padding-left: 10px;
}
#entry:selected {
background-color: #61afef;
border-radius: 5px;
}

61
.local/bin/brightness Executable file
View file

@ -0,0 +1,61 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2022 Aditya Shakya <adi1090x@gmail.com>
## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3
## Script To Manage Brightness For Archcraft.
# icons
iDIR='~/.local/share/icons/dunst'
# Graphics card
CARD=`ls /sys/class/backlight | head -n 1`
# Get brightness
get_backlight() {
LIGHT=$(printf "%.0f\n" `light -G`)
echo "${LIGHT}%"
}
# Get icons
get_icon() {
backlight="$(get_backlight)"
current="${backlight%%%}"
if [[ ("$current" -ge "0") && ("$current" -le "20") ]]; then
icon="$iDIR"/brightness-20.png
elif [[ ("$current" -ge "20") && ("$current" -le "40") ]]; then
icon="$iDIR"/brightness-40.png
elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then
icon="$iDIR"/brightness-60.png
elif [[ ("$current" -ge "60") && ("$current" -le "80") ]]; then
icon="$iDIR"/brightness-80.png
elif [[ ("$current" -ge "80") && ("$current" -le "100") ]]; then
icon="$iDIR"/brightness-100.png
fi
}
# Notify
notify_bl() {
get_icon && dunstify -u low --replace=69 -i "$icon" "Brightness : $(get_backlight)"
}
# Increase brightness
inc_backlight() {
light -A 5 && notify_bl
}
# Decrease brightness
dec_backlight() {
light -U 5 && notify_bl
}
# Execute accordingly
if [[ "$1" == "--get" ]]; then
get_backlight
elif [[ "$1" == "--inc" ]]; then
inc_backlight
elif [[ "$1" == "--dec" ]]; then
dec_backlight
else
get_backlight
fi

6
.local/bin/cash Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/bash
cur=$(curl -s "https://www.alphavantage.co/query?function=CURRENCY_EXCHANGE_RATE&from_currency=$2&to_currency=$3&apikey=MHFKEWAGILH4JKXM" | jq '."Realtime Currency Exchange Rate"."5. Exchange Rate"' | tr -d '"')
echo "Exchange Rate : $cur"
echo | awk ' { printf "Total : %0.2f\n", ('$cur' * '$1'); } '

538
.local/bin/catbox Executable file
View file

@ -0,0 +1,538 @@
#!/bin/bash
#
# CatBox v2.0
# An implementation of catbox.moe API in Bash
# Author: MineBartekSA
# Gist: https://gist.github.com/MineBartekSA/1d42d6973ddafb82793fd49b4fb06591
# Change log: https://gist.github.com/MineBartekSA/1d42d6973ddafb82793fd49b4fb06591?permalink_comment_id=4596132#gistcomment-4596132
#
# MIT License
#
# Copyright (c) 2023 Bartłomiej Skoczeń
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
VERSION="2.0"
CATBOX_HOST="https://catbox.moe/user/api.php"
LITTER_HOST="https://litterbox.catbox.moe/resources/internals/api.php"
HASH_FILE="$HOME/.catbox"
CURL_ADD=""
RESET="\e[0m"
BOLD="\e[1m"
RED="\e[91m"
YELLOW="\e[93m"
## Utils
function no_color() {
unset RESET BOLD RED YELLOW
}
function version() {
echo -e $BOLD"CatBox"$RESET" v"$VERSION >&5
echo "A catbox.moe API implementation in Bash"
}
function usage() {
[ -z $1 ] && version || echo $1
echo
echo "Usage: catbox <command> [arguments] [options]"
echo
echo "Commands:"
echo " user [user hash] - Gets current or sets global user hash. Pass 'off' to remove global user hash"
echo " file <filename(s)> - Upload files to catbox.moe"
echo " temp <filename(s)> [expiary] - Upload files to litterbox.catbox.moe"
echo " url <url(s)> - Upload files from URLs to catbox.moe"
echo " delete <filenames(s)> - Delete files from catbox.moe"
echo " album - Album Managment"
echo
echo "Global options:"
echo " -s, --silent - Only output upload links (stderr will still show)"
echo " -S, --silent-all - Silent option but also silences stderr"
echo " -n, --no-color - Disable output coloring"
echo " -u, --user-hash[=] - Pass user hash"
echo " -V, --verbose - Show verbose output (in album)"
}
function has_hash() {
[ -z "$HASH" ] && [ -z "$USER_HASH" ] && echo false || echo true
}
## Command functions
function upload_files() {
declare -i fail=0
for file in "${@:2}"
do
name=$(basename -- "$file")
echo -e $BOLD"$name"$RESET":"
if ! ( [ -f "$file" ] || [ -L "$file" ] || [ "$file" == "-" ] )
then
echo -e $BOLD$RED"File '$file' doesn't exist!"$RESET >&2
fail+=1
continue
fi
link=$(curl --fail-with-body -F reqtype=fileupload $CURL_ADD -F "fileToUpload=@$file" $1)
if [ $? -ne 0 ]
then
echo -e $BOLD$RED"Failed to upload: "$RESET$RED$link$RESET >&2
fail+=1
continue
fi
echo -n $link | wl-copy
echo -en "Uploaded to: "$BOLD
echo $link >&5
echo -en $RESET
done
[ $fail -eq $[$#-1] ] && exit 2
return 0
}
function catbox_command() {
curl -s --fail-with-body -F reqtype=$1 $CURL_ADD "${@:2}" $CATBOX_HOST &
pid=$!
if [ ! $SILENT ]
then
echo -en "\e[sPlase wait... |" >&5
declare -i stage=1
while ps -p $pid > /dev/null
do
case $stage in
0 | 4)
echo -en "\e[1D|" >&5
;;
1 | 5)
echo -en "\e[1D/" >&5
;;
3 | 7)
echo -en "\e[1D\\" >&5
;;
2 | 6)
echo -en "\e[1D-" >&5
;;
esac
stage+=1
[ $stage -eq 8 ] && stage=0
sleep 0.1
done
echo -ne "\e[u\e[KDone!" >&5
fi
wait $pid
}
function generic_command() {
declare -i fail=0
for item in "${@:5}"
do
echo -en $BOLD"$($3 "$item")"$RESET": "
res=$(catbox_command $1 -F "$2=$item")
if [ $? -eq 0 ]
then
$4 "$res"
else
[ $SILENT ] && echo -en $RED"$item: " >&2 || echo -en "\e[u"
echo -e $RED$res$RESET >&2
fail+=1
fi
done
[ $fail -eq $[$#-4] ] && exit 2
return 0
}
function url_success() {
echo -en "\e[u"
echo $* >&5
echo -n $* | wl-copy
}
function upload_urls() {
generic_command urlupload url "basename -- " url_success $@
}
function delete_success() {
echo -e "\e[uSuccesfully deleted"
}
function delete_files() {
echo "Deleting..."
generic_command deletefiles files echo delete_success $@
}
function album_usage() {
echo "Usage: catbox album <command> [arguments]"
echo
echo -e $BOLD$YELLOW"Note: Every album command requires user hash"
echo -e " For title or description, double quote every text longer than one word"$RESET
echo
echo "Commands:"
echo " create <title> <description> <file(s)> - Create album"
echo " edit <short> <title> <description> [file(s)] - Modify album"
echo " add <short> <file(s)> - Add files to an album"
echo " remove <short> <file(s)> - Remove files from an album"
echo " delete <short> - Delete album"
}
function album_create() {
files="${@:3}"
echo "Creating album..."
if [ $VERBOSE ]
then
echo "Title : $1" >&5
echo "Description: $2" >&5
echo "Files : $files" >&5
fi
album=$(catbox_command createalbum -F "title=$1" -F "desc=$2" -F "files=$files")
if [ $? -ne 0 ]
then
exec >&2
echo -e $RED$BOLD"Failed to create a new album!"$RESET
echo -e $RED$album$RESET
exit 2
fi
echo -n $album | wl-copy
echo -e "\nAlbum created successfully"
if [ $VERBOSE ]
then
echo "Album short: ${album:21}" >&5
echo "Album url : $album" >&5
else
echo "${album:21} | $album" >&5
fi
}
function album_edit() {
files="${@:4}"
echo "Modifing album..."
if [ $VERBOSE ]
then
echo "Album Short: $1" >&5
echo "Title : $2" >&5
echo "Description: $3" >&5
echo "Files : $files" >&5
fi
res=$(catbox_command editalbum -F "short=$1" -F "title=$2" -F "desc=$3" -F "files=$files")
if [ $? -ne 0 ]
then
exec >&2
echo -e $RED$BOLD"Failed to modify album!"$RESET
echo -e $RED$res$RESET
exit 2
fi
echo -e "\nAlbum modified successfully"
}
function album_add() {
files="${@:2}"
echo "Adding files to the album..."
if [ $VERBOSE ]
then
echo "Album short: $1"
echo "Files : $files"
fi
res=$(catbox_command addtoalbum -F "short=$1" -F "files=$files")
if [ $? -ne 0 ]
then
exec >&2
echo -e $RED$BOLD"Failed to add files to the album!"$RESET
echo -e $RED$res$RESET
exit 2
fi
echo -e "\nSuccessfully added files to the album"
}
function album_remove() {
files="${@:2}"
echo "Removing files from the album..."
if [ $VERBOSE ]
then
echo "Album short: $1"
echo "Files : $files"
fi
res=$(catbox_command removefromalbum -F "short=$1" -F "files=$files")
if [ $? -ne 0 ]
then
exec >&2
echo -e $RED$BOLD"Failed to remove files from the album!"$RESET
echo -e $RED$res$RESET
exit 2
fi
echo -e "\nSuccessfully removed files from the album"
}
function album_delete() {
echo "Deleting albums..."
generic_command deletealbum short echo delete_success $@
}
## Start
# Check if curl exists
curl --version >> /dev/null
if [ $? -ne 0 ]
then
echo -e $RED"cURL not found!"$RESET >&2
echo "Please check if you have cURL installed on your system" >&2
exit 3
fi
# Setup a file descriptor for bypassing silent option
exec 5<&1
# Handle global options
declare -i count=1
while [ $count -le $# ]
do
case ${!count} in
-S | --silent-all)
exec 2>/dev/null
set -- "${@:1:$count-1}" -s -s "${@:$count+1}"
;;
-s | --silent)
exec >/dev/null
SILENT=1
;;
-h | --help | --usage)
exec 5>/dev/null
usage
exit 0
;;
-v | --version)
version
exit 0
;;
-n | --no-color)
no_color
;;
-u | --user-hash | --user-hash=*)
if [[ ${!count} == --user-hash=* ]]
then
HASH=${!count:12}
else
get=$[$count+1]
HASH=${!get}
set -- "${@:1:$count-1}" "${@:$count+1}"
fi
[ ! -z "$HASH" ] && CURL_ADD="-F userhash=$HASH "
;;
-V | --verbose)
VERBOSE=1
;;
*)
count+=1
continue
esac
set -- "${@:1:$count-1}" "${@:$count+1}"
done
unset count no_color
# Read user hash if it was not given through global options
if [ -z ${HASH+x} ] && [ -f $HASH_FILE ]
then
while read line
do
if [[ $line != \#* ]] && [ "$line" != "" ]
then
USER_HASH=$line
CURL_ADD="-F userhash=$USER_HASH "
break
fi
done < $HASH_FILE
unset line
fi
# Handle commands
case $1 in
version)
version
;;
help | usage)
exec 5>&1
usage
;;
user)
if [ -z $2 ]
then
if [ "$(has_hash)" == "true" ]
then
if ! [ -z "$HASH" ]
then
echo "User hash given!"
echo -n "User hash: "
echo $HASH >&5
else
echo "User hash present!"
echo -n "User hash: "
echo $USER_HASH >&5
fi
echo "CatBox will act as you"
else
echo "No user hash"
echo "CatBox will act annonymously"
fi
elif [ "$2" == "off" ]
then
rm $HASH_FILE
echo "CatBox will now upload annonymously"
else
echo -e "# CatBox v2 User Hash\n$2" > $HASH_FILE
echo "User hash set!"
echo "CatBox will now upload files to your account"
fi
;;
file)
if [ $# -eq 1 ]
then
exec >&2
echo "Usage: catbox file <filename> [<filename>...] - Upload files to catbox.moe"
echo "Anonymously uploaded files cannot be deleted"
exit 1
fi
[ "$(has_hash)" == "false" ] && echo "Uploading annonymously..." || echo "Uploading..."
upload_files $CATBOX_HOST "${@:2}"
;;
temp)
if [ $# -lt 2 ]
then
exec >&2
echo "Usage: catbox temp <filename> [<filename>...] [1h/12h/24h/72h] - Upload files to litterbox.catbox.moe"
echo "Only the given expiry times are supported"
echo "By default, temporary files will expire after an hour"
exit 1;
fi
[[ ${@: -1:1} == @(1|12|24|72)h ]] && time=${@: -1:1} && end=-1 || time=1h || end=0
CURL_ADD="-F time=$time"
echo "Uploading temporarily..."
upload_files $LITTER_HOST "${@:2:$#-1$end}"
;;
url)
if [ $# -eq 1 ]
then
exec >&2
echo "Usage: catbox url <url> [<url>...] - Upload files from urls to catbox.moe"
echo "Anonymously uploaded files cannot be deleted"
exit 1
fi
[ "$(has_hash)" == "false" ] && echo "Uploading annonymously..." || echo "Uploading..."
upload_urls "${@:2}"
;;
delete)
if [ $# -eq 1 ]
then
exec >&2
echo "Usage: catbox delete <filename> [<filename>...] - Delete files from your catbox.moe account"
echo "This command required a catbox.moe account"
echo "Please add your user hash by using the catbox user command"
echo "Filenames must be the names of files already hosted on catbox.moe"
echo "Anonymously uploaded files cannot be deleted"
exit 1
elif [ "$(has_hash)" == "false" ]
then
exec >&2
echo -e $BOLD$RED"No user hash!"$RESET
echo -e $RED"Please add your user hash"
echo -e "Use the catbox user command to do so"$RESET
exit 1
fi
delete_files ${@:2}
;;
album)
if [ $# -gt 1 ] && [ "$(has_hash)" == "false" ]
then
exec >&2
echo -e $BOLD$RED"No user hash!"$RESET
echo -e $RED"Please add your user hash"
echo -e "Use the catbox user command to do so"$RESET
exit 1
fi
case $2 in
create)
if [ $# -lt 5 ]
then
exec >&2
echo "Usage: catbox album create <title> <description> <filename> [<filename> ...] - Create an album with given title, description, and files"
echo -e $YELLOW"For title or description, double quote every text longer than one word"$RESET
echo "Filenames must be the names of files already hosted on catbox.moe"
exit 1
fi
album_create "$3" "$4" ${@:5}
;;
edit)
if [ $# -lt 5 ]
then
exec >&2
echo "Usage: catbox album edit <short> <title> <description> [<filename> ...] - Modify the entirety of the album"
echo -e $YELLOW"For title or description, double quote every text longer than one word"
echo -e "Filenames are not necessary, but given none, the album will become empty"$RESET
echo "Filenames must be the names of files already hosted on catbox.moe"
exit 1
fi
album_edit $3 "$4" "$5" ${@:6}
;;
add)
if [ $# -lt 4 ]
then
exec >&2
echo "Usage: catbox album add <short> <filename> [<filename> ...] - Add files to the album"
echo "Filenames must be the names of files already hosted on catbox.moe"
exit 1
fi
album_add $3 ${@:4}
;;
remove)
if [ $# -lt 4 ]
then
exec >&2
echo "Usage: catbox album remove <short> <filename> [<filename> ...] - Remove files from the album"
echo "Filenames must be the names of files already hosted on catbox.moe"
exit 1
fi
album_remove $3 ${@:4}
;;
delete)
if [ $# -lt 3 ]
then
echo "Usage: catbox album delete <short> [<short> ...] - Delete album(s)" >&2
exit 1
fi
album_delete ${@:3}
;;
*)
exec >&2
album_usage
exit 1
esac
;;
*)
exec >&2
exec 5>&2
usage
exit 1
esac

284
.local/bin/hyprshot Executable file
View file

@ -0,0 +1,284 @@
#!/usr/bin/env bash
set -e
function Help() {
cat <<EOF
Usage: hyprshot [options ..] [-m [mode] ..] -- [command]
Hyprshot is an utility to easily take screenshot in Hyprland using your mouse.
It allows taking screenshots of windows, regions and monitors which are saved to a folder of your choosing and copied to your clipboard.
Examples:
capture a window \`hyprshot -m window\`
capture active window to clipboard \`hyprshot -m window -m active --clipboard-only\`
capture selected monitor \`hyprshot -m output -m DP-1\`
Options:
-h, --help show help message
-m, --mode one of: output, window, region, active, OUTPUT_NAME
-o, --output-folder directory in which to save screenshot
-f, --filename the file name of the resulting screenshot
-d, --debug print debug information
-s, --silent don't send notification when screenshot is saved
-r, --raw output raw image data to stdout
-t, --notif-timeout notification timeout in milliseconds (default 5000)
--clipboard-only copy screenshot to clipboard and don't save image in disk
-- [command] open screenshot with a command of your choosing. e.g. hyprshot -m window -- mirage
Modes:
output take screenshot of an entire monitor
window take screenshot of an open window
region take screenshot of selected region
active take screenshot of active window|output
(you must use --mode again with the intended selection)
OUTPUT_NAME take screenshot of output with OUTPUT_NAME
(you must use --mode again with the intended selection)
(you can get this from \`hyprctl monitors\`)
EOF
}
function Print() {
if [ $DEBUG -eq 0 ]; then
return 0
fi
1>&2 printf "$@"
}
function send_notification() {
if [ $SILENT -eq 1 ]; then
return 0
fi
local message=$([ $CLIPBOARD -eq 1 ] && \
echo "Image copied to the clipboard" || \
echo "Image saved in <i>${1}</i> and copied to the clipboard.")
notify-send "Screenshot saved" \
"${message}" \
-t "$NOTIF_TIMEOUT" -i "${1}" -a Hyprshot
}
function trim() {
local geometry="${1}"
local xy_str=$(echo "${geometry}" | cut -d' ' -f1)
local wh_str=$(echo "${geometry}" | cut -d' ' -f2)
local x=`echo "${xy_str}" | cut -d',' -f1`
local y=`echo "${xy_str}" | cut -d',' -f2`
local width=`echo "${wh_str}" | cut -dx -f1`
local height=`echo "${wh_str}" | cut -dx -f2`
local max_width=`hyprctl monitors -j | jq -r '[.[] | if (.transform % 2 == 0) then (.x + .width) else (.x + .height) end] | max'`
local max_height=`hyprctl monitors -j | jq -r '[.[] | if (.transform % 2 == 0) then (.y + .height) else (.y + .width) end] | max'`
local cropped_x=$x
local cropped_y=$y
local cropped_width=$width
local cropped_height=$height
if ((x + width > max_width)); then
cropped_width=$((max_width - x))
fi
if ((y + height > max_height)); then
cropped_height=$((max_height - y))
fi
if ((x < 0)); then
cropped_x=0
cropped_width=$((cropped_width + x))
fi
if ((y < 0)); then
cropped_y=0
cropped_height=$((cropped_height + y))
fi
printf "%s,%s %sx%s\n" \
"${cropped_x}" "${cropped_y}" \
"${cropped_width}" "${cropped_height}"
}
function save_geometry() {
Print "Geometry: %s\n" "${1}"
local cropped_geometry=`trim "${1}"`
Print "Crop: %s\n" "${cropped_geometry}"
local output=""
if [ $RAW -eq 1 ]; then
grim -g "${cropped_geometry}" -
return 0
fi
if [ $CLIPBOARD -eq 0 ]; then
mkdir -p "$SAVEDIR"
grim -g "${cropped_geometry}" "$SAVE_FULLPATH"
output="$SAVE_FULLPATH"
wl-copy < "$output"
[ -z "$COMMAND" ] || {
"$COMMAND" "$output"
}
else
wl-copy < <(grim -g "${cropped_geometry}" -)
fi
send_notification $output
}
function begin_grab() {
local option=$1
case $option in
output)
if [ $CURRENT -eq 1 ]; then
local geometry=`grab_active_output`
elif [ -z $SELECTED_MONITOR ]; then
local geometry=`grab_output`
else
local geometry=`grab_selected_output $SELECTED_MONITOR`
fi
;;
region)
local geometry=`grab_region`
;;
window)
if [ $CURRENT -eq 1 ]; then
local geometry=`grab_active_window`
else
local geometry=`grab_window`
fi
;;
esac
save_geometry "${geometry}"
}
function grab_output() {
slurp -or
}
function grab_active_output() {
local active_workspace=`hyprctl -j activeworkspace`
local monitors=`hyprctl -j monitors`
Print "Monitors: %s\n" "$monitors"
Print "Active workspace: %s\n" "$active_workspace"
local current_monitor="$(echo $monitors | jq -r 'first(.[] | select(.activeWorkspace.id == '$(echo $active_workspace | jq -r '.id')'))')"
Print "Current output: %s\n" "$current_monitor"
echo $current_monitor | jq -r '"\(.x),\(.y) \(.width/.scale|round)x\(.height/.scale|round)"'
}
function grab_selected_output() {
local monitor=`hyprctl -j monitors | jq -r '.[] | select(.name == "'$(echo $1)'")'`
Print "Capturing: %s\n" "${1}"
echo $monitor | jq -r '"\(.x),\(.y) \(.width/.scale|round)x\(.height/.scale|round)"'
}
function grab_region() {
slurp -d
}
function grab_window() {
local monitors=`hyprctl -j monitors`
local clients=`hyprctl -j clients | jq -r '[.[] | select(.workspace.id | contains('$(echo $monitors | jq -r 'map(.activeWorkspace.id) | join(",")')'))]'`
Print "Monitors: %s\n" "$monitors"
Print "Clients: %s\n" "$clients"
# Generate boxes for each visible window and send that to slurp
# through stdin
local boxes="$(echo $clients | jq -r '.[] | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1]) \(.title)"')"
Print "Boxes:\n%s\n" "$boxes"
slurp -r <<< "$boxes"
}
function grab_active_window() {
local active_window=`hyprctl -j activewindow`
local box=$(echo $active_window | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
Print "Box:\n%s\n" "$box"
echo "$box"
}
function parse_mode() {
local mode="${1}"
case $mode in
window | region | output)
OPTION=$mode
;;
active)
CURRENT=1
;;
*)
hyprctl monitors -j | jq -re '.[] | select(.name == "'$(echo $mode)'")' &>/dev/null
SELECTED_MONITOR=$mode
;;
esac
}
function args() {
local options=$(getopt -o hf:o:m:dsrt: --long help,filename:,output-folder:,mode:,clipboard-only,debug,silent,raw,notif-timeout: -- "$@")
eval set -- "$options"
while true; do
case "$1" in
-h | --help)
Help
exit
;;
-o | --output-folder)
shift;
SAVEDIR=$1
;;
-f | --filename)
shift;
FILENAME=$1
;;
-m | --mode)
shift;
parse_mode $1
;;
--clipboard-only)
CLIPBOARD=1
;;
-d | --debug)
DEBUG=1
;;
-s | --silent)
SILENT=1
;;
-r | --raw)
RAW=1
;;
-t | --notif-timeout)
shift;
NOTIF_TIMEOUT=$1
;;
--)
shift # Skip -- argument
COMMAND=${@:2}
break;;
esac
shift
done
if [ -z $OPTION ]; then
Print "A mode is required\n\nAvailable modes are:\n\toutput\n\tregion\n\twindow\n"
exit 2
fi
}
if [ -z $1 ]; then
Help
exit
fi
CLIPBOARD=0
DEBUG=0
SILENT=0
RAW=0
NOTIF_TIMEOUT=5000
CURRENT=0
[ -z "$XDG_PICTURES_DIR" ] && type xdg-user-dir &> /dev/null && XDG_PICTURES_DIR=$(xdg-user-dir PICTURES)
FILENAME="$(date +'%Y-%m-%d-%H%M%S_hyprshot.png')"
[ -z "$HYPRSHOT_DIR" ] && SAVEDIR=${XDG_PICTURES_DIR:=~} || SAVEDIR=${HYPRSHOT_DIR}
args $0 "$@"
SAVE_FULLPATH="$SAVEDIR/$FILENAME"
[ $CLIPBOARD -eq 0 ] && Print "Saving in: %s\n" "$SAVE_FULLPATH"
begin_grab $OPTION

BIN
.local/bin/lsvr Executable file

Binary file not shown.

12
.local/bin/rotdir Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh
# When I open an image from the file manager in nsxiv (the image viewer), I want
# to be able to press the next/previous keys to key through the rest of the
# images in the same directory. This script "rotates" the content of a
# directory based on the first chosen file, so that if I open the 15th image,
# if I press next, it will go to the 16th etc. Autistic, I know, but this is
# one of the reasons that nsxiv is great for being able to read standard input.
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
base="$(basename "$1")"
ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'

BIN
.local/bin/s Executable file

Binary file not shown.

43
.local/bin/screenshot Executable file
View file

@ -0,0 +1,43 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2024 Aditya Shakya <adi1090x@gmail.com>
##
## Script to take screenshots on Archcraft.
# file
dir=$HOME/Pictures/Screenshots
# countdown
countdown () {
for sec in `seq $1 -1 1`; do
dunstify -t 1000 -h string:x-dunst-stack-tag:screenshottimer -i $HOME/.local/share/icons/dunst/timer.png "Taking shot in : $sec"
sleep 1
done
}
shot5 () {
countdown '5'
sleep 1 && $HOME/.local/bin/hyprshot -m output -m eDP-1 -o $dir
}
shot10 () {
countdown '10'
sleep 1 && $HOME/.local/bin/hyprshot -m output -m eDP-1 -o $dir
}
# execute
if [[ "$1" == "--now" ]]; then
$HOME/.local/bin/hyprshot -m output -m eDP-1 -o $dir
elif [[ "$1" == "--in5" ]]; then
shot5
elif [[ "$1" == "--in10" ]]; then
shot10
elif [[ "$1" == "--win" ]]; then
$HOME/.local/bin/hyprshot -m window -o $dir
elif [[ "$1" == "--area" ]]; then
$HOME/.local/bin/hyprshot -m region -o $dir
else
echo -e "Available Options : --now --in5 --in10 --win --area"
fi
exit 0

13
.local/bin/sw Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
# < x37 > | https://x.exozy.me
# script to start swww and change a wallpaper automatically with dinit
swww query
if [ $? -eq 1 ] ; then
swww init
else
killall swww-daemon
swww init --no-daemon
fi
sleep 2
/usr/bin/swww img $HOME/Pictures/Wallpapers/$(ls $HOME/Pictures/Wallpapers | shuf -n1)

BIN
.local/bin/tgpt Executable file

Binary file not shown.

83
.local/bin/volume Executable file
View file

@ -0,0 +1,83 @@
#!/usr/bin/env bash
## Copyright (C) 2020-2023 Aditya Shakya <adi1090x@gmail.com>
##
## Script to manage speaker volume on Archcraft.
# Icons
iDIR='~/.local/share/icons/dunst'
notify_cmd='dunstify -u low -h string:x-dunst-stack-tag:obvolume'
# Get Volume
get_volume() {
echo "`pulsemixer --get-volume | cut -d' ' -f1`"
}
# Get icons
get_icon() {
current="$(get_volume)"
if [[ "$current" -eq "0" ]]; then
icon="$iDIR/volume-mute.png"
elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then
icon="$iDIR/volume-low.png"
elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then
icon="$iDIR/volume-mid.png"
elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then
icon="$iDIR/volume-high.png"
fi
}
# Notify
notify_user() {
${notify_cmd} -i "$icon" "Volume : $(get_volume)%"
}
# Increase Volume
inc_volume() {
[[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute
pulsemixer --max-volume 100 --change-volume +5 && get_icon && notify_user
}
# Decrease Volume
dec_volume() {
[[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute
pulsemixer --max-volume 100 --change-volume -5 && get_icon && notify_user
}
# Toggle Mute
toggle_mute() {
if [[ `pulsemixer --get-mute` == 0 ]]; then
pulsemixer --toggle-mute && ${notify_cmd} -i "$iDIR/volume-mute.png" "Mute"
else
pulsemixer --toggle-mute && get_icon && ${notify_cmd} -i "$icon" "Unmute"
fi
}
# Toggle Mic
toggle_mic() {
ID="`pulsemixer --list-sources | grep 'Default' | cut -d',' -f1 | cut -d' ' -f3`"
if [[ `pulsemixer --id $ID --get-mute` == 0 ]]; then
pulsemixer --id ${ID} --toggle-mute && ${notify_cmd} -i "$iDIR/microphone-mute.png" "Microphone Switched OFF"
else
pulsemixer --id ${ID} --toggle-mute && ${notify_cmd} -i "$iDIR/microphone.png" "Microphone Switched ON"
fi
}
# Execute accordingly
if [[ -x `which pulsemixer` ]]; then
if [[ "$1" == "--get" ]]; then
get_volume
elif [[ "$1" == "--inc" ]]; then
inc_volume
elif [[ "$1" == "--dec" ]]; then
dec_volume
elif [[ "$1" == "--toggle" ]]; then
toggle_mute
elif [[ "$1" == "--toggle-mic" ]]; then
toggle_mic
else
echo $(get_volume)%
fi
else
${notify_cmd} "'pulsemixer' is not installed."
fi