This commit is contained in:
coolnsx
2023-02-25 22:42:07 +05:30
parent 6fb4bc0edc
commit f9fd242e6d
13 changed files with 133 additions and 45 deletions

39
.zshrc
View File

@@ -7,6 +7,23 @@ gtp(){
unset commit
}
megamind() {
printf "———————————%s———————————
⠀⣞⢽⢪⢣⢣⢣⢫⡺⡵⣝⡮⣗⢷⢽⢽⢽⣮⡷⡽⣜⣜⢮⢺⣜⢷⢽⢝⡽⣝
⠸⡸⠜⠕⠕⠁⢁⢇⢏⢽⢺⣪⡳⡝⣎⣏⢯⢞⡿⣟⣷⣳⢯⡷⣽⢽⢯⣳⣫⠇
⠀⠀⢀⢀⢄⢬⢪⡪⡎⣆⡈⠚⠜⠕⠇⠗⠝⢕⢯⢫⣞⣯⣿⣻⡽⣏⢗⣗⠏⠀
⠀⠪⡪⡪⣪⢪⢺⢸⢢⢓⢆⢤⢀⠀⠀⠀⠀⠈⢊⢞⡾⣿⡯⣏⢮⠷⠁⠀⠀
⠀⠀⠀⠈⠊⠆⡃⠕⢕⢇⢇⢇⢇⢇⢏⢎⢎⢆⢄⠀⢑⣽⣿⢝⠲⠉⠀⠀⠀⠀
⠀⠀⠀⠀⠀⡿⠂⠠⠀⡇⢇⠕⢈⣀⠀⠁⠡⠣⡣⡫⣂⣿⠯⢪⠰⠂⠀⠀⠀⠀
⠀⠀⠀⠀⡦⡙⡂⢀⢤⢣⠣⡈⣾⡃⠠⠄⠀⡄⢱⣌⣶⢏⢊⠂⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢝⡲⣜⡮⡏⢎⢌⢂⠙⠢⠐⢀⢘⢵⣽⣿⡿⠁⠁⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠨⣺⡺⡕⡕⡱⡑⡆⡕⡅⡕⡜⡼⢽⡻⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣼⣳⣫⣾⣵⣗⡵⡱⡡⢣⢑⢕⢜⢕⡝⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣴⣿⣾⣿⣿⣿⡿⡽⡑⢌⠪⡢⡣⣣⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⡟⡾⣿⢿⢿⢵⣽⣾⣼⣘⢸⢸⣞⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠁⠇⠡⠩⡫⢿⣝⡻⡮⣒⢽⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
———————————————————————————————\n" "$*"
}
gtb () {
[ -z "$*" ] && br=$(git branch -a | fzf --border=rounded --layout=reverse --height=10 | tr -d ' ') || br=$*
[ -z "$br" ] || git checkout $br
@@ -14,7 +31,23 @@ gtb () {
}
b64 () { printf "%s" "$1" | base64 $2; }
url() { curl -s https://0x0.st -F "file=@$*" | wl-copy && notify-send "Link copied to clipboard"; }
url() {
[ -z "$2" ] && duration="1440" || duration=$2
out=$(curl https://oshi.at -F shorturl=0 -F "f=@$1" -F "expire=$duration") #1440 means 1 day duration
[ -z "$out" ] && return 1
printf "%s" "$out" | sed -nE 's|DL: (.*)|\1|p' | wl-copy && notify-send "Link copied to clipboard";
wl-paste
#storing only long duration links
[ -z "$2" ] && printf "%s\n%s" "$out" "$(date '+%s')" | tr '\n' '>' | sed 's/>/ | /g' >> $HOME/.cache/oshi-urls
#deleting file uploaded than 1 day ago
for i in $(cut -d'|' -f3 $HOME/.cache/oshi-urls | tr -d ' ');do
curr=$(date '+%s')
[ "$((curr - i))" -gt "86400" ] && sed -i "/$i/d" $HOME/.cache/oshi-urls &
done
echo >> $HOME/.cache/oshi-urls
}
gtd () {
preview="git diff $@ --color=always -- {-1}"
@@ -46,6 +79,7 @@ help() {
}
addpkg(){
[ -z "$*" ] && printf "\033[1;31mPlease write the name of package (just some words)..\033[0m" && return 1
paru -Ss "$*" | sed -nE 's|^[a-z]*/([^ ]*).*|\1|p' | fzf --preview 'paru -Si {} | bat --language=yaml --color=always -pp' --preview-window right:65%:wrap -m | paru -S -
}
@@ -63,8 +97,10 @@ export VIDEO="mpv"
export WM="hyprland"
export IMAGE="nsxiv"
alias cat="bat -pp"
alias open="xdg-open"
alias anime="$HOME/ani-cli/ani-cli"
alias cp="cp -v"
alias art="php artisan"
alias rm="rm -v"
alias mv="mv -v"
alias pgrep="pgrep -a"
@@ -79,6 +115,7 @@ clshist
HISTFILE=~/.histfile
HISTSIZE=200
SAVEHIST=200
PROMPT_EOL_MARK=' ⏎ '
setopt autocd
bindkey -e
zstyle :compinstall filename '/home/tanveer/.zshrc'

View File

@@ -11,7 +11,8 @@
/** Generic window ***********************************/
.genwin {
background-color: rgba(46, 52, 64, 0.5);
//background-color: rgba(46, 52, 64, 0.5);
background-color: rgba(0,0,0,0);
border-radius: 16px;
}
@@ -47,8 +48,8 @@
background-size: cover;
background-repeat:no-repeat;
background-color: rgba(0,0,0,0);
min-height: 210px;
min-width: 210px;
min-height: 240px;
min-width: 240px;
margin: 0px 50px 0px 0px;
border-radius: 15px;
border-style:none;
@@ -58,21 +59,21 @@
color: #8FBCBB;
font-size : 24px;
font-weight : bold;
margin : 5px 0px 0px 0px;
margin : 10px 0px 0px 0px;
}
.artist {
color: #EBCB8B;
font-size : 20px;
font-weight : normal;
margin : 0px 0px -10px 0px;
margin : 0px 0px 0px 0px;
}
.btn_play {
margin : 0px 0px 0px 0px;
color: #A3BE8C;
font-family: IosevkaTerm Nerd Font Mono;
font-size : 70px;
font-weight : bold;
}
.btn_prev {
@@ -97,5 +98,5 @@
border-radius: 24px;
min-height: 13px;
min-width: 190px;
margin : -22px 0px 10px 0px;
margin : 0px 0px 10px 0px;
}

View File

@@ -1,8 +1,8 @@
;;time
(defwindow time_1
:monitor 1
:geometry (geometry :x "-10px"
:y "30px"
:geometry (geometry :x "10px"
:y "0px"
:width "20%"
:height "200px"
:anchor "top right")
@@ -14,11 +14,11 @@
(defwindow time_0
:monitor 0
:geometry (geometry :x "50px"
:y "50px"
:geometry (geometry :x "10px"
:y "0px"
:width "21%"
:height "200px"
:anchor "bottom right")
:anchor "top right")
:stacking "bg"
:reserve (struts :distance "40px" :side "top")
:windowtype "dock"
@@ -35,7 +35,7 @@
(box :orientation "h" :spacing 0
(label :class "time_hour" :valign "start" :wrap "true" :limit-width 25 :text HOUR)
(label :class "time_min" :valign "end" :wrap "true" :limit-width 25 :text MIN))
(box :orientation "v" :spacing 0
(box :orientation "v" :spacing 0 :space-evenly true
(label :class "time_mer" :valign "start" :halign "end" :wrap "true" :limit-width 25 :text MER)
(label :class "time_day" :valign "end" :halign "end" :wrap "true" :limit-width 25 :text DAY))))
@@ -57,8 +57,8 @@
:monitor 1
:geometry (geometry :x "50"
:y "50"
:width "20%"
:height "0px"
:width "30%"
:height "40px"
:anchor "bottom left")
:stacking "bg"
:reserve (struts :distance "10px" :side "bottom")
@@ -66,10 +66,10 @@
:wm-ignore true
(music))
(defpoll SONG :interval "1s" `./script song`)
(defpoll ARTIST :interval "1s" `./script artist`)
(defpoll SONG :interval "2s" `./script song`)
(defpoll ARTIST :interval "2s" `./script artist`)
(defpoll STATUS :interval "0.5s" `./script status`)
(defpoll COVER :interval "1s" `./script cover`)
(defpoll COVER :interval "2s" `./script cover`)
(defpoll CURRENT :interval "1s" `./script time`)
(defwidget music []

View File

@@ -4,21 +4,21 @@ out=$(echo '{ "command": ["get_property", "pause"]}' | socat - /tmp/mpvsocket 2>
case $1 in
song)
if [ -n "$out" ] && pgrep -f mpvsocket >/dev/null 2>&1;then
cut -d'>' -f1 < "$HOME/.cache/yt-music/current" | cut -d':' -f2 | sed 's|[^-]*$||;s|-$||'
cut -d'>' -f1 < "/tmp/yt-music/current" | cut -d':' -f2 | sed 's|[^-]*$||;s|-$||'
else
echo "Offline"
fi
;;
artist)
if [ -n "$out" ] && pgrep -f mpvsocket >/dev/null 2>&1;then
cut -d'>' -f1 < "$HOME/.cache/yt-music/current" | sed 's_.* -__'
cut -d'>' -f1 < "/tmp/yt-music/current" | sed 's_.* -__'
else
echo "Offline"
fi
;;
cover)
if [ -n "$out" ] && pgrep -f mpvsocket >/dev/null 2>&1;then
echo "$HOME/.cache/yt-music/default.jpg"
echo "/tmp/yt-music/default.jpg"
else
echo "$HOME/.config/eww/music.png"
fi
@@ -39,7 +39,7 @@ case $1 in
pgrep -f mpvsocket >/dev/null 2>&1 && /home/tanveer/repos_scripts/yt-music play_next
;;
prev)
pgrep -f mpvsocket >/dev/null 2>&1 && ($HOME/repos_scripts/yt-music play "$(sed 's| >|\t|g' $HOME/.cache/yt-music/prev | cut -d':' -f2)")
pgrep -f mpvsocket >/dev/null 2>&1 && ($HOME/repos_scripts/yt-music play "$(sed 's| >|\t|g' /tmp/yt-music/prev | cut -d':' -f2)")
;;
time)
out=$(echo '{"command" :["get_property" , "percent-pos"]}' | socat - /tmp/mpvsocket 2>/dev/null | sed -nE 's_.*data":([^,]*).*_\1_p')

View File

@@ -8,7 +8,7 @@ term=xterm-256color
# title=foot
# locked-title=no
font=Iosevka Term:size=10
font=Iosevka Term Nerd Font Mono:size=10
#font-bold=
font-italic=Victor Mono:style=Italic:size=9
#font-bold-italic=<bold+italic variant of regular font>

View File

@@ -154,8 +154,8 @@ binde=$mainMod, F8, exec, echo cycle pause | socat - "/tmp/mpvsocket"
binde=$mainMod SHIFT, F8, exec, $HOME/repos_scripts/yt-music search_play
binde=$mainMod, F9, exec, $HOME/repos_scripts/yt-music play_next
binde=$mainMod SHIFT, F9, exec, $HOME/repos_scripts/yt-music play_next menu
binde=, XF86MonBrightnessDown, exec, light -U 5 && notify-send -i "lol" "☀️ $(light -G | cut -d'.' -f1)" -t 1000 -r 1
binde=, XF86MonBrightnessUp, exec, light -A 5 && notify-send -i "lol" "☀️ $(light -G | cut -d'.' -f1)" -t 1000 -r 1
binde=, XF86MonBrightnessDown, exec, light -U 2 && notify-send -i "lol" "☀️ $(light -G | cut -d'.' -f1)" -t 1000 -r 1
binde=, XF86MonBrightnessUp, exec, light -A 2 && notify-send -i "lol" "☀️ $(light -G | cut -d'.' -f1)" -t 1000 -r 1
#windows rules
windowrulev2=workspace 1,class:^(google-chrome)$
@@ -169,7 +169,7 @@ windowrulev2=workspace 4,class:^(pavucontrol)$
#startup applications
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once=ssh-agent
exec-once=swaybg -i ~/wall/12.jpg
exec-once=swaybg -i ~/wall/9.png
exec-once=xrdb -merge $HOME/.config/.Xresource
exec-once=$hypr_dir/workspace 'focus'
exec-once=eww open-many music_0 time_0

View File

@@ -10,7 +10,7 @@ while [ $i -le "5" ];do
vol_stats=$(pamixer --get-mute)
[ "$bat_stats" = "Discharging" ] && bat_icon=🔋 || bat_icon=🔌
[ "$vol_stats" = "true" ] && vol_icon=🔇 || vol_icon=🔊
notify-send -i "lol" "<------------(STATS)------------>" "🧠 CPU usage : $(top -ibn1 | sed -nE 's_%Cpu\(s\):(.*)us.*_\1_p' | cut -d' ' -f2-3) %\n🌡 Cpu Temp : $temp °C\n🔳 RAM : $mem MB / 7733 MB\n$bat_icon Battery : $(cat /sys/class/power_supply/BAT*/capacity) (${bat_stats})\n☀ Brightness : $(light -G | cut -d'.' -f1)%\n$vol_icon Volume : $(pamixer --get-volume-human)\n🎵 $(pgrep -af mpvsocket >/dev/null && cut -d ">" -f1 $HOME/.cache/yt-music/current | cut -d":" -f2)" -r 2 -t 1500 &
notify-send -i "lol" "<------------(STATS)------------>" "🧠 CPU usage : $(top -ibn1 | sed -nE 's_%Cpu\(s\):(.*)us.*_\1_p' | cut -d' ' -f2-3) %\n🌡 Cpu Temp : $temp °C\n🔳 RAM : $mem MB / 7733 MB\n$bat_icon Battery : $(cat /sys/class/power_supply/BAT*/capacity) (${bat_stats})\n☀ Brightness : $(light -G | cut -d'.' -f1)%\n$vol_icon Volume : $(pamixer --get-volume-human)\n🎵 $(pgrep -af mpvsocket >/dev/null && cut -d ">" -f1 /tmp/yt-music/current | cut -d":" -f2)" -r 2 -t 1500 &
: $((i+=1))
sleep 1
done

View File

@@ -6,10 +6,11 @@ setup_dual_monitor(){
if hyprctl monitors | grep -q "HDMI-A-1";then
notify-send "Setting up dual monitor workflow"
wlr-randr --output 'HDMI-A-1' --custom-mode '1920x1080'
for i in $(seq 3);do
for i in $(seq 2 4);do
hyprctl dispatch moveworkspacetomonitor "$i 0"
done
hyprctl dispatch moveworkspacetomonitor "4 1"
hyprctl dispatch moveworkspacetomonitor "1 1"
eww kill
eww open-many time_1 music_1
fi
}
@@ -37,7 +38,7 @@ case $1 in
#shows the workspace number as notification whenever u switch workspaces and also handles the dual monitor setup on the fly(perfect for laptop users)
socat - "UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line;do
printf "%s" "$line" | grep -q "monitoradded" && handle_it "$line"
printf "%s" "$line" | grep -q "monitorremoved" && sed -i "s/monitor=,1920x1080,0x0,1,mirror,eDP-1/monitor=,preferred,auto,1/g" "$HOME/.config/hypr/hyprland.conf" && eww close music_1 time_1
printf "%s" "$line" | grep -q "monitorremoved" && sed -i "s/monitor=,1920x1080,0x0,1,mirror,eDP-1/monitor=,preferred,auto,1/g" "$HOME/.config/hypr/hyprland.conf" && eww kill && eww open_many time_0 music_0
#recent workspace switcher
current=$(printf "%s" "$line" | sed -nE 's_^(workspace)>>([^ ]*)_\1 \2_p')
if [ -n "$current" ];then

View File

@@ -2,7 +2,7 @@
inode/directory=pcmanfm.desktop
image/jpeg=nsxiv.desktop
application/pdf=org.pwmt.zathura.desktop
text/html=nvim.desktop
text/html=google-chrome.desktop
x-scheme-handler/http=google-chrome.desktop
x-scheme-handler/https=google-chrome.desktop
x-scheme-handler/about=google-chrome.desktop
@@ -25,3 +25,7 @@ text/x-tex=nvim.deskop
application/x-shellscript=nvim.deskop
text/x-c=nvim.deskop
text/x-c++=nvim.deskop
video/x-matroska=mpv.desktop
[Added Associations]
video/x-matroska=mpv.desktop;

View File

@@ -4,20 +4,16 @@ print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution
info "DE" de
info "WM" wm
info "WM Theme" wm_theme
info "Theme" theme
info "Icons" icons
info "Terminal" term
info "Terminal Font" term_font
info "CPU" cpu
info "GPU" gpu
info "Memory" memory

View File

@@ -1,5 +1,3 @@
-- functionality setup
local set = vim.opt
set.number=true
@@ -19,6 +17,17 @@ require('packer').startup(function(use)
use { 'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true } }
use 'https://gitlab.com/__tpb/monokai-pro.nvim'
use { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig", }
use {
"adalessa/laravel.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
},
cmd = {"Artisan", "Composer"},
config = function()
require("laravel").setup()
require("telescope").load_extension("laravel")
end
}
--use { 'AlphaTechnolog/pywal.nvim', as = 'pywal' }
use {
"windwp/nvim-autopairs",
@@ -54,7 +63,7 @@ require("mason").setup {
}
}
require("mason-lspconfig").setup {
ensure_installed = { "sumneko_lua" },
ensure_installed = { "lua_ls" },
}
local capabilities = vim.lsp.protocol.make_client_capabilities()
@@ -83,8 +92,20 @@ if not configs.intelephense then
}
end
-- for arduino lsp server
local MY_FQBN = "arduino:avr:nano"
lspconfig.arduino_language_server.setup {
cmd = {
"arduino-language-server",
"-cli-config", "/path/to/arduino-cli.yaml",
"-fqbn",
MY_FQBN
}
}
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
local servers = { 'bashls', 'pyright', 'sumneko_lua', 'clangd','intelephense','phpactor'}
local servers = { 'bashls', 'pyright', 'lua_ls', 'clangd','intelephense','phpactor' }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
capabilities = capabilities,

View File

@@ -114,6 +114,15 @@ _G.packer_plugins = {
path = "/home/tanveer/.local/share/nvim/site/pack/packer/start/friendly-snippets",
url = "https://github.com/rafamadriz/friendly-snippets"
},
["laravel.nvim"] = {
commands = { "Artisan", "Composer" },
config = { "\27LJ\2\nf\0\0\3\0\5\0\f6\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\0\0'\2\3\0B\0\2\0029\0\4\0'\2\1\0B\0\2\1K\0\1\0\19load_extension\14telescope\nsetup\flaravel\frequire\0" },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/home/tanveer/.local/share/nvim/site/pack/packer/opt/laravel.nvim",
url = "https://github.com/adalessa/laravel.nvim"
},
["lualine.nvim"] = {
loaded = true,
path = "/home/tanveer/.local/share/nvim/site/pack/packer/start/lualine.nvim",
@@ -189,6 +198,25 @@ time([[Config for nvim-autopairs]], true)
try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs")
time([[Config for nvim-autopairs]], false)
-- Command lazy-loads
time([[Defining lazy-load commands]], true)
pcall(vim.api.nvim_create_user_command, 'Artisan', function(cmdargs)
require('packer.load')({'laravel.nvim'}, { cmd = 'Artisan', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins)
end,
{nargs = '*', range = true, bang = true, complete = function()
require('packer.load')({'laravel.nvim'}, {}, _G.packer_plugins)
return vim.fn.getcompletion('Artisan ', 'cmdline')
end})
pcall(vim.api.nvim_create_user_command, 'Composer', function(cmdargs)
require('packer.load')({'laravel.nvim'}, { cmd = 'Composer', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins)
end,
{nargs = '*', range = true, bang = true, complete = function()
require('packer.load')({'laravel.nvim'}, {}, _G.packer_plugins)
return vim.fn.getcompletion('Composer ', 'cmdline')
end})
time([[Defining lazy-load commands]], false)
_G._packer.inside_compile = false
if _G._packer.needs_bufread == true then
vim.cmd("doautocmd BufRead")

View File

@@ -25,7 +25,7 @@ side_pane_mode=places
view_mode=list
show_hidden=0
sort=name;ascending;
columns=name:200;desc:143;size;mtime;
columns=name:200;desc:143;size;mtime:946;
toolbar=newtab;navigation;home;
show_statusbar=1
pathbar_mode_buttons=0