From a4173c855e3811628e90fd2259c49ed00f7f921c Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Fri, 27 Jan 2023 07:01:54 +0530 Subject: [PATCH] home/natto: misc changes add mpdris change emacs package hyprland keybind changes random changes to home.packages Signed-off-by: Amneesh Singh --- home/natto/config/emacs/config.org | 2 + home/natto/config/hypr/hyprland.conf | 23 ++++-- home/natto/config/xmonad/xmonad.hs | 12 +-- home/natto/emacs.nix | 2 +- home/natto/gtk.nix | 4 +- home/natto/mpd.nix | 16 +++- home/natto/pkgs.nix | 13 ++- home/natto/wayland.nix | 8 +- home/natto/xsession.nix | 12 +-- pkgs/customscripts/src/dmenu_websearch | 108 ------------------------- 10 files changed, 58 insertions(+), 142 deletions(-) delete mode 100644 pkgs/customscripts/src/dmenu_websearch diff --git a/home/natto/config/emacs/config.org b/home/natto/config/emacs/config.org index 7b083b8..af8b8e5 100644 --- a/home/natto/config/emacs/config.org +++ b/home/natto/config/emacs/config.org @@ -236,6 +236,8 @@ For autocomplete (use-package rustic) +(use-package yuck-mode) + (use-package wgsl-mode) (use-package nix-mode diff --git a/home/natto/config/hypr/hyprland.conf b/home/natto/config/hypr/hyprland.conf index a139850..2db0896 100644 --- a/home/natto/config/hypr/hyprland.conf +++ b/home/natto/config/hypr/hyprland.conf @@ -64,20 +64,24 @@ gestures { workspace_swipe = off } -$mainMod = SUPER + +windowrule=float, ^.*(iwgtk)$ + +$mainMod=SUPER binde=$mainMod, RETURN, exec, foot bindr=SUPER, D, exec, pkill tofi || tofi-drun | xargs hyprctl dispatch exec -- -bindr=SUPER SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec +bindr=SUPER SHIFT, D, exec, pkill tofi || tofi-run --require-match=false | xargs hyprctl dispatch exec -- -bind=$mainMod, P, exec, mpc toggle -bind=, XF86AudioNext, exec, mpc seek +00:00:05 -bind=, XF86AudioPrev, exec, mpc seek -00:00:05 -bind=$mainMod, XF86AudioNext, exec, mpc next -bind=$mainMod, XF86AudioPrev, exec, mpc prev +bind=$mainMod, P, exec, playerctl play-pause +bind=, XF86AudioPlay, exec, playerctl play-pause +bind=, XF86AudioNext, exec, playerctl position 5+ +bind=, XF86AudioPrev, exec, playerctl position 5- +bind=$mainMod, XF86AudioNext, exec, playerctl next +bind=$mainMod, XF86AudioPrev, exec, playerctl previous binde=, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ binde=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -bind=,XF86AudioMute,exec,wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bind=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle binde=, XF86MonBrightnessUp, exec, light -A 5 binde=, XF86MonBrightnessDown, exec, light -U 5 @@ -88,6 +92,9 @@ bind=$mainMod SHIFT, F3, exec, setxkbmap in deva bind=$mainMod SHIFT, F4, exec, setxkbmap in guru bind=$mainMod SHIFT, F5, exec, setxkbmap colemak dhz +bind=, PRINT, exec, grimblast --notify copysave screen +bind=SHIFT, PRINT, exec, grimblast --notify copysave area + binde=$mainMod SHIFT, Q, killactive, bind=$mainMod ALT, f, exit, bind=$mainMod SHIFT, t, pseudo, diff --git a/home/natto/config/xmonad/xmonad.hs b/home/natto/config/xmonad/xmonad.hs index db5b048..9191fb1 100644 --- a/home/natto/config/xmonad/xmonad.hs +++ b/home/natto/config/xmonad/xmonad.hs @@ -70,22 +70,22 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ spawn "flameshot gui -d 10000") , ((modMask, xK_p), - spawn "mpc toggle") + spawn "playerctl play-pause") , ((0, xF86XK_AudioPlay), - spawn "mpc toggle") + spawn "playerctl play-pause") , ((modMask, xF86XK_AudioNext), - spawn "mpc next") + spawn "playerctl next") , ((modMask, xF86XK_AudioPrev), - spawn "mpc prev") + spawn "playerctl previous") , ((0, xF86XK_AudioPrev), - spawn "mpc seek -00:00:05") + spawn "playerctl position 5-") , ((0, xF86XK_AudioNext), - spawn "mpc seek +00:00:05") + spawn "playerctl position 5+") , ((0, xF86XK_AudioRaiseVolume), spawn "pamixer --allow-boost -ui 5") diff --git a/home/natto/emacs.nix b/home/natto/emacs.nix index 56d066a..5730a3a 100644 --- a/home/natto/emacs.nix +++ b/home/natto/emacs.nix @@ -3,7 +3,7 @@ let mymacs = config: # with inputs.emacs-overlay.packages.${pkgs.system}; already resolved with overlay with pkgs; emacsWithPackagesFromUsePackage { inherit config; - package = emacsGit; + package = emacsPgtk; alwaysEnsure = true; alwaysTangle = true; extraEmacsPackages = epkgs: with epkgs; [ diff --git a/home/natto/gtk.nix b/home/natto/gtk.nix index 6578694..333b56a 100644 --- a/home/natto/gtk.nix +++ b/home/natto/gtk.nix @@ -10,8 +10,8 @@ }; }; iconTheme = { - package = pkgs.zafiro-icons; - name = "Zafiro-icons-Dark"; + package = pkgs.papirus-icon-theme; + name = "Papirus-Dark"; }; }; } diff --git a/home/natto/mpd.nix b/home/natto/mpd.nix index f0434eb..58de995 100644 --- a/home/natto/mpd.nix +++ b/home/natto/mpd.nix @@ -3,7 +3,7 @@ let home = config.home.homeDirectory; in { - services = { + services = rec { mpd = { enable = true; musicDirectory = "${home}/Music"; @@ -18,7 +18,7 @@ in }; mpd-discord-rpc = { - enable = true; + inherit (mpd) enable; settings = { id = 1039532008424099850; # dont really care format = { @@ -29,6 +29,16 @@ in }; }; }; + + mpdris2 = { + inherit (mpd) enable; + mpd = { + inherit (mpd) musicDirectory; + host = "localhost"; + }; + }; + + playerctld.enable = true; }; systemd.user.services = { @@ -62,8 +72,8 @@ in visualizerSupport = true; clockSupport = true; }) - mpdas mpc_cli + playerctl ]; file.ncmpcpp = { diff --git a/home/natto/pkgs.nix b/home/natto/pkgs.nix index 6cedb05..9fff25f 100644 --- a/home/natto/pkgs.nix +++ b/home/natto/pkgs.nix @@ -11,6 +11,7 @@ imagemagick # Utils + neofetch rage curl yt-dlp @@ -18,7 +19,6 @@ unrar vim jmtpfs - neofetch (inputs.nbfc.packages.${pkgs.system}.nbfc-client-c) (flake.packages.${pkgs.system}.customscripts) translate-shell @@ -31,17 +31,24 @@ nss = nss_latest; }) inputs.webcord.legacyPackages.${pkgs.system}.webcord + (xfce.thunar.override { + thunarPlugins = with xfce; [ + thunar-media-tags-plugin + thunar-volman + thunar-archive-plugin + ]; + }) + xfce.xfconf + xfce.tumbler qbittorrent hexchat luajit dunst - feh authy gnome.zenity # Wine and games and stuff steam - wineWowPackages.stable winetricks # (inputs.nix-gaming.packages.${pkgs.system}.osu-stable) (flake.packages.${pkgs.system}.tlauncher) diff --git a/home/natto/wayland.nix b/home/natto/wayland.nix index cd90b72..1a65a70 100644 --- a/home/natto/wayland.nix +++ b/home/natto/wayland.nix @@ -1,4 +1,4 @@ -{ pkgs, config, colors, ... }: +{ pkgs, config, colors, inputs, ... }: { wayland = { windowManager = { @@ -49,5 +49,11 @@ home.packages = with pkgs; [ tofi + wineWowPackages.waylandFull + imv + grim + slurp + inputs.hyprland-contrib.packages.${pkgs.system}.grimblast + wl-clipboard ]; } diff --git a/home/natto/xsession.nix b/home/natto/xsession.nix index 6ff4702..037411b 100644 --- a/home/natto/xsession.nix +++ b/home/natto/xsession.nix @@ -18,7 +18,6 @@ }; home.packages = with pkgs; [ - (dmenu.override { patches = [ ./patches/dmenu.patch ]; }) (st.override { patches = [ ./patches/st.patch ]; extraLibs = [ harfbuzz ]; @@ -27,19 +26,12 @@ xorg.xkbcomp xorg.xmodmap sxiv + feh xdotool - (xfce.thunar.override { - thunarPlugins = with xfce; [ - thunar-media-tags-plugin - thunar-volman - thunar-archive-plugin - ]; - }) - xfce.xfconf - xfce.tumbler flameshot xmobar stalonetray + wineWowPackages.stable ]; home.file.stalonetray = { diff --git a/pkgs/customscripts/src/dmenu_websearch b/pkgs/customscripts/src/dmenu_websearch deleted file mode 100644 index 382f019..0000000 --- a/pkgs/customscripts/src/dmenu_websearch +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -# title: dmenu_websearch -# license: CC0 -# author: Sunur Efe Vural -# version: Mar 22, 2019 -# dependencies: dmenu, xdotool, hexdump, xprop, setxkbmap, coreutils. - -# A browser-independent address bar with bookmark support. When the -# cursor is on a web browser it acts as the address bar of that browser. - -browser='firefox --new-window' -engine='https://duckduckgo.com/?q=%s' -bookmarks="$HOME/.bookmarks" - -gotourl() { - if [ "$nbrowser" = surf ] - then - xprop -id "$winid" -f _SURF_GO 8s -set _SURF_GO "$choice" - elif [ -n "$winid" ] && [ -z "$nbrowser" ] - then - #change layout to us cuz xdotool spasms with non-latin layouts - layout=$(setxkbmap -query | awk '/^layout:/{ print $2 }') - setxkbmap -layout us - xdotool key --clearmodifiers "$shortcut"\ - type --clearmodifiers --delay 2 "$choice" - xdotool key --clearmodifiers Return - setxkbmap -layout "$layout" - elif [ -n "$nbrowser" ] - then - $nbrowser "$choice" - else $browser "$choice" - fi -} - -searchweb() { - #convert search query to percent encoding and insert it into url - choice=$(echo "$choice" | hexdump -v -e '/1 " %02x"') - choice=$(echo "$engine" | sed "s/%s/${choice% 0a}/;s/[[:space:]]/%/g") - gotourl -} - -xprop -root | grep '^_NET_ACTIVE_WINDOW' && { - winid=$(xprop -root _NET_ACTIVE_WINDOW | sed 's/.*[[:space:]]//') - class=$(xprop -id "$winid" WM_CLASS | awk -F'\"' '{ print $(NF - 1) }') - case "$class" in - Firefox) nbrowser='firefox' ;; - #Firefox) shortcut='ctrl+l' ;; # alternative method, uses xdotool - IceCat) nbrowser='icecat' ;; - Chromium) nbrowser='chromium' ;; - Chrome) nbrowser='chrome' ;; - Opera) nbrowser='opera' ;; - Vivaldi) nbrowser='vivaldi' ;; # not tested - Brave) nbrowser='brave' ;; # not tested - Conkeror) nbrowser='conkeror' ;; # not tested - Palemoon) nbrowser='palemoon' ;; # not tested - Iceweasel) nbrowser='iceweasel' ;; # not tested - qutebrowser) nbrowser='qutebrowser' ;; - Midori) nbrowser='midori' ;; # not that good - Luakit) nbrowser='luakit' ;; # uses the last window instance - Uzbl|Vimb) shortcut='o' ;; - Links) shortcut='g' ;; - Netsurf*|Epiphany|Dillo|Konqueror|Arora) shortcut='ctrl+l' ;; - Surf) nbrowser='surf' ; uricur=$(xprop -id "$winid" _SURF_URI |\ - awk -F'\"' '{ print $( NF - 1 ) }') ;; - *) pid=$(xprop -id "$winid" _NET_WM_PID | awk '{ print $3 }') - while pgrep -oP "$pid" >/dev/null - do - pid=$(pgrep -oP "$pid") - done - pname=$(awk '/^Name\:/{ print $NF }' /proc/"$pid"/status) || - winid="" ;; - esac - [ -n "$pname" ] && case "$pname" in - w3m) shortcut="U" ;; - lynx|elinks|links) shortcut="g" ;; - *) winid="" ;; - esac -} - -tmpfile=$(mktemp /tmp/dmenu_websearch.XXXXXX) -trap 'rm "$tmpfile"' 0 1 15 -printf '%s\n%s\n' "$uricur" "$1" > "$tmpfile" -cat "$bookmarks" >> "$tmpfile" -sed -i -E '/^(#|$)/d' "$tmpfile" -choice=$(dmenu -i -p "Go:" -w "$winid" < "$tmpfile") || exit 1 - -# Detect links without protocol (This is WIP) -protocol='^(https?|ftps?|mailto|about|file):///?' -checkurl() { - grep -Fx "$choice" "$tmpfile" && - choice=$(echo "$choice" | awk '{ print $1 }') && return 0 - [ ${#choice} -lt 4 ] && return 1 - echo "$choice" | grep -Z ' ' && return 1 - echo "$choice" | grep -EiZ "$protocol" && return 0 - echo "$choice" | grep -FZ '..' && return 1 - prepath=$(echo "$choice" | sed 's/(\/|#|\?).*//') - echo "$prepath" | grep -FvZ '.' && return 1 - echo "$prepath" | grep -EZ '^([[:alnum:]~_:-]+\.?){1,3}' && return 0 -} - -if checkurl -then - echo "$choice" | grep -EivZ "$protocol" && - choice="http://$choice" - gotourl -else searchweb -fi