diff --git a/.gitignore b/.gitignore index 9a86cc7..54497c2 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ psysh zoom* .env systemd +sunshine +uad diff --git a/hypr/.luarc.json b/hypr/.luarc.json new file mode 100644 index 0000000..62faf36 --- /dev/null +++ b/hypr/.luarc.json @@ -0,0 +1,10 @@ +{ + "workspace": { + "library": [ + "/usr/share/hypr/stubs" + ] + }, + "diagnostics": { + "globals": ["hl"] + } +} diff --git a/hypr/battery b/hypr/battery index b442e54..1df0f7e 100755 --- a/hypr/battery +++ b/hypr/battery @@ -1,7 +1,7 @@ #!/bin/sh -remind() { - notify-send -e -i "$icon_dir/battery-010.svg" -h "string:x-canonical-private-synchronous:${0##*/}" "$1 % Battery $2, Please Plugin Charger!!" -u "$2" +notify() { + notify-send -e -i "$icon_dir/$1" -h "string:x-canonical-private-synchronous:${0##*/}" "$2" -u "${3:-normal}" } print_sleep() { @@ -12,9 +12,29 @@ print_sleep() { #declaration battery="BAT0" #change accordingly dir="/sys/class/power_supply/$battery/" -icon_dir="/usr/share/icons/Papirus/22x22/panel/" #change accordingly +icon_dir="/usr/share/icons/Papirus-Dark/22x22/panel/" #change accordingly i=0 status="normal" +charge=$(cat "$dir"/capacity) +power_status=$(cat "$dir"/status) + +case "$1" in + ac) + notify "battery-$(( charge / 10))0-charging.svg" "Power: AC Mode ($charge % $power_status)" + hyprctl keyword decoration:blur:enabled true + hyprctl keyword decoration:shadow:enabled true + exit 0 + ;; + + battery) + notify "battery-$(( charge / 10))0.svg" "Power: Battery Mode ($charge % $power_status)" + hyprctl keyword decoration:blur:enabled false + hyprctl keyword decoration:shadow:enabled false + exit 0 + ;; + + *) ;; +esac #infinite loop while charge=$(cat "$dir"/capacity); do @@ -41,7 +61,7 @@ while charge=$(cat "$dir"/capacity); do esac # remind appropriately - [ "$status" != "normal" ] && remind "$charge" "$status" + [ "$status" != "normal" ] && notify "battery-010.svg" "$charge % Battery $status, Please Plugin Charger!!" "$status" fi - print_sleep "$i" "$charge" "$status" "$1" #pass 'log' as argument to print logs + print_sleep "$i" "$charge" "$status" "$2" #pass 'log' as argument to print logs done diff --git a/hypr/bemoji b/hypr/bemoji index 66b5a55..02997d8 100755 --- a/hypr/bemoji +++ b/hypr/bemoji @@ -4,7 +4,7 @@ notify() { notify-send -e "$1" -h "string:x-canonical-private-synchronous:${0##*/}" -i "$2" -u "${3:-normal}" } -download_emoji_file(){ +download_emoji_file() { etag_file="$1.etag" notify "Syncing Emoji Database..." "downloader" curl -sL "https://unicode.org/Public/emoji/latest/emoji-test.txt" --etag-compare "$etag_file" --etag-save "$etag_file" -o "$1" @@ -21,7 +21,7 @@ emoji=$(sed -nE 's|.*fully-qualified.*# (.*)|\1|p' "$emoji_file" | bemenu --fn ' # validation [ -z "$emoji" ] && notify "No Emoji Selected" "" "critical" && exit 1 -# copy to clipboard +# copy to clipboard printf "%s" "$emoji" | wl-copy && notify "Copied: $emoji" "lol" # enter in text diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index a7dcb8d..276d9b7 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -1,10 +1,10 @@ # See https://wiki.hyprland.org/Configuring/Monitors/ monitorv2 { output = eDP-1 - mode = highrr + mode = preferred position = auto scale = 1.5 - vrr = 1 + vrr = 2 bitdepth = 10 } @@ -107,7 +107,6 @@ animations { 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 force_split=2 } @@ -120,7 +119,6 @@ gestures { misc { force_default_wallpaper = 0 - vfr = 1 } xwayland { @@ -140,7 +138,7 @@ bind = $mainMod, W, killactive, bind = $mainMod, M, fullscreen, bind = $mainMod, F, togglefloating, bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, J, layoutmsg,togglesplit # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l @@ -300,6 +298,6 @@ exec-once = hypridle exec-once = ssh-agent exec-once = systemctl --user start hyprpolkitagent exec-once = swaybg -i $HOME/.config/wall/1.png -m fill -exec-once = $hypr_dir/workspace 'focus' +exec-once = $hypr_dir/workspace focus exec-once = $hypr_dir/battery exec-once = $hypr_dir/themes diff --git a/hypr/info b/hypr/info index a04cacb..191262a 100755 --- a/hypr/info +++ b/hypr/info @@ -1,19 +1,19 @@ #!/bin/sh -top -ibn5 -d1 | while read -r line;do +top -ibn5 -d1 | while read -r line; do new_cpu=$(printf "%s" "$line" | sed -nE 's_%Cpu\(s\):[[:space:]]*(.*) us,.*_\1 %_p') new_mem=$(printf "%s" "$line" | sed -nE 's_MiB Mem :[[:space:]]*(.*) total,.*,[[:space:]]*(.*) used,.*_\2 MB / \1 MB_p') cpu=${new_cpu:-$cpu} mem=${new_mem:-$mem} [ -f "/tmp/yt-music/current" ] && . /tmp/yt-music/current - if [ -n "$new_mem" ];then - + if [ -n "$new_mem" ]; then + temp=$(cat /sys/class/thermal/thermal_zone0/temp) : $((temp /= 1000)) bat_stats=$(cat /sys/class/power_supply/BAT0/status) vol_stats=$(wpctl get-volume @DEFAULT_AUDIO_SINK@) charge=$(cat /sys/class/power_supply/BAT0/capacity) - [ "$bat_stats" = "Discharging" ] && { [ "$charge" -lt 20 ] && bat_icon=🪫 || bat_icon=šŸ”‹ ;} || bat_icon=šŸ”Œ + [ "$bat_stats" = "Discharging" ] && { [ "$charge" -lt 20 ] && bat_icon=🪫 || bat_icon=šŸ”‹; } || bat_icon=šŸ”Œ printf '%s' "$vol_stats" | grep -q 'MUTED' && vol_icon=šŸ”‡ || vol_icon=šŸ”Š notify-send -e -i "lol" "<----------(STATS)---------->" "🧠 CPU usage : $cpu\nšŸŒ”ļø Cpu Temp : $temp °C\nšŸ”³ RAM : $mem\n$bat_icon Battery : $charge (${bat_stats})\nā˜€ļø Brightness : $("$(dirname "$0")"/brightness s)%\n$vol_icon Volume : $(printf '%s' "$vol_stats" | tr -cd '[0-9]' | sed 's|^0||g')%\nšŸŽµ $SONG - $ARTIST" -h "string:x-canonical-private-synchronous:${0##*/}" -t 1500 & fi diff --git a/hypr/screenshot b/hypr/screenshot index a71b0b6..f556673 100755 --- a/hypr/screenshot +++ b/hypr/screenshot @@ -3,14 +3,14 @@ tmp_file="/tmp/screenshot.png" [ -f "$tmp_file" ] && rm -f "$tmp_file" killall grim slurp -message="Screenshot copied to clipboard." +message="Screenshot copied to clipboard." urgency="normal" case "$1" in fullclip) grim - | tee "$tmp_file" | wl-copy -t image/png ;; - fullsave) + fullsave) pics_dir="${XDG_PICTURES_DIR:-$HOME/pics}" [ -d "$pics_dir" ] || mkdir -p "$pics_dir" tmp_file="$pics_dir/$(date -u "+%Y-%m-%d_%H-%M-%S").png" @@ -27,4 +27,3 @@ case "$1" in esac notify-send -e -h "string:x-canonical-private-synchronous:${0##*/}" -u "$urgency" -i "$tmp_file" "$message" - diff --git a/hypr/virt-monitor b/hypr/virt-monitor new file mode 100755 index 0000000..72f6947 --- /dev/null +++ b/hypr/virt-monitor @@ -0,0 +1,35 @@ +#!/bin/sh + +load() { + device=$(adb devices | sed '/^\*/d;/^List of devices/d;/^$/d' | cut -f1 | fzf -1) + [ -z "$device" ] && printf "Unable to detect Android using ADB" && exit 1 + RES=$(adb -s "$device" shell dumpsys display | sed -nE 's|^[[:space:]]*DisplayModeRecord.*width=([0-9]*), height=([0-9]*), fps=([0-9\.]*).*|\2x\1@\3|p' | fzf --prompt="Select Resolution > " -1) + position=$(printf 'auto\nauto-left' | fzf --prompt="Which position? >") + if ! hyprctl monitors | grep -q "$HEADLESS"; then + hyprctl output create headless "$HEADLESS" | grep -q 'ok' && printf '\n\nCreate Headless Display: %s' "$HEADLESS" + fi + [ -z "$HEADLESS" ] && printf "Something went wrong\n" && return 1 + hyprctl keyword monitor "$HEADLESS","$RES","$position",'1' + + adb shell svc usb setFunctions rndis + printf "Sleep 2 seconds for USB tethering Interface to be UP and connected/" + sleep 2 + + # show ip + ip r + + # start sunshine + sunshine > /dev/null +} + +unload() { + hyprctl output remove "$HEADLESS" +} + +HEADLESS="HEADLESS-ANDROID" + +trap 'unload' INT HUP + +# run the function +[ -z "$1" ] && help "$@" +$1 "$2" diff --git a/hypr/volume b/hypr/volume index 1591ee0..a315af1 100755 --- a/hypr/volume +++ b/hypr/volume @@ -2,7 +2,7 @@ #shellcheck disable=SC2068 wpctl $@ -vol=$(wpctl get-volume @DEFAULT_SINK@) +vol=$(wpctl get-volume @DEFAULT_SINK@) vol_int=$(printf '%s' "$vol" | tr -cd '[:digit:]') vol_icon="low" [ "$vol_int" -gt 33 ] && vol_icon="medium" diff --git a/hypr/wifi b/hypr/wifi index 0c18d2f..2c150e2 100755 --- a/hypr/wifi +++ b/hypr/wifi @@ -1,6 +1,5 @@ #!/bin/sh - # Wifi wrapper using iwctl # config @@ -8,7 +7,7 @@ adapter="wlan0" divider="--------------------" #menu -menu () { +menu() { bemenu -R 20 --fn 'IBM Plex Sans 15' -i -c -W 0.5 -B 3 -p "$1" -l 26 -I "${2:-0}" -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" -x "$3" } @@ -36,19 +35,19 @@ connect() { output=$? fi - while iwctl station $adapter show | grep -q connecting;do + while iwctl station $adapter show | grep -q connecting; do notify "Connecting to $wifi_name" sleep 1 done - if [ "$output" -ne 0 ]; then + if [ "$output" -ne 0 ]; then notify "Unable to connect to $wifi_name, try again later." return 0 fi notify "Connected: $wifi_name" } -if iwctl device $adapter show | grep -q 'Powered.*off';then +if iwctl device $adapter show | grep -q 'Powered.*off'; then option=$(printf 'Turn On' | menu '[iwd]') [ -z "$option" ] && exit 0 iwctl device $adapter set-property Powered on @@ -67,7 +66,7 @@ while option=$(printf 'Scan\nDisconnect\nTurn Off\nExit\n%s\n%s' "$divider" "$(s ;; Scan) iwctl station $adapter scan - while iwctl station wlan0 show | grep -q 'Scanning.*yes';do + while iwctl station wlan0 show | grep -q 'Scanning.*yes'; do notify "Scanning For Networks" sleep 1 done diff --git a/mimeapps.list b/mimeapps.list index f1fd663..72915d0 100644 --- a/mimeapps.list +++ b/mimeapps.list @@ -40,6 +40,7 @@ application/x-extension-xht=firefox.desktop application/x-bittorrent=torrent.desktop x-scheme-handler/magnet=torrent.desktop hoppscotch=hoppscotch-handler.desktop +audio/flac=mpv.desktop [Added Associations] video/x-matroska=mpv.desktop; @@ -62,3 +63,4 @@ x-scheme-handler/magnet=torrent.desktop; application/x-bittorrent=torrent.desktop; application/x-desktop=nvim.desktop; application/x-php=firefox.desktop; +audio/flac=mpv.desktop; diff --git a/nvim/init.lua b/nvim/init.lua index 6d2a625..8472167 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -19,6 +19,11 @@ if not vim.loop.fs_stat(lazypath) then end set.rtp:prepend(lazypath) require('lazy').setup({ + { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ':TSUpdate' + }, 'wbthomason/packer.nvim', { 'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true } }, 'https://gitlab.com/__tpb/monokai-pro.nvim', @@ -58,16 +63,11 @@ require("mason-lspconfig").setup { local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) -local lspconfig = require('lspconfig') - --for enabling phpactor -lspconfig.phpactor.setup{ - on_attach = on_attach, - init_options = { - ["language_server_phpstan.enabled"] = true, - ["language_server_psalm.enabled"] = false, - } -} +vim.lsp.config("phpactor", { + capabilities = capabilities, + on_attach = on_attach, +}) -- for arduino lsp server --local MY_FQBN = "esp8266:esp8266:nodemcu" @@ -82,11 +82,13 @@ lspconfig.phpactor.setup{ -- Enable some language servers with the additional completion capabilities offered by nvim-cmp -local servers = { 'bashls', 'pyright', 'lua_ls', 'html' ,'cssls'} -for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - capabilities = capabilities, - } +local servers = { 'bashls', 'pyright', 'lua_ls', 'html' ,'cssls', 'phpactor'} +for _, name in ipairs(servers) do + vim.lsp.config(name, { + capabilities = capabilities, + on_attach = on_attach, + }) + vim.lsp.enable(name) end -- luasnip setup diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index f7f9c5e..37bffbd 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,26 +1,26 @@ { - "LuaSnip": { "branch": "master", "commit": "66b5c2707e624dcd2cd3605676c64a2efe47e9d1" }, + "LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "e52e640b7befd8113b3350f46e8cfcfe98fcf730" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c2465eb07db648026eee81005a659abe26e6d077" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lualine.nvim": { "branch": "master", "commit": "131a558e13f9f28b15cd235557150ccb23f89286" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "0c2823e0418f3d9230ff8b201c976e84de1cb401" }, + "mason.nvim": { "branch": "main", "commit": "cb8445f8ce85d957416c106b780efd51c6298f89" }, "monokai-pro.nvim": { "branch": "main", "commit": "8ba1fea7774e7c522b006091a9adb32b5cef95b9" }, - "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "1c75a797b4017fec6491f509cf196c8c8833f26f" }, - "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, - "nvim-lspconfig": { "branch": "master", "commit": "7fac9025a967a4d0846660f751cd392fac6bb788" }, - "nvim-parinfer": { "branch": "master", "commit": "5ca09287ab3f4144f78ff7977fabc27466f71044" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" }, + "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, + "nvim-lspconfig": { "branch": "master", "commit": "31026a13eefb20681124706a79fc1df6bf11ab27" }, + "nvim-parinfer": { "branch": "master", "commit": "3968e669d9f02589aa311d33cb475b16b27c5fbb" }, + "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, "packer.nvim": { "branch": "master", "commit": "ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" } + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "telescope.nvim": { "branch": "master", "commit": "ec009610d5d259ec59a6edf0219ef3f7ee4732e5" } } diff --git a/pcmanfm/default/pcmanfm.conf b/pcmanfm/default/pcmanfm.conf index 4f1d3d7..29b506d 100644 --- a/pcmanfm/default/pcmanfm.conf +++ b/pcmanfm/default/pcmanfm.conf @@ -26,7 +26,7 @@ side_pane_mode=places view_mode=list show_hidden=0 sort=name;ascending; -columns=name:200;desc:143;size:76;mtime:127; +columns=name:200;desc:143;size:76;mtime:1119; toolbar=newtab;navigation;home; show_statusbar=1 pathbar_mode_buttons=0 diff --git a/systemd/user/power-mode@.service b/systemd/user/power-mode@.service new file mode 100644 index 0000000..2889e23 --- /dev/null +++ b/systemd/user/power-mode@.service @@ -0,0 +1,6 @@ +[Unit] +Description=Power Mode (%i) + +[Service] +Type=oneshot +ExecStart=/home/tanveer/.config/hypr/battery %i diff --git a/zed/settings.json b/zed/settings.json index 41958d0..5da832c 100644 --- a/zed/settings.json +++ b/zed/settings.json @@ -1,4 +1,32 @@ { + "agent_servers": { + "gemini": { + "type": "registry" + } + }, + "cli_default_open_behavior": "new_window", + "project_panel": { + "dock": "left" + }, + "outline_panel": { + "dock": "left" + }, + "agent": { + "default_model": { + "provider": "google", + "model": "gemini-3-flash-preview", + "enable_thinking": false + }, + "profiles": { + + }, + "dock": "right", + "favorite_models": [], + "model_parameters": [] + }, + "git_panel": { + "dock": "left" + }, "git": { "inline_blame": { "show_commit_summary": true @@ -48,6 +76,10 @@ "yaml": { "format_on_save": "off", "tab_size": 4, + }, + "Markdown": { + "format_on_save": "off", + "tab_size": 4, } }, } diff --git a/zsh/functions b/zsh/functions index dd078c6..bc40f19 100644 --- a/zsh/functions +++ b/zsh/functions @@ -165,7 +165,7 @@ headless_add() { # kill existing wayvnc and start a new one #pgrep -af "wayvnc" && killall wayvnc - setsid -f wayvnc --output="$headless" --disable-input --socket="/tmp/$headless" --max-fps="$device_fps" 0.0.0.0 $PORT + setsid -f wayvnc --gpu --output="$headless" --disable-input --socket="/tmp/$headless" --max-fps="$((device_fps * 2))" 0.0.0.0 $PORT #reverse port forward to device, and start VNC adb -s "$device" reverse tcp:$PORT tcp:$PORT @@ -181,7 +181,7 @@ headless_rm() { set -x headless=$(hyprctl monitors | sed -nE 's|.*(HEADLESS-ANDROID-[^ ]*).*|\1|p' | fzf --prompt="Select Which Device to Remove >" -0 -1) [ -n "$headless" ] && hyprctl output remove $headless - pid=$(pgrep -af "wayvnc --output=$headless" | cut -d' ' -f1) + pid=$(pgrep "wayvnc --gpu --output=$headless" | cut -d' ' -f1) kill -9 $pid unset headless set +x