├── .Xresources ├── .config ├── alacritty.yml ├── fish │ └── config.fish ├── fontconfig │ └── fonts.conf ├── gtk-2.0 │ └── gtkfilechooser.ini ├── gtk-3.0 │ ├── bookmarks │ └── settings.ini ├── gtk-4.0 │ └── settings.ini ├── kdeglobals ├── mpv │ ├── fonts │ │ └── Material-Design-Iconic-Font.ttf │ ├── input.conf │ ├── mpv.conf │ ├── script-opts │ │ ├── stats.conf │ │ └── youtube-quality.conf │ ├── scripts │ │ ├── acompressor.lua │ │ ├── appendURL.lua │ │ ├── audio-osc.lua │ │ ├── auto-profiles.lua │ │ ├── autoload.lua │ │ ├── seek-to.lua │ │ ├── stats.lua │ │ ├── webm.lua │ │ ├── youtube-quality.lua │ │ └── ytdl_hook.lua │ └── shaders │ │ ├── KrigBilateral.glsl │ │ ├── TsubaDS.glsl │ │ ├── TsubaUP.glsl │ │ ├── ravu-zoom-r3-chroma.hook │ │ └── ravu-zoom-r3-rgb.hook └── neofetch │ ├── config.conf │ ├── girl │ ├── neofetch-new-fedora.txt │ └── wolf ├── .xinitrc ├── LICENSE ├── README.md ├── bin ├── clock ├── cputemp ├── eww ├── inhibit_activate ├── inhibit_deactivate ├── lock.sh ├── mem ├── rxfetch ├── spotifystatus ├── updates ├── upt └── weather ├── etc ├── X11 │ └── xorg.conf.d │ │ ├── 00-keyboard.conf │ │ └── 50-mouse-acceleration.conf └── environment ├── herb ├── dunst │ └── dunstrc ├── herbstluftwm │ └── autostart ├── polybar │ ├── colors │ ├── config.ini │ ├── custom │ │ ├── spotify_status.py │ │ └── weather.py │ ├── launch.sh │ ├── modules.ini │ ├── scripts │ │ ├── checkupdates │ │ └── updates.sh │ └── user_modules.ini └── rofi │ ├── alttab.rasi │ ├── clipboard.rasi │ ├── colors.rasi │ ├── confirm.rasi │ ├── launcher.rasi │ ├── message.rasi │ ├── powermenu.rasi │ └── theme │ ├── confirm.rasi │ ├── launcher.rasi │ └── powermenu.rasi ├── kvm ├── ForzaHorizon5.bat ├── hooks │ ├── kernel │ ├── kvm.conf │ ├── qemu │ └── qemu.d │ │ ├── macOS │ │ ├── prepare │ │ │ └── begin │ │ │ │ ├── cpu_pinning.sh │ │ │ │ └── start.sh │ │ └── release │ │ │ └── end │ │ │ ├── cpu_unpinning.sh │ │ │ └── revert.sh │ │ └── win11 │ │ ├── prepare │ │ └── begin │ │ │ ├── assign-hugepages.sh │ │ │ ├── cpu_pinning.sh │ │ │ └── start.sh │ │ └── release │ │ └── end │ │ ├── cpu_unpinning.sh │ │ ├── remove-hugepages.sh │ │ └── revert.sh ├── macos └── virshwin10 ├── screenshots ├── 2bwm.jpg ├── 2bwm.png ├── Galaxy.png ├── awesomewm.png ├── bspwm.jpg ├── herbs.png ├── herbstluftwm.png ├── hern.png ├── i3.png ├── i3_wm.jpg └── vivaldi.png └── spicetifycolors └── Fluent └── onedark /.Xresources: -------------------------------------------------------------------------------- 1 | !Xdefaults -- 2 | Xft.dpi: 96 3 | Xft.antialias: true 4 | Xft.hinting: true 5 | Xft.rgba: rgb 6 | Xft.autohint: false 7 | Xft.hintstyle: hintslight 8 | !hintmedium hintslight hintfull 9 | Xft.lcdfilter: lcddefault 10 | Xcursor.theme: Bibata-Modern-Ice 11 | Xcursor.size: 24 12 | 13 | !URxvt ---------------------------------------------------------------------- ! 14 | 15 | !Fonts -- 16 | 17 | URxvt.font: xft:Iosevka Nerd Font Mono:style=Regular:pixelsize=14 18 | URxvt.boldFont: xft:Iosevka Nerd Font Mono:style=Bold:pixelsize=14 19 | URxvt.italicFont: xft:Iosevka Nerd Font Mono:style=Regular Italic:pixelsize=14 20 | URxvt.bolditalicFont: xft:Iosevka Nerd Font Mono:style=Bold Italic:pixelsize=14 21 | URxvt.letterSpace: -1 22 | URxvt.antialias: true 23 | 24 | !Main Settings -- 25 | 26 | URxvt.termname: xterm-256color 27 | URxvt.iconFile: /usr/share/icons/Papirus/48x48/apps/urxvt.svg 28 | 29 | URxvt.perl-ext-common: ibeamcursor 30 | URxvt.pointerBlank: true 31 | URxvt.saveLines: 5000 32 | URxvt.scrollBar: false 33 | URxvt.cursorBlink: true 34 | URxvt.urgentOnBell: false 35 | URxvt.scrollTtyOutput: true 36 | URxvt.scrollWithBuffer: true 37 | URxvt.scrollTtyKeypress: true 38 | 39 | !Extensions -- 40 | 41 | URxvt.perl-ext: default,clipboard,url-select,keyboard-select,vtwheel 42 | 43 | !Tabs -- 44 | 45 | !URxvt.tabbed.tabbar-fg: 7 46 | !URxvt.tabbed.tabbar-bg: 0 47 | !URxvt.tabbed.tab-fg: 7 48 | !URxvt.tabbed.tab-bg: 0 49 | 50 | !URL Launcher -- 51 | 52 | URxvt.keysym.M-u: perl:url-select:select_next 53 | URxvt.url-select.launcher: /usr/bin/xdg-open 54 | URxvt.url-select.underline: true 55 | URxvt.colorUL: #D9A9A2 56 | URxvt.matcher.button: 1 57 | 58 | !Disable iso14755 -- 59 | 60 | URxvt.iso14755: false 61 | URxvt.iso14755_52: false 62 | 63 | !Clipboard -- 64 | 65 | URxvt.keysym.Shift-Control-V: eval:paste_clipboard 66 | URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard 67 | !Control + arrow navigation -- 68 | 69 | URxvt.keysym.Control-Up:\033[1;5A 70 | URxvt.keysym.Control-Down:\033[1;5B 71 | URxvt.keysym.Control-Left:\033[1;5D 72 | URxvt.keysym.Control-Right:\033[1;5C 73 | 74 | !URxvt window -- 75 | 76 | URxvt*geometry: 76x16 77 | URxvt.internalBorder: 20 78 | -------------------------------------------------------------------------------- /.config/alacritty.yml: -------------------------------------------------------------------------------- 1 | #Alacritty: 2 | 3 | env: 4 | TERM: alacritty 5 | 6 | window: 7 | padding: 8 | x: 25 9 | y: 25 10 | 11 | dynamic_padding: true 12 | decoration: none 13 | 14 | font: 15 | normal: 16 | family: monospace 17 | 18 | bold: 19 | family: monospace 20 | 21 | italic: 22 | family: monospace 23 | 24 | bold_italic: 25 | family: monospace 26 | 27 | size: 10 28 | 29 | colors: 30 | # Default colors 31 | primary: 32 | background: '0x1e2127' 33 | foreground: '0xabb2bf' 34 | 35 | # Bright and dim foreground colors 36 | # 37 | # The dimmed foreground color is calculated automatically if it is not present. 38 | # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors` 39 | # is `false`, the normal foreground color will be used. 40 | #dim_foreground: '0x9a9a9a' 41 | bright_foreground: '0xe6efff' 42 | 43 | # Cursor colors 44 | # 45 | # Colors which should be used to draw the terminal cursor. If these are unset, 46 | # the cursor color will be the inverse of the cell color. 47 | #cursor: 48 | # text: '0x000000' 49 | # cursor: '0xffffff' 50 | 51 | # Normal colors 52 | normal: 53 | black: '0x1e2127' 54 | red: '0xe06c75' 55 | green: '0x98c379' 56 | yellow: '0xd19a66' 57 | blue: '0x61afef' 58 | magenta: '0xc678dd' 59 | cyan: '0x56b6c2' 60 | white: '0x828791' 61 | 62 | # Bright colors 63 | bright: 64 | black: '0x5c6370' 65 | red: '0xe06c75' 66 | green: '0x98c379' 67 | yellow: '0xd19a66' 68 | blue: '0x61afef' 69 | magenta: '0xc678dd' 70 | cyan: '0x56b6c2' 71 | white: '0xe6efff' 72 | 73 | # Dim colors 74 | # 75 | # If the dim colors are not set, they will be calculated automatically based 76 | # on the `normal` colors. 77 | dim: 78 | black: '0x1e2127' 79 | red: '0xe06c75' 80 | green: '0x98c379' 81 | yellow: '0xd19a66' 82 | blue: '0x61afef' 83 | magenta: '0xc678dd' 84 | cyan: '0x56b6c2' 85 | white: '0x828791' 86 | 87 | 88 | #indexed_colors: 89 | #- { index: 16, color: '0xf78c6c' } 90 | #- { index: 17, color: '0xff5370' } 91 | #- { index: 18, color: '0x303030' } 92 | #- { index: 19, color: '0x353535' } 93 | #- { index: 20, color: '0xb2ccd6' } 94 | #- { index: 21, color: '0xeeffff' } 95 | 96 | background_opacity: 1 97 | 98 | cursor: 99 | style: 100 | shape: Beam 101 | blinking: Always 102 | blink_interval: 500 103 | unfocused_hollow: false 104 | thickness: 0.10 105 | 106 | live_config_reload: true 107 | 108 | key_bindings: 109 | 110 | - { key: Key0, mods: Control, action: ResetFontSize } 111 | 112 | - { key: Equals, mods: Control, action: IncreaseFontSize } 113 | 114 | - { key: Minus, mods: Control, action: DecreaseFontSize } 115 | -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | #PATH 2 | set -e fish_user_paths 3 | set -U fish_user_paths $HOME/bin $fish_user_paths 4 | 5 | #Settings 6 | set fish_greeting 7 | set TERM "xterm-256color" 8 | set EDITOR "vim" 9 | 10 | #Manpager 11 | set -x MANPAGER "sh -c 'col -bx | bat -l man -p'" 12 | 13 | #Aliases 14 | #Bat as cat 15 | alias cat="bat" 16 | 17 | #Confirmation before overwriting 18 | alias cp="cp -i" 19 | alias mv='mv -i' 20 | alias rm='rm -i' 21 | 22 | # termbin 23 | alias tb="nc termbin.com 9999" 24 | 25 | #Colorized grep output 26 | alias grep='grep --color=auto' 27 | alias egrep='egrep --color=auto' 28 | alias fgrep='fgrep --color=auto' 29 | 30 | #Some stuff 31 | alias less='bat' 32 | alias l='exa -lahF --color=always --icons --sort=size --group-directories-first' 33 | alias ls='exa -lhF --color=always --icons --sort=size --group-directories-first' 34 | alias lst='exa -lahFT --color=always --icons --sort=size --group-directories-first' 35 | 36 | #Rick Roll 37 | alias rick='curl -s -L http://bit.ly/10hA8iC | bash' 38 | 39 | #Rxfetch info 40 | rxfetch 41 | -------------------------------------------------------------------------------- /.config/fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | false 7 | 8 | 9 | true 10 | 11 | 12 | true 13 | 14 | 15 | hintslight 16 | 17 | 18 | rgb 19 | 20 | 21 | lcddefault 22 | 23 | 24 | 25 | 26 | 27 | monospace 28 | 29 | JetBrainsMono Nerd Font Mono 30 | Noto Color Emoji 31 | 32 | 33 | -------------------------------------------------------------------------------- /.config/gtk-2.0/gtkfilechooser.ini: -------------------------------------------------------------------------------- 1 | [Filechooser Settings] 2 | LocationMode=path-bar 3 | ShowHidden=true 4 | ShowSizeColumn=true 5 | GeometryX=1720 6 | GeometryY=214 7 | GeometryWidth=1354 8 | GeometryHeight=645 9 | SortColumn=name 10 | SortOrder=ascending 11 | StartupMode=recent 12 | -------------------------------------------------------------------------------- /.config/gtk-3.0/bookmarks: -------------------------------------------------------------------------------- 1 | file:///home/led3f/Documents 2 | file:///home/led3f/Downloads 3 | file:///home/led3f/Music 4 | file:///home/led3f/Pictures 5 | file:///home/led3f/Public 6 | file:///home/led3f/Templates 7 | file:///home/led3f/Videos 8 | file:///home/led3f/GM 9 | file:///home/led3f/Pictures/mpv 10 | -------------------------------------------------------------------------------- /.config/gtk-3.0/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | gtk-theme-name=Gruvbox 3 | gtk-icon-theme-name=Tokyo Night 4 | gtk-font-name=SF Pro 10 5 | gtk-cursor-theme-name=Bibata-Modern-Classic 6 | gtk-cursor-theme-size=22 7 | gtk-toolbar-style=GTK_TOOLBAR_BOTH 8 | gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR 9 | gtk-button-images=0 10 | gtk-menu-images=0 11 | gtk-enable-event-sounds=1 12 | gtk-enable-input-feedback-sounds=1 13 | gtk-xft-antialias=1 14 | gtk-xft-hinting=1 15 | gtk-xft-hintstyle=hintslight 16 | gtk-enable-mnemonics=0 17 | gtk-xft-rgba=rgb 18 | -------------------------------------------------------------------------------- /.config/gtk-4.0/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | gtk-theme-name=Tokyo Night 3 | gtk-icon-theme-name=Tokyo Night 4 | gtk-font-name=SF Pro 10 5 | gtk-cursor-theme-name=Bibata-Modern-Classic 6 | gtk-cursor-theme-size=22 7 | gtk-toolbar-style=GTK_TOOLBAR_BOTH 8 | gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR 9 | gtk-button-images=1 10 | gtk-menu-images=1 11 | gtk-enable-event-sounds=1 12 | gtk-enable-input-feedback-sounds=1 13 | gtk-xft-antialias=1 14 | gtk-xft-hinting=1 15 | gtk-xft-hintstyle=hintslight 16 | gtk-enable-mnemonics=0 -------------------------------------------------------------------------------- /.config/kdeglobals: -------------------------------------------------------------------------------- 1 | [$Version] 2 | update_info=filepicker.upd:filepicker-remove-old-previews-entry,fonts_global.upd:Fonts_Global,fonts_global_toolbar.upd:Fonts_Global_Toolbar,icons_remove_effects.upd:IconsRemoveEffects,kwin.upd:animation-speed,style_widgetstyle_default_breeze.upd:StyleWidgetStyleDefaultBreeze 3 | 4 | [ColorEffects:Disabled] 5 | Color=56,56,56 6 | ColorAmount=0 7 | ColorEffect=0 8 | ContrastAmount=0.65 9 | ContrastEffect=1 10 | IntensityAmount=0.1 11 | IntensityEffect=2 12 | 13 | [ColorEffects:Inactive] 14 | ChangeSelectionColor=true 15 | Color=112,111,110 16 | ColorAmount=0.025 17 | ColorEffect=2 18 | ContrastAmount=0.1 19 | ContrastEffect=2 20 | Enable=false 21 | IntensityAmount=0 22 | IntensityEffect=0 23 | 24 | [Colors:Button] 25 | BackgroundAlternate=163,212,250 26 | BackgroundNormal=247,247,247 27 | DecorationFocus=61,174,233 28 | DecorationHover=61,174,233 29 | ForegroundActive=61,174,233 30 | ForegroundInactive=112,125,138 31 | ForegroundLink=41,128,185 32 | ForegroundNegative=218,68,83 33 | ForegroundNeutral=246,116,0 34 | ForegroundNormal=35,38,41 35 | ForegroundPositive=39,174,96 36 | ForegroundVisited=155,89,182 37 | 38 | [Colors:Complementary] 39 | BackgroundAlternate=27,30,32 40 | BackgroundNormal=42,46,50 41 | DecorationFocus=61,174,233 42 | DecorationHover=61,174,233 43 | ForegroundActive=61,174,233 44 | ForegroundInactive=161,169,177 45 | ForegroundLink=29,153,243 46 | ForegroundNegative=218,68,83 47 | ForegroundNeutral=246,116,0 48 | ForegroundNormal=252,252,252 49 | ForegroundPositive=39,174,96 50 | ForegroundVisited=155,89,182 51 | 52 | [Colors:Header] 53 | BackgroundAlternate=239,240,241 54 | BackgroundNormal=222,224,226 55 | DecorationFocus=61,174,233 56 | DecorationHover=61,174,233 57 | ForegroundActive=61,174,233 58 | ForegroundInactive=112,125,138 59 | ForegroundLink=41,128,185 60 | ForegroundNegative=218,68,83 61 | ForegroundNeutral=246,116,0 62 | ForegroundNormal=35,38,41 63 | ForegroundPositive=39,174,96 64 | ForegroundVisited=155,89,182 65 | 66 | [Colors:Header][Inactive] 67 | BackgroundAlternate=227,229,231 68 | BackgroundNormal=239,240,241 69 | DecorationFocus=61,174,233 70 | DecorationHover=61,174,233 71 | ForegroundActive=61,174,233 72 | ForegroundInactive=112,125,138 73 | ForegroundLink=41,128,185 74 | ForegroundNegative=218,68,83 75 | ForegroundNeutral=246,116,0 76 | ForegroundNormal=35,38,41 77 | ForegroundPositive=39,174,96 78 | ForegroundVisited=155,89,182 79 | 80 | [Colors:Selection] 81 | BackgroundAlternate=163,212,250 82 | BackgroundNormal=61,174,233 83 | DecorationFocus=61,174,233 84 | DecorationHover=61,174,233 85 | ForegroundActive=255,255,255 86 | ForegroundInactive=112,125,138 87 | ForegroundLink=253,188,75 88 | ForegroundNegative=176,55,69 89 | ForegroundNeutral=198,92,0 90 | ForegroundNormal=255,255,255 91 | ForegroundPositive=23,104,57 92 | ForegroundVisited=155,89,182 93 | 94 | [Colors:Tooltip] 95 | BackgroundAlternate=239,240,241 96 | BackgroundNormal=247,247,247 97 | DecorationFocus=61,174,233 98 | DecorationHover=61,174,233 99 | ForegroundActive=61,174,233 100 | ForegroundInactive=112,125,138 101 | ForegroundLink=41,128,185 102 | ForegroundNegative=218,68,83 103 | ForegroundNeutral=246,116,0 104 | ForegroundNormal=35,38,41 105 | ForegroundPositive=39,174,96 106 | ForegroundVisited=155,89,182 107 | 108 | [Colors:View] 109 | BackgroundAlternate=247,247,247 110 | BackgroundNormal=255,255,255 111 | DecorationFocus=61,174,233 112 | DecorationHover=61,174,233 113 | ForegroundActive=61,174,233 114 | ForegroundInactive=112,125,138 115 | ForegroundLink=41,128,185 116 | ForegroundNegative=218,68,83 117 | ForegroundNeutral=246,116,0 118 | ForegroundNormal=35,38,41 119 | ForegroundPositive=39,174,96 120 | ForegroundVisited=155,89,182 121 | 122 | [Colors:Window] 123 | BackgroundAlternate=227,229,231 124 | BackgroundNormal=239,240,241 125 | DecorationFocus=61,174,233 126 | DecorationHover=61,174,233 127 | ForegroundActive=61,174,233 128 | ForegroundInactive=112,125,138 129 | ForegroundLink=41,128,185 130 | ForegroundNegative=218,68,83 131 | ForegroundNeutral=246,116,0 132 | ForegroundNormal=35,38,41 133 | ForegroundPositive=39,174,96 134 | ForegroundVisited=155,89,182 135 | 136 | [General] 137 | ColorScheme=BreezeLight 138 | Name=Breeze Light 139 | TerminalApplication=alacritty 140 | shadeSortColumn=true 141 | widgetStyle=Breeze 142 | 143 | [Icons] 144 | Theme=breeze 145 | 146 | [KDE] 147 | ColorScheme=BreezeLight 148 | contrast=4 149 | widgetStyle=Breeze 150 | 151 | [KFileDialog Settings] 152 | Allow Expansion=false 153 | Automatically select filename extension=true 154 | Breadcrumb Navigation=true 155 | Decoration position=2 156 | LocationCombo Completionmode=5 157 | PathCombo Completionmode=5 158 | Show Bookmarks=false 159 | Show Full Path=false 160 | Show Inline Previews=true 161 | Show Preview=false 162 | Show Speedbar=true 163 | Show hidden files=true 164 | Sort by=Name 165 | Sort directories first=true 166 | Sort reversed=false 167 | Speedbar Width=176 168 | TerminalApplication=st 169 | View Style=Simple 170 | 171 | [WM] 172 | activeBackground=227,229,231 173 | activeBlend=227,229,231 174 | activeForeground=35,38,41 175 | inactiveBackground=239,240,241 176 | inactiveBlend=239,240,241 177 | inactiveForeground=112,125,138 178 | -------------------------------------------------------------------------------- /.config/mpv/fonts/Material-Design-Iconic-Font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LeD3F/dots/726f38abc469d7357b65ae5234f98202a72451e9/.config/mpv/fonts/Material-Design-Iconic-Font.ttf -------------------------------------------------------------------------------- /.config/mpv/input.conf: -------------------------------------------------------------------------------- 1 | WHEEL_UP add volume 2 2 | WHEEL_DOWN add volume -2 3 | UP add volume 2 4 | DOWN add volume -2 5 | AXIS_UP add volume 2 6 | AXIS_DOWN add volume -2 7 | Shift+RIGHT frame-step 8 | Shift+LEFT frame-back-step 9 | H seek -65 10 | h seek 65 11 | v cycle deband 12 | a cycle audio 13 | s screenshot 14 | i cycle interpolation 15 | t script-message-to seek_to toggle-seeker 16 | + add audio-delay 0.010 17 | - add audio-delay -0.010 18 | F1 add sub-delay -0.1 19 | F2 add sub-delay +0.1 20 | F4 cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1" 21 | 22 | CTRL+p script-message osc-playlist 23 | -------------------------------------------------------------------------------- /.config/mpv/mpv.conf: -------------------------------------------------------------------------------- 1 | # Player # 2 | input-ipc-server=/tmp/mpvsocket 3 | hr-seek-framedrop=no 4 | no-resume-playback 5 | msg-color=yes 6 | msg-module=yes 7 | 8 | # Screenshots # 9 | screenshot-template="/home/led3f/Pictures/mpv/Screenshot-%F-T%wH.%wM.%wS.%wT-F%{estimated-frame-number}" 10 | screenshot-format=png # Set screenshot format 11 | screenshot-png-compression=0 # Range is 0 to 10. 0 being no compression. 12 | screenshot-tag-colorspace=yes 13 | screenshot-high-bit-depth=yes # Same output bitdepth as the video 14 | 15 | # OSC/OSD # 16 | no-osc 17 | osc=yes 18 | script-opts=osc-scalewindowed=0.5,osc-scalefullscreen=0.5 19 | osd-level=0 20 | 21 | # Subs # 22 | sub-ass-vsfilter-blur-compat=yes # Backward compatibility for vsfilter fansubs 23 | sub-ass-scale-with-window=no # May have undesired effects with signs being misplaced. 24 | sub-auto=fuzzy # external subs don't have to match the file name exactly to autoload 25 | sub-file-paths-append=ass # search for external subs in these relative subdirectories 26 | sub-file-paths-append=srt 27 | sub-file-paths-append=sub 28 | sub-file-paths-append=subs 29 | sub-file-paths-append=subtitles 30 | sub-font-size=30 31 | demuxer-mkv-subtitle-preroll # try to correctly show embedded subs when seeking 32 | embeddedfonts=yes # use embedded fonts for SSA/ASS subs 33 | sub-fix-timing=no # do not try to fix gaps (which might make it worse in some cases). Enable if there are scenebleeds. 34 | 35 | # Audio # 36 | volume-max=100 # maximum volume in %, everything above 100 results in amplification 37 | audio-file-auto=fuzzy # external audio doesn't has to match the file name exactly to autoload 38 | audio-pitch-correction=yes # automatically insert scaletempo when playing with higher speed 39 | 40 | # Languages # 41 | alang=jpn,jp,eng,en,enUS,en-US,de,ger 42 | slang=eng,en,und,de,ger,jp,jap 43 | 44 | # Video Profiles # 45 | 46 | gpu-api=vulkan 47 | hwdec=auto-copy 48 | vulkan-async-compute=yes 49 | vulkan-async-transfer=yes 50 | vulkan-queue-count=1 51 | autofit=85%x85% 52 | dither=error-diffusion 53 | deband=yes 54 | deband-iterations=2 55 | deband-threshold=20 56 | deband-range=16 57 | scale=ewa_hanning 58 | scale-radius=3.2383154841662362 59 | cscale=ewa_lanczossoft 60 | dscale=mitchell 61 | scale-antiring=0 62 | cscale-antiring=0 63 | correct-downscaling=yes 64 | linear-downscaling=no 65 | sigmoid-upscaling=yes 66 | video-sync=display-resample 67 | tscale=box 68 | tscale-window=quadric 69 | tscale-radius=1.1 70 | tscale-clamp=0.0 71 | interpolation=no 72 | blend-subtitles=no 73 | hdr-compute-peak=yes 74 | tone-mapping=mobius 75 | 76 | [protocol.file] 77 | network-timeout=0 78 | force-window=yes 79 | cache=yes 80 | demuxer-max-bytes=2000MiB 81 | demuxer-readahead-secs=300 82 | force-seekable=yes 83 | 84 | [protocol-network] 85 | network-timeout=5 86 | #force-window=immediate 87 | hls-bitrate=max 88 | cache=yes 89 | demuxer-max-bytes=2000MiB 90 | demuxer-readahead-secs=300 91 | 92 | [protocol.http] 93 | profile=protocol-network 94 | 95 | [protocol.https] 96 | profile=protocol-network 97 | 98 | [shaders-high] 99 | glsl-shaders-clr 100 | glsl-shader="~~/shaders/TsubaUP.glsl" 101 | 102 | [shaders-medium] 103 | glsl-shaders-clr 104 | glsl-shader="~~/shaders/ravu-zoom-r3-rgb.hook" 105 | 106 | [default] 107 | 108 | # profile=shaders-high 109 | # profile=shaders-medium 110 | -------------------------------------------------------------------------------- /.config/mpv/script-opts/stats.conf: -------------------------------------------------------------------------------- 1 | # MPV - stats.conf 2 | # deus0ww - 2020-01-21 3 | 4 | duration=2 5 | persistent_overlay=yes 6 | filter_params_max_length=0 7 | 8 | plot_perfdata=no 9 | plot_vsync_ratio=no 10 | plot_vsync_jitter=no 11 | 12 | font=Helvetica Neue LT Com 13 | font_mono=Helvetica Neue LT Com 14 | font_size=2 15 | font_color=F0F0F0 16 | border_size=0.5 17 | border_color=000000 18 | alpha=32 19 | -------------------------------------------------------------------------------- /.config/mpv/script-opts/youtube-quality.conf: -------------------------------------------------------------------------------- 1 | toggle_menu_binding=ctrl+f 2 | up_binding=UP 3 | down_binding=DOWN 4 | select_binding=ENTER 5 | 6 | selected_and_active=▶ - 7 | selected_and_inactive=● - 8 | unselected_and_active=▷ - 9 | unselected_and_inactive=○ - 10 | 11 | scale_playlist_by_window=no 12 | 13 | style_ass_tags={\\fnmonospace} 14 | 15 | text_padding_x=5 16 | text_padding_y=5 17 | 18 | menu_timeout=10 19 | 20 | fetch_formats=yes 21 | 22 | quality_strings=[ {"4320p" : "bestvideo[height<=?4320p]+bestaudio/best"}, {"2160p" : "bestvideo[height<=?2160]+bestaudio/best"}, {"1440p" : "bestvideo[height<=?1440]+bestaudio/best"}, {"1080p" : "bestvideo[height<=?1080]+bestaudio/best"}, {"720p" : "bestvideo[height<=?720]+bestaudio/best"}, {"480p" : "bestvideo[height<=?480]+bestaudio/best"}, {"360p" : "bestvideo[height<=?360]+bestaudio/best"}, {"240p" : "bestvideo[height<=?240]+bestaudio/best"}, {"144p" : "bestvideo[height<=?144]+bestaudio/best"} ] 23 | -------------------------------------------------------------------------------- /.config/mpv/scripts/acompressor.lua: -------------------------------------------------------------------------------- 1 | local mp = require 'mp' 2 | local options = require 'mp.options' 3 | 4 | local o = { 5 | default_enable = false, 6 | show_osd = true, 7 | osd_timeout = 4000, 8 | filter_label = mp.get_script_name(), 9 | 10 | key_toggle = 'n', 11 | key_increase_threshold = 'F1', 12 | key_decrease_threshold = 'Shift+F1', 13 | key_increase_ratio = 'F2', 14 | key_decrease_ratio = 'Shift+F2', 15 | key_increase_knee = 'F3', 16 | key_decrease_knee = 'Shift+F3', 17 | key_increase_makeup = 'F4', 18 | key_decrease_makeup = 'Shift+F4', 19 | key_increase_attack = 'F5', 20 | key_decrease_attack = 'Shift+F5', 21 | key_increase_release = 'F6', 22 | key_decrease_release = 'Shift+F6', 23 | 24 | default_threshold = -25.0, 25 | default_ratio = 3.0, 26 | default_knee = 2.0, 27 | default_makeup = 8.0, 28 | default_attack = 20.0, 29 | default_release = 250.0, 30 | 31 | step_threshold = -2.5, 32 | step_ratio = 1.0, 33 | step_knee = 1.0, 34 | step_makeup = 1.0, 35 | step_attack = 10.0, 36 | step_release = 10.0, 37 | } 38 | options.read_options(o) 39 | 40 | local params = { 41 | { name = 'attack', min=0.01, max=2000, hide_default=true, dB='' }, 42 | { name = 'release', min=0.01, max=9000, hide_default=true, dB='' }, 43 | { name = 'threshold', min= -30, max= 0, hide_default=false, dB='dB' }, 44 | { name = 'ratio', min= 1, max= 20, hide_default=false, dB='' }, 45 | { name = 'knee', min= 1, max= 10, hide_default=true, dB='dB' }, 46 | { name = 'makeup', min= 0, max= 24, hide_default=false, dB='dB' }, 47 | } 48 | 49 | local function parse_value(value) 50 | -- Using nil here because tonumber differs between lua 5.1 and 5.2 when parsing fractions in combination with explicit base argument set to 10. 51 | -- And we can't omit it because gsub returns 2 values which would get unpacked and cause more problems. Gotta love scripting languages. 52 | return tonumber(value:gsub('dB$', ''), nil) 53 | end 54 | 55 | local function format_value(value, dB) 56 | return string.format('%g%s', value, dB) 57 | end 58 | 59 | local function show_osd(filter) 60 | if not o.show_osd then 61 | return 62 | end 63 | 64 | if not filter.enabled then 65 | mp.commandv('show-text', 'Dynamic range compressor: disabled', o.osd_timeout) 66 | return 67 | end 68 | 69 | local pretty = {} 70 | for _,param in ipairs(params) do 71 | local value = parse_value(filter.params[param.name]) 72 | if not (param.hide_default and value == o['default_' .. param.name]) then 73 | pretty[#pretty+1] = string.format('%s: %g%s', param.name:gsub("^%l", string.upper), value, param.dB) 74 | end 75 | end 76 | 77 | if #pretty == 0 then 78 | pretty = '' 79 | else 80 | pretty = '\n(' .. table.concat(pretty, ', ') .. ')' 81 | end 82 | 83 | mp.commandv('show-text', 'Dynamic range compressor: enabled' .. pretty, o.osd_timeout) 84 | end 85 | 86 | local function get_filter() 87 | local af = mp.get_property_native('af', {}) 88 | 89 | for i = 1, #af do 90 | if af[i].label == o.filter_label then 91 | return af, i 92 | end 93 | end 94 | 95 | af[#af+1] = { 96 | name = 'acompressor', 97 | label = o.filter_label, 98 | enabled = false, 99 | params = {}, 100 | } 101 | 102 | for _,param in pairs(params) do 103 | af[#af].params[param.name] = format_value(o['default_' .. param.name], param.dB) 104 | end 105 | 106 | return af, #af 107 | end 108 | 109 | local function toggle_acompressor() 110 | local af, i = get_filter() 111 | af[i].enabled = not af[i].enabled 112 | mp.set_property_native('af', af) 113 | show_osd(af[i]) 114 | end 115 | 116 | local function update_param(name, increment) 117 | for _,param in pairs(params) do 118 | if param.name == string.lower(name) then 119 | local af, i = get_filter() 120 | local value = parse_value(af[i].params[param.name]) 121 | value = math.max(param.min, math.min(value + increment, param.max)) 122 | af[i].params[param.name] = format_value(value, param.dB) 123 | af[i].enabled = true 124 | mp.set_property_native('af', af) 125 | show_osd(af[i]) 126 | return 127 | end 128 | end 129 | 130 | mp.msg.error('Unknown parameter "' .. name .. '"') 131 | end 132 | 133 | mp.add_key_binding(o.key_toggle, "toggle-acompressor", toggle_acompressor) 134 | mp.register_script_message('update-param', update_param) 135 | 136 | for _,param in pairs(params) do 137 | for direction,step in pairs({increase=1, decrease=-1}) do 138 | mp.add_key_binding(o['key_' .. direction .. '_' .. param.name], 139 | 'acompressor-' .. direction .. '-' .. param.name, 140 | function() update_param(param.name, step*o['step_' .. param.name]); end, 141 | { repeatable = true }) 142 | end 143 | end 144 | 145 | if o.default_enable then 146 | local af, i = get_filter() 147 | af[i].enabled = true 148 | mp.set_property_native('af', af) 149 | end -------------------------------------------------------------------------------- /.config/mpv/scripts/appendURL.lua: -------------------------------------------------------------------------------- 1 | -- appendurl - Tsubajashi 2 | 3 | local platform = nil --set to 'linux', 'windows' or 'macos' to override automatic assign 4 | 5 | if not platform then 6 | local o = {} 7 | if mp.get_property_native('options/vo-mmcss-profile', o) ~= o then 8 | platform = 'windows' 9 | elseif mp.get_property_native('options/input-app-events', o) ~= o then 10 | platform = 'macos' 11 | else 12 | platform = 'linux' 13 | end 14 | end 15 | 16 | local utils = require 'mp.utils' 17 | local msg = require 'mp.msg' 18 | 19 | --main function 20 | function append(primaryselect) 21 | local clipboard = get_clipboard(primaryselect or false) 22 | if clipboard then 23 | mp.commandv("loadfile", clipboard, "append-play") 24 | mp.osd_message("URL appended: "..clipboard) 25 | msg.info("URL appended: "..clipboard) 26 | end 27 | end 28 | 29 | --handles the subprocess response table and return clipboard if it was a success 30 | function handleres(res, args, primary) 31 | if not res.error and res.status == 0 then 32 | return res.stdout 33 | else 34 | --if clipboard failed try primary selection 35 | if platform=='linux' and not primary then 36 | append(true) 37 | return nil 38 | end 39 | msg.error("There was an error getting "..platform.." clipboard: ") 40 | msg.error(" Status: "..(res.status or "")) 41 | msg.error(" Error: "..(res.error or "")) 42 | msg.error(" stdout: "..(res.stdout or "")) 43 | msg.error("args: "..utils.to_string(args)) 44 | return nil 45 | end 46 | end 47 | 48 | function get_clipboard(primary) 49 | if platform == 'linux' then 50 | local args = { 'xclip', '-selection', primary and 'primary' or 'clipboard', '-out' } 51 | return handleres(utils.subprocess({ args = args }), args, primary) 52 | elseif platform == 'windows' then 53 | local args = { 54 | 'powershell', '-NoProfile', '-Command', [[& { 55 | Trap { 56 | Write-Error -ErrorRecord $_ 57 | Exit 1 58 | } 59 | 60 | $clip = "" 61 | if (Get-Command "Get-Clipboard" -errorAction SilentlyContinue) { 62 | $clip = Get-Clipboard -Raw -Format Text -TextFormatType UnicodeText 63 | } else { 64 | Add-Type -AssemblyName PresentationCore 65 | $clip = [Windows.Clipboard]::GetText() 66 | } 67 | 68 | $clip = $clip -Replace "`r","" 69 | $u8clip = [System.Text.Encoding]::UTF8.GetBytes($clip) 70 | [Console]::OpenStandardOutput().Write($u8clip, 0, $u8clip.Length) 71 | }]] 72 | } 73 | return handleres(utils.subprocess({ args = args }), args) 74 | elseif platform == 'macos' then 75 | local args = { 'pbpaste' } 76 | return handleres(utils.subprocess({ args = args }), args) 77 | end 78 | return nil 79 | end 80 | 81 | mp.add_key_binding("ctrl+v", "appendURL", append) -------------------------------------------------------------------------------- /.config/mpv/scripts/audio-osc.lua: -------------------------------------------------------------------------------- 1 | -- show osc all the time when file is an audio file. 2 | -- source: https://github.com/mpv-player/mpv/issues/3500#issuecomment-305646994 3 | 4 | mp.register_event("file-loaded", function() 5 | local hasvid = mp.get_property_osd("video") ~= "no" 6 | mp.commandv("script-message", "osc-visibility", (hasvid and "auto" or "always"), "no-osd") 7 | -- remove the next line if you don't want to affect the osd-bar config 8 | mp.commandv("set", "options/osd-bar", (hasvid and "yes" or "no")) 9 | end) -------------------------------------------------------------------------------- /.config/mpv/scripts/auto-profiles.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | 3 | Automatically apply profiles based on runtime conditions. 4 | At least mpv 0.21.0 is required. 5 | 6 | This script queries the list of loaded config profiles, and checks the 7 | "profile-desc" field of each profile. If it starts with "cond:", the script 8 | parses the string as Lua expression, and evaluates it. If the expression 9 | returns true, the profile is applied, if it returns false, it is ignored. 10 | 11 | Expressions can reference properties by accessing "p". For example, "p.pause" 12 | would return the current pause status. If the variable name contains any "_" 13 | characters, they are turned into "-". For example, "playback_time" would 14 | return the property "playback-time". (Although you can also just write 15 | p["playback-time"].) 16 | 17 | Note that if a property is not available, it will return nil, which can cause 18 | errors if used in expressions. These are printed and ignored, and the 19 | expression is considered to be false. You can also write e.g. 20 | get("playback-time", 0) instead of p.playback_time to default to 0. 21 | 22 | Whenever a property referenced by a profile condition changes, the condition 23 | is re-evaluated. If the return value of the condition changes from false or 24 | error to true, the profile is applied. 25 | 26 | Note that profiles cannot be "unapplied", so you may have to define inverse 27 | profiles with inverse conditions do undo a profile. 28 | 29 | Using profile-desc is just a hack - maybe it will be changed later. 30 | 31 | Supported --script-opts: 32 | 33 | auto-profiles: if set to "no", the script disables itself (but will still 34 | listen to property notifications etc. - if you set it to 35 | "yes" again, it will re-evaluate the current state) 36 | 37 | Example profiles: 38 | 39 | # the profile names aren't used (except for logging), but must not clash with 40 | # other profiles 41 | [test] 42 | profile-desc=cond:p.playback_time>10 43 | video-zoom=2 44 | 45 | # you would need this to actually "unapply" the "test" profile 46 | [test-revert] 47 | profile-desc=cond:p.playback_time<=10 48 | video-zoom=0 49 | 50 | --]] 51 | 52 | local utils = require 'mp.utils' 53 | local msg = require 'mp.msg' 54 | 55 | local profiles = {} 56 | local watched_properties = {} -- indexed by property name (used as a set) 57 | local cached_properties = {} -- property name -> last known raw value 58 | local properties_to_profiles = {} -- property name -> set of profiles using it 59 | local have_dirty_profiles = false -- at least one profile is marked dirty 60 | 61 | -- Used during evaluation of the profile condition, and should contain the 62 | -- profile the condition is evaluated for. 63 | local current_profile = nil 64 | 65 | local function evaluate(profile) 66 | msg.verbose("Re-evaluate auto profile " .. profile.name) 67 | 68 | current_profile = profile 69 | local status, res = pcall(profile.cond) 70 | current_profile = nil 71 | 72 | if not status then 73 | -- errors can be "normal", e.g. in case properties are unavailable 74 | msg.info("Error evaluating: " .. res) 75 | res = false 76 | elseif type(res) ~= "boolean" then 77 | msg.error("Profile '" .. profile.name .. "' did not return a boolean.") 78 | res = false 79 | end 80 | if res ~= profile.status and res == true then 81 | msg.info("Applying profile " .. profile.name) 82 | mp.commandv("apply-profile", profile.name) 83 | end 84 | profile.status = res 85 | profile.dirty = false 86 | end 87 | 88 | local function on_property_change(name, val) 89 | cached_properties[name] = val 90 | -- Mark all profiles reading this property as dirty, so they get re-evaluated 91 | -- the next time the script goes back to sleep. 92 | local dependent_profiles = properties_to_profiles[name] 93 | if dependent_profiles then 94 | for profile, _ in pairs(dependent_profiles) do 95 | assert(profile.cond) -- must be a profile table 96 | profile.dirty = true 97 | have_dirty_profiles = true 98 | end 99 | end 100 | end 101 | 102 | local function on_idle() 103 | if mp.get_opt("auto-profiles") == "no" then 104 | return 105 | end 106 | 107 | -- When events and property notifications stop, re-evaluate all dirty profiles. 108 | if have_dirty_profiles then 109 | for _, profile in ipairs(profiles) do 110 | if profile.dirty then 111 | evaluate(profile) 112 | end 113 | end 114 | end 115 | have_dirty_profiles = false 116 | end 117 | 118 | mp.register_idle(on_idle) 119 | 120 | local evil_meta_magic = { 121 | __index = function(table, key) 122 | -- interpret everything as property, unless it already exists as 123 | -- a non-nil global value 124 | local v = _G[key] 125 | if type(v) ~= "nil" then 126 | return v 127 | end 128 | -- Lua identifiers can't contain "-", so in order to match with mpv 129 | -- property conventions, replace "_" to "-" 130 | key = string.gsub(key, "_", "-") 131 | -- Normally, we use the cached value only (to reduce CPU usage I guess?) 132 | if not watched_properties[key] then 133 | watched_properties[key] = true 134 | mp.observe_property(key, "native", on_property_change) 135 | cached_properties[key] = mp.get_property_native(key) 136 | end 137 | -- The first time the property is read we need add it to the 138 | -- properties_to_profiles table, which will be used to mark the profile 139 | -- dirty if a property referenced by it changes. 140 | if current_profile then 141 | local map = properties_to_profiles[key] 142 | if not map then 143 | map = {} 144 | properties_to_profiles[key] = map 145 | end 146 | map[current_profile] = true 147 | end 148 | return cached_properties[key] 149 | end, 150 | } 151 | 152 | local evil_magic = {} 153 | setmetatable(evil_magic, evil_meta_magic) 154 | 155 | local function compile_cond(name, s) 156 | chunk, err = loadstring("return " .. s, "profile " .. name .. " condition") 157 | if not chunk then 158 | msg.error("Profile '" .. name .. "' condition: " .. err) 159 | return function() return false end 160 | end 161 | return chunk 162 | end 163 | 164 | for i, v in ipairs(mp.get_property_native("profile-list")) do 165 | local desc = v["profile-desc"] 166 | if desc and desc:sub(1, 5) == "cond:" then 167 | local profile = { 168 | name = v.name, 169 | cond = compile_cond(v.name, desc:sub(6)), 170 | properties = {}, 171 | status = nil, 172 | dirty = true, -- need re-evaluate 173 | } 174 | profiles[#profiles + 1] = profile 175 | have_dirty_profiles = true 176 | end 177 | end 178 | 179 | -- these definitions are for use by the condition expressions 180 | 181 | p = evil_magic 182 | 183 | function get(property_name, default) 184 | local val = p[property_name] 185 | if val == nil then 186 | val = default 187 | end 188 | return val 189 | end 190 | 191 | -- re-evaluate all profiles immediately 192 | on_idle() -------------------------------------------------------------------------------- /.config/mpv/scripts/autoload.lua: -------------------------------------------------------------------------------- 1 | MAXENTRIES = 5000 2 | 3 | local msg = require 'mp.msg' 4 | local options = require 'mp.options' 5 | local utils = require 'mp.utils' 6 | 7 | o = { 8 | disabled = false 9 | } 10 | options.read_options(o) 11 | 12 | function Set (t) 13 | local set = {} 14 | for _, v in pairs(t) do set[v] = true end 15 | return set 16 | end 17 | 18 | EXTENSIONS = Set { 19 | 'mkv', 'avi', 'mp4', 'ogv', 'webm', 'rmvb', 'flv', 'wmv', 'mpeg', 'mpg', 'm4v', '3gp', 'mov', 'f4v', 20 | 'mp3', 'wav', 'ogm', 'flac', 'm4a', 'wma', 'ogg', 'opus', 21 | } 22 | 23 | function add_files_at(index, files) 24 | index = index - 1 25 | local oldcount = mp.get_property_number("playlist-count", 1) 26 | for i = 1, #files do 27 | mp.commandv("loadfile", files[i], "append") 28 | mp.commandv("playlist-move", oldcount + i - 1, index + i - 1) 29 | end 30 | end 31 | 32 | function get_extension(path) 33 | match = string.match(path, "%.([^%.]+)$" ) 34 | if match == nil then 35 | return "nomatch" 36 | else 37 | return match 38 | end 39 | end 40 | 41 | table.filter = function(t, iter) 42 | for i = #t, 1, -1 do 43 | if not iter(t[i]) then 44 | table.remove(t, i) 45 | end 46 | end 47 | end 48 | 49 | function splitbynum(s) 50 | local result = {} 51 | for x, y in (s or ""):gmatch("(%d*)(%D*)") do 52 | if x ~= "" then table.insert(result, tonumber(x)) end 53 | if y ~= "" then table.insert(result, y) end 54 | end 55 | return result 56 | end 57 | 58 | function clean_key(k) 59 | k = (' '..k..' '):gsub("%s+", " "):sub(2, -2):lower() 60 | return splitbynum(k) 61 | end 62 | 63 | function alnumcomp(x, y) 64 | local xt, yt = clean_key(x), clean_key(y) 65 | for i = 1, math.min(#xt, #yt) do 66 | local xe, ye = xt[i], yt[i] 67 | if type(xe) == "string" then ye = tostring(ye) 68 | elseif type(ye) == "string" then xe = tostring(xe) end 69 | if xe ~= ye then return xe < ye end 70 | end 71 | return #xt < #yt 72 | end 73 | 74 | local autoloaded = nil 75 | 76 | function find_and_add_entries() 77 | local path = mp.get_property("path", "") 78 | local dir, filename = utils.split_path(path) 79 | msg.trace(("dir: %s, filename: %s"):format(dir, filename)) 80 | if o.disabled then 81 | msg.verbose("stopping: autoload disabled") 82 | elseif #dir == 0 then 83 | msg.verbose("stopping: not a local path") 84 | return 85 | end 86 | 87 | local pl_count = mp.get_property_number("playlist-count", 1) 88 | if (pl_count > 1 and autoloaded == nil) or 89 | (pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then 90 | return 91 | else 92 | autoloaded = true 93 | end 94 | 95 | local pl = mp.get_property_native("playlist", {}) 96 | local pl_current = mp.get_property_number("playlist-pos-1", 1) 97 | msg.trace(("playlist-pos-1: %s, playlist: %s"):format(pl_current, 98 | utils.to_string(pl))) 99 | 100 | local files = utils.readdir(dir, "files") 101 | if files == nil then 102 | return 103 | end 104 | table.filter(files, function (v, k) 105 | if string.match(v, "^%.") then 106 | return false 107 | end 108 | local ext = get_extension(v) 109 | if ext == nil then 110 | return false 111 | end 112 | return EXTENSIONS[string.lower(ext)] 113 | end) 114 | table.sort(files, alnumcomp) 115 | 116 | if dir == "." then 117 | dir = "" 118 | end 119 | 120 | local current 121 | for i = 1, #files do 122 | if files[i] == filename then 123 | current = i 124 | break 125 | end 126 | end 127 | if current == nil then 128 | return 129 | end 130 | msg.trace("current file position in files: "..current) 131 | 132 | local append = {[-1] = {}, [1] = {}} 133 | for direction = -1, 1, 2 do 134 | for i = 1, MAXENTRIES do 135 | local file = files[current + i * direction] 136 | local pl_e = pl[pl_current + i * direction] 137 | if file == nil or file[1] == "." then 138 | break 139 | end 140 | 141 | local filepath = dir .. file 142 | if pl_e then 143 | msg.trace(pl_e.filename.." == "..filepath.." ?") 144 | if pl_e.filename == filepath then 145 | break 146 | end 147 | end 148 | 149 | if direction == -1 then 150 | if pl_current == 1 then 151 | msg.info("Prepending " .. file) 152 | table.insert(append[-1], 1, filepath) 153 | end 154 | else 155 | msg.info("Adding " .. file) 156 | table.insert(append[1], filepath) 157 | end 158 | end 159 | end 160 | 161 | add_files_at(pl_current + 1, append[1]) 162 | add_files_at(pl_current, append[-1]) 163 | end 164 | 165 | mp.register_event("start-file", find_and_add_entries) 166 | -------------------------------------------------------------------------------- /.config/mpv/scripts/seek-to.lua: -------------------------------------------------------------------------------- 1 | local assdraw = require 'mp.assdraw' 2 | local active = false 3 | local cursor_position = 1 4 | local time_scale = {60*60*10, 60*60, 60*10, 60, 10, 1, 0.1, 0.01, 0.001} 5 | 6 | local ass_begin = mp.get_property("osd-ass-cc/0") 7 | local ass_end = mp.get_property("osd-ass-cc/1") 8 | 9 | local history = { {} } 10 | for i = 1, 9 do 11 | history[1][i] = 0 12 | end 13 | local history_position = 1 14 | 15 | local timer = nil 16 | local timer_duration = 3 17 | 18 | function show_seeker() 19 | local prepend_char = {'','',':','',':','','.','',''} 20 | local str = '' 21 | for i = 1, 9 do 22 | str = str .. prepend_char[i] 23 | if i == cursor_position then 24 | str = str .. '{\\b1}' .. history[history_position][i] .. '{\\r}' 25 | else 26 | str = str .. history[history_position][i] 27 | end 28 | end 29 | mp.osd_message("Seek to: " .. ass_begin .. str .. ass_end, timer_duration) 30 | end 31 | 32 | function copy_history_to_last() 33 | if history_position ~= #history then 34 | for i = 1, 9 do 35 | history[#history][i] = history[history_position][i] 36 | end 37 | history_position = #history 38 | end 39 | end 40 | 41 | function change_number(i) 42 | if (cursor_position == 3 or cursor_position == 5) and i >= 6 then 43 | return 44 | end 45 | if history[history_position][cursor_position] ~= i then 46 | copy_history_to_last() 47 | history[#history][cursor_position] = i 48 | end 49 | shift_cursor(false) 50 | end 51 | 52 | function shift_cursor(left) 53 | if left then 54 | cursor_position = math.max(1, cursor_position - 1) 55 | else 56 | cursor_position = math.min(cursor_position + 1, 9) 57 | end 58 | end 59 | 60 | function current_time_as_sec(time) 61 | local sec = 0 62 | for i = 1, 9 do 63 | sec = sec + time_scale[i] * time[i] 64 | end 65 | return sec 66 | end 67 | 68 | function time_equal(lhs, rhs) 69 | for i = 1, 9 do 70 | if lhs[i] ~= rhs[i] then 71 | return false 72 | end 73 | end 74 | return true 75 | end 76 | 77 | function seek_to() 78 | copy_history_to_last() 79 | mp.commandv("osd-bar", "seek", current_time_as_sec(history[history_position]), "absolute") 80 | if #history == 1 or not time_equal(history[history_position], history[#history - 1]) then 81 | history[#history + 1] = {} 82 | history_position = #history 83 | end 84 | for i = 1, 9 do 85 | history[#history][i] = 0 86 | end 87 | end 88 | 89 | function backspace() 90 | if cursor_position ~= 9 or current_time[9] == 0 then 91 | shift_cursor(true) 92 | end 93 | if history[history_position][cursor_position] ~= 0 then 94 | copy_history_to_last() 95 | history[#history][cursor_position] = 0 96 | end 97 | end 98 | 99 | function history_move(up) 100 | if up then 101 | history_position = math.max(1, history_position - 1) 102 | else 103 | history_position = math.min(history_position + 1, #history) 104 | end 105 | end 106 | 107 | local key_mappings = { 108 | LEFT = function() shift_cursor(true) show_seeker() end, 109 | RIGHT = function() shift_cursor(false) show_seeker() end, 110 | UP = function() history_move(true) show_seeker() end, 111 | DOWN = function() history_move(false) show_seeker() end, 112 | BS = function() backspace() show_seeker() end, 113 | ESC = function() set_inactive() end, 114 | ENTER = function() seek_to() set_inactive() end 115 | } 116 | for i = 0, 9 do 117 | local func = function() change_number(i) show_seeker() end 118 | key_mappings[string.format("KP%d", i)] = func 119 | key_mappings[string.format("%d", i)] = func 120 | end 121 | 122 | function set_active() 123 | if not mp.get_property("seekable") then return end 124 | local duration = mp.get_property_number("duration") 125 | if duration ~= nil then 126 | for i = 1, 9 do 127 | if duration > time_scale[i] then 128 | cursor_position = i 129 | break 130 | end 131 | end 132 | end 133 | for key, func in pairs(key_mappings) do 134 | mp.add_forced_key_binding(key, "seek-to-"..key, func) 135 | end 136 | show_seeker() 137 | timer = mp.add_periodic_timer(timer_duration, show_seeker) 138 | active = true 139 | end 140 | 141 | function set_inactive() 142 | mp.osd_message("") 143 | for key, _ in pairs(key_mappings) do 144 | mp.remove_key_binding("seek-to-"..key) 145 | end 146 | timer:kill() 147 | active = false 148 | end 149 | 150 | mp.add_key_binding(nil, "toggle-seeker", function() if active then set_inactive() else set_active() end end) 151 | -------------------------------------------------------------------------------- /.config/mpv/scripts/youtube-quality.lua: -------------------------------------------------------------------------------- 1 | local mp = require 'mp' 2 | local utils = require 'mp.utils' 3 | local msg = require 'mp.msg' 4 | local assdraw = require 'mp.assdraw' 5 | 6 | local opts = { 7 | toggle_menu_binding = "ctrl+f", 8 | up_binding = "UP", 9 | down_binding = "DOWN", 10 | select_binding = "ENTER", 11 | 12 | selected_and_active = "▶ - ", 13 | selected_and_inactive = "● - ", 14 | unselected_and_active = "▷ - ", 15 | unselected_and_inactive = "○ - ", 16 | 17 | scale_playlist_by_window=false, 18 | 19 | style_ass_tags = "{\\fnmonospace}", 20 | 21 | text_padding_x = 5, 22 | text_padding_y = 5, 23 | 24 | menu_timeout = 10, 25 | 26 | fetch_formats = true, 27 | 28 | quality_strings=[[ 29 | [ 30 | {"4320p" : "bestvideo[height<=?4320p]+bestaudio/best"}, 31 | {"2160p" : "bestvideo[height<=?2160]+bestaudio/best"}, 32 | {"1440p" : "bestvideo[height<=?1440]+bestaudio/best"}, 33 | {"1080p" : "bestvideo[height<=?1080]+bestaudio/best"}, 34 | {"720p" : "bestvideo[height<=?720]+bestaudio/best"}, 35 | {"480p" : "bestvideo[height<=?480]+bestaudio/best"}, 36 | {"360p" : "bestvideo[height<=?360]+bestaudio/best"} 37 | ] 38 | ]], 39 | } 40 | (require 'mp.options').read_options(opts, "youtube-quality") 41 | opts.quality_strings = utils.parse_json(opts.quality_strings) 42 | 43 | 44 | function show_menu() 45 | local selected = 1 46 | local active = 0 47 | local current_ytdl_format = mp.get_property("ytdl-format") 48 | msg.verbose("current ytdl-format: "..current_ytdl_format) 49 | local num_options = 0 50 | local options = {} 51 | 52 | 53 | if opts.fetch_formats then 54 | options, num_options = download_formats() 55 | end 56 | 57 | if next(options) == nil then 58 | for i,v in ipairs(opts.quality_strings) do 59 | num_options = num_options + 1 60 | for k,v2 in pairs(v) do 61 | options[i] = {label = k, format=v2} 62 | if v2 == current_ytdl_format then 63 | active = i 64 | selected = active 65 | end 66 | end 67 | end 68 | end 69 | 70 | for i,v in ipairs(options) do 71 | if v.format == current_ytdl_format then 72 | active = i 73 | selected = active 74 | break 75 | end 76 | end 77 | 78 | function selected_move(amt) 79 | selected = selected + amt 80 | if selected < 1 then selected = num_options 81 | elseif selected > num_options then selected = 1 end 82 | timeout:kill() 83 | timeout:resume() 84 | draw_menu() 85 | end 86 | function choose_prefix(i) 87 | if i == selected and i == active then return opts.selected_and_active 88 | elseif i == selected then return opts.selected_and_inactive end 89 | 90 | if i ~= selected and i == active then return opts.unselected_and_active 91 | elseif i ~= selected then return opts.unselected_and_inactive end 92 | return "> " 93 | end 94 | 95 | function draw_menu() 96 | local ass = assdraw.ass_new() 97 | 98 | ass:pos(opts.text_padding_x, opts.text_padding_y) 99 | ass:append(opts.style_ass_tags) 100 | 101 | for i,v in ipairs(options) do 102 | ass:append(choose_prefix(i)..v.label.."\\N") 103 | end 104 | 105 | local w, h = mp.get_osd_size() 106 | if opts.scale_playlist_by_window then w,h = 0, 0 end 107 | mp.set_osd_ass(w, h, ass.text) 108 | end 109 | 110 | function destroy() 111 | timeout:kill() 112 | mp.set_osd_ass(0,0,"") 113 | mp.remove_key_binding("move_up") 114 | mp.remove_key_binding("move_down") 115 | mp.remove_key_binding("select") 116 | mp.remove_key_binding("escape") 117 | end 118 | timeout = mp.add_periodic_timer(opts.menu_timeout, destroy) 119 | 120 | mp.add_forced_key_binding(opts.up_binding, "move_up", function() selected_move(-1) end, {repeatable=true}) 121 | mp.add_forced_key_binding(opts.down_binding, "move_down", function() selected_move(1) end, {repeatable=true}) 122 | mp.add_forced_key_binding(opts.select_binding, "select", function() 123 | destroy() 124 | mp.set_property("ytdl-format", options[selected].format) 125 | reload_resume() 126 | end) 127 | mp.add_forced_key_binding(opts.toggle_menu_binding, "escape", destroy) 128 | 129 | draw_menu() 130 | return 131 | end 132 | 133 | local ytdl = { 134 | path = "youtube-dl", 135 | searched = false, 136 | blacklisted = {} 137 | } 138 | 139 | format_cache={} 140 | function download_formats() 141 | local function exec(args) 142 | local ret = utils.subprocess({args = args}) 143 | return ret.status, ret.stdout, ret 144 | end 145 | 146 | local function table_size(t) 147 | s = 0 148 | for i,v in ipairs(t) do 149 | s = s+1 150 | end 151 | return s 152 | end 153 | 154 | local url = mp.get_property("path") 155 | 156 | url = string.gsub(url, "ytdl://", "") 157 | 158 | if format_cache[url] ~= nil then 159 | local res = format_cache[url] 160 | return res, table_size(res) 161 | end 162 | mp.osd_message("fetching available formats with youtube-dl...", 60) 163 | 164 | if not (ytdl.searched) then 165 | local ytdl_mcd = mp.find_config_file("youtube-dl") 166 | if not (ytdl_mcd == nil) then 167 | msg.verbose("found youtube-dl at: " .. ytdl_mcd) 168 | ytdl.path = ytdl_mcd 169 | end 170 | ytdl.searched = true 171 | end 172 | 173 | local command = {ytdl.path, "--no-warnings", "--no-playlist", "-J"} 174 | table.insert(command, url) 175 | local es, json, result = exec(command) 176 | 177 | if (es < 0) or (json == nil) or (json == "") then 178 | mp.osd_message("fetching formats failed...", 1) 179 | msg.error("failed to get format list: " .. err) 180 | return {}, 0 181 | end 182 | 183 | local json, err = utils.parse_json(json) 184 | 185 | if (json == nil) then 186 | mp.osd_message("fetching formats failed...", 1) 187 | msg.error("failed to parse JSON data: " .. err) 188 | return {}, 0 189 | end 190 | 191 | res = {} 192 | msg.verbose("youtube-dl succeeded!") 193 | for i,v in ipairs(json.formats) do 194 | if v.vcodec ~= "none" then 195 | local fps = v.fps and v.fps.."fps" or "" 196 | local resolution = string.format("%sx%s", v.width, v.height) 197 | local l = string.format("%-9s %-5s (%-4s / %s)", resolution, fps, v.ext, v.vcodec) 198 | local f = string.format("%s+bestaudio/best", v.format_id) 199 | table.insert(res, {label=l, format=f, width=v.width }) 200 | end 201 | end 202 | 203 | table.sort(res, function(a, b) return a.width > b.width end) 204 | 205 | mp.osd_message("", 0) 206 | format_cache[url] = res 207 | return res, table_size(res) 208 | end 209 | 210 | mp.add_forced_key_binding(opts.toggle_menu_binding, "quality-menu", show_menu) 211 | 212 | function reload_resume() 213 | function reload(path, time_pos) 214 | msg.debug("reload", path, time_pos) 215 | if time_pos == nil then 216 | mp.commandv("loadfile", path, "replace") 217 | else 218 | mp.commandv("loadfile", path, "replace", "start=+" .. time_pos) 219 | end 220 | end 221 | 222 | local path = mp.get_property("path") 223 | local time_pos = mp.get_property("time-pos") 224 | local reload_duration = mp.get_property_native("duration") 225 | 226 | local playlist_count = mp.get_property_number("playlist/count") 227 | local playlist_pos = mp.get_property_number("playlist-pos") 228 | local playlist = {} 229 | for i = 0, playlist_count-1 do 230 | playlist[i] = mp.get_property("playlist/" .. i .. "/filename") 231 | end 232 | 233 | if reload_duration and reload_duration > 0 then 234 | msg.info("reloading video from", time_pos, "second") 235 | reload(path, time_pos) 236 | else 237 | msg.info("reloading stream") 238 | reload(path, nil) 239 | end 240 | msg.info("file ", playlist_pos+1, " of ", playlist_count, "in playlist") 241 | for i = 0, playlist_pos-1 do 242 | mp.commandv("loadfile", playlist[i], "append") 243 | end 244 | mp.commandv("playlist-move", 0, playlist_pos+1) 245 | for i = playlist_pos+1, playlist_count-1 do 246 | mp.commandv("loadfile", playlist[i], "append") 247 | end 248 | end 249 | -------------------------------------------------------------------------------- /.config/mpv/scripts/ytdl_hook.lua: -------------------------------------------------------------------------------- 1 | -- source: https://github.com/mpv-player/mpv/blob/master/player/lua/ytdl_hook.lua 2 | local utils = require 'mp.utils' 3 | local msg = require 'mp.msg' 4 | local options = require 'mp.options' 5 | 6 | local o = { 7 | exclude = "", 8 | try_ytdl_first = false, 9 | use_manifests = false 10 | } 11 | options.read_options(o) 12 | 13 | local ytdl = { 14 | path = "youtube-dl", 15 | searched = false, 16 | blacklisted = {} 17 | } 18 | 19 | local chapter_list = {} 20 | 21 | function Set (t) 22 | local set = {} 23 | for _, v in pairs(t) do set[v] = true end 24 | return set 25 | end 26 | 27 | local safe_protos = Set { 28 | "http", "https", "ftp", "ftps", 29 | "rtmp", "rtmps", "rtmpe", "rtmpt", "rtmpts", "rtmpte", 30 | "data" 31 | } 32 | 33 | local function exec(args) 34 | local ret = utils.subprocess({args = args}) 35 | return ret.status, ret.stdout, ret, ret.killed_by_us 36 | end 37 | 38 | -- return true if it was explicitly set on the command line 39 | local function option_was_set(name) 40 | return mp.get_property_bool("option-info/" ..name.. "/set-from-commandline", 41 | false) 42 | end 43 | 44 | -- return true if the option was set locally 45 | local function option_was_set_locally(name) 46 | return mp.get_property_bool("option-info/" ..name.. "/set-locally", false) 47 | end 48 | 49 | -- youtube-dl may set special http headers for some sites (user-agent, cookies) 50 | local function set_http_headers(http_headers) 51 | if not http_headers then 52 | return 53 | end 54 | local headers = {} 55 | local useragent = http_headers["User-Agent"] 56 | if useragent and not option_was_set("user-agent") then 57 | mp.set_property("file-local-options/user-agent", useragent) 58 | end 59 | local additional_fields = {"Cookie", "Referer", "X-Forwarded-For"} 60 | for idx, item in pairs(additional_fields) do 61 | local field_value = http_headers[item] 62 | if field_value then 63 | headers[#headers + 1] = item .. ": " .. field_value 64 | end 65 | end 66 | if #headers > 0 and not option_was_set("http-header-fields") then 67 | mp.set_property_native("file-local-options/http-header-fields", headers) 68 | end 69 | end 70 | 71 | local function append_libav_opt(props, name, value) 72 | if not props then 73 | props = {} 74 | end 75 | 76 | if name and value and not props[name] then 77 | props[name] = value 78 | end 79 | 80 | return props 81 | end 82 | 83 | local function edl_escape(url) 84 | return "%" .. string.len(url) .. "%" .. url 85 | end 86 | 87 | local function url_is_safe(url) 88 | local proto = type(url) == "string" and url:match("^(.+)://") or nil 89 | local safe = proto and safe_protos[proto] 90 | if not safe then 91 | msg.error(("Ignoring potentially unsafe url: '%s'"):format(url)) 92 | end 93 | return safe 94 | end 95 | 96 | local function time_to_secs(time_string) 97 | local ret 98 | 99 | local a, b, c = time_string:match("(%d+):(%d%d?):(%d%d)") 100 | if a ~= nil then 101 | ret = (a*3600 + b*60 + c) 102 | else 103 | a, b = time_string:match("(%d%d?):(%d%d)") 104 | if a ~= nil then 105 | ret = (a*60 + b) 106 | end 107 | end 108 | 109 | return ret 110 | end 111 | 112 | local function extract_chapters(data, video_length) 113 | local ret = {} 114 | 115 | for line in data:gmatch("[^\r\n]+") do 116 | local time = time_to_secs(line) 117 | if time and (time < video_length) then 118 | table.insert(ret, {time = time, title = line}) 119 | end 120 | end 121 | table.sort(ret, function(a, b) return a.time < b.time end) 122 | return ret 123 | end 124 | 125 | local function is_blacklisted(url) 126 | if o.exclude == "" then return false end 127 | if #ytdl.blacklisted == 0 then 128 | local joined = o.exclude 129 | while joined:match('%|?[^|]+') do 130 | local _, e, substring = joined:find('%|?([^|]+)') 131 | table.insert(ytdl.blacklisted, substring) 132 | joined = joined:sub(e+1) 133 | end 134 | end 135 | if #ytdl.blacklisted > 0 then 136 | url = url:match('https?://(.+)') 137 | for _, exclude in ipairs(ytdl.blacklisted) do 138 | if url:match(exclude) then 139 | msg.verbose('URL matches excluded substring. Skipping.') 140 | return true 141 | end 142 | end 143 | end 144 | return false 145 | end 146 | 147 | local function parse_yt_playlist(url, json) 148 | -- return 0-based index to use with --playlist-start 149 | 150 | if not json.extractor or json.extractor ~= "youtube:playlist" then 151 | return nil 152 | end 153 | 154 | local query = url:match("%?.+") 155 | if not query then return nil end 156 | 157 | local args = {} 158 | for arg, param in query:gmatch("(%a+)=([^&?]+)") do 159 | if arg and param then 160 | args[arg] = param 161 | end 162 | end 163 | 164 | local maybe_idx = tonumber(args["index"]) 165 | 166 | -- if index matches v param it's probably the requested item 167 | if maybe_idx and #json.entries >= maybe_idx and 168 | json.entries[maybe_idx].id == args["v"] then 169 | msg.debug("index matches requested video") 170 | return maybe_idx - 1 171 | end 172 | 173 | -- if there's no index or it doesn't match, look for video 174 | for i = 1, #json.entries do 175 | if json.entries[i] == args["v"] then 176 | msg.debug("found requested video in index " .. (i - 1)) 177 | return i - 1 178 | end 179 | end 180 | 181 | msg.debug("requested video not found in playlist") 182 | -- if item isn't on the playlist, give up 183 | return nil 184 | end 185 | 186 | local function make_absolute_url(base_url, url) 187 | if url:find("https?://") == 1 then return url end 188 | 189 | local proto, domain, rest = 190 | base_url:match("(https?://)([^/]+/)(.*)/?") 191 | local segs = {} 192 | rest:gsub("([^/]+)", function(c) table.insert(segs, c) end) 193 | url:gsub("([^/]+)", function(c) table.insert(segs, c) end) 194 | local resolved_url = {} 195 | for i, v in ipairs(segs) do 196 | if v == ".." then 197 | table.remove(resolved_url) 198 | elseif v ~= "." then 199 | table.insert(resolved_url, v) 200 | end 201 | end 202 | return proto .. domain .. 203 | table.concat(resolved_url, "/") 204 | end 205 | 206 | local function join_url(base_url, fragment) 207 | local res = "" 208 | if base_url and fragment.path then 209 | res = make_absolute_url(base_url, fragment.path) 210 | elseif fragment.url then 211 | res = fragment.url 212 | end 213 | return res 214 | end 215 | 216 | local function edl_track_joined(fragments, protocol, is_live, base) 217 | if not (type(fragments) == "table") or not fragments[1] then 218 | msg.debug("No fragments to join into EDL") 219 | return nil 220 | end 221 | 222 | local edl = "edl://" 223 | local offset = 1 224 | local parts = {} 225 | 226 | if (protocol == "http_dash_segments") and 227 | not fragments[1].duration and not is_live then 228 | -- assume MP4 DASH initialization segment 229 | table.insert(parts, 230 | "!mp4_dash,init=" .. edl_escape(join_url(base, fragments[1]))) 231 | offset = 2 232 | 233 | -- Check remaining fragments for duration; 234 | -- if not available in all, give up. 235 | for i = offset, #fragments do 236 | if not fragments[i].duration then 237 | msg.error("EDL doesn't support fragments" .. 238 | "without duration with MP4 DASH") 239 | return nil 240 | end 241 | end 242 | end 243 | 244 | for i = offset, #fragments do 245 | local fragment = fragments[i] 246 | if not url_is_safe(join_url(base, fragment)) then 247 | return nil 248 | end 249 | table.insert(parts, edl_escape(join_url(base, fragment))) 250 | if fragment.duration then 251 | parts[#parts] = 252 | parts[#parts] .. ",length="..fragment.duration 253 | end 254 | end 255 | return edl .. table.concat(parts, ";") .. ";" 256 | end 257 | 258 | local function has_native_dash_demuxer() 259 | local demuxers = mp.get_property_native("demuxer-lavf-list", {}) 260 | for _, v in ipairs(demuxers) do 261 | if v == "dash" then 262 | return true 263 | end 264 | end 265 | return false 266 | end 267 | 268 | local function valid_manifest(json) 269 | local reqfmt = json["requested_formats"] and json["requested_formats"][1] or {} 270 | if not reqfmt["manifest_url"] and not json["manifest_url"] then 271 | return false 272 | end 273 | local proto = reqfmt["protocol"] or json["protocol"] or "" 274 | return (proto == "http_dash_segments" and has_native_dash_demuxer()) or 275 | proto:find("^m3u8") 276 | end 277 | 278 | local function add_single_video(json) 279 | local streamurl = "" 280 | local max_bitrate = 0 281 | local reqfmts = json["requested_formats"] 282 | 283 | -- prefer manifest_url if present 284 | if o.use_manifests and valid_manifest(json) then 285 | local mpd_url = reqfmts and reqfmts[1]["manifest_url"] or 286 | json["manifest_url"] 287 | if not mpd_url then 288 | msg.error("No manifest URL found in JSON data.") 289 | return 290 | elseif not url_is_safe(mpd_url) then 291 | return 292 | end 293 | 294 | streamurl = mpd_url 295 | 296 | if reqfmts then 297 | for _, track in pairs(reqfmts) do 298 | max_bitrate = track.tbr > max_bitrate and 299 | track.tbr or max_bitrate 300 | end 301 | elseif json.tbr then 302 | max_bitrate = json.tbr > max_bitrate and json.tbr or max_bitrate 303 | end 304 | 305 | -- DASH/split tracks 306 | elseif reqfmts then 307 | for _, track in pairs(reqfmts) do 308 | local edl_track = nil 309 | edl_track = edl_track_joined(track.fragments, 310 | track.protocol, json.is_live, 311 | track.fragment_base_url) 312 | if not edl_track and not url_is_safe(track.url) then 313 | return 314 | end 315 | if track.vcodec and track.vcodec ~= "none" then 316 | -- video track 317 | streamurl = edl_track or track.url 318 | elseif track.vcodec == "none" then 319 | -- according to ytdl, if vcodec is None, it's audio 320 | mp.commandv("audio-add", 321 | edl_track or track.url, "auto", 322 | track.format_note or "") 323 | end 324 | end 325 | 326 | elseif not (json.url == nil) then 327 | local edl_track = nil 328 | edl_track = edl_track_joined(json.fragments, json.protocol, 329 | json.is_live, json.fragment_base_url) 330 | 331 | if not edl_track and not url_is_safe(json.url) then 332 | return 333 | end 334 | -- normal video or single track 335 | streamurl = edl_track or json.url 336 | set_http_headers(json.http_headers) 337 | else 338 | msg.error("No URL found in JSON data.") 339 | return 340 | end 341 | 342 | msg.debug("streamurl: " .. streamurl) 343 | 344 | mp.set_property("stream-open-filename", streamurl:gsub("^data:", "data://", 1)) 345 | 346 | mp.set_property("file-local-options/force-media-title", json.title) 347 | 348 | -- set hls-bitrate for dash track selection 349 | if max_bitrate > 0 and 350 | not option_was_set("hls-bitrate") and 351 | not option_was_set_locally("hls-bitrate") then 352 | mp.set_property_native('file-local-options/hls-bitrate', max_bitrate*1000) 353 | end 354 | 355 | -- add subtitles 356 | if not (json.requested_subtitles == nil) then 357 | for lang, sub_info in pairs(json.requested_subtitles) do 358 | msg.verbose("adding subtitle ["..lang.."]") 359 | 360 | local sub = nil 361 | 362 | if not (sub_info.data == nil) then 363 | sub = "memory://"..sub_info.data 364 | elseif not (sub_info.url == nil) and 365 | url_is_safe(sub_info.url) then 366 | sub = sub_info.url 367 | end 368 | 369 | if not (sub == nil) then 370 | mp.commandv("sub-add", sub, 371 | "auto", sub_info.ext, lang) 372 | else 373 | msg.verbose("No subtitle data/url for ["..lang.."]") 374 | end 375 | end 376 | end 377 | 378 | -- add chapters 379 | if json.chapters then 380 | msg.debug("Adding pre-parsed chapters") 381 | for i = 1, #json.chapters do 382 | local chapter = json.chapters[i] 383 | local title = chapter.title or "" 384 | if title == "" then 385 | title = string.format('Chapter %02d', i) 386 | end 387 | table.insert(chapter_list, {time=chapter.start_time, title=title}) 388 | end 389 | elseif not (json.description == nil) and not (json.duration == nil) then 390 | chapter_list = extract_chapters(json.description, json.duration) 391 | end 392 | 393 | -- set start time 394 | if not (json.start_time == nil) and 395 | not option_was_set("start") and 396 | not option_was_set_locally("start") then 397 | msg.debug("Setting start to: " .. json.start_time .. " secs") 398 | mp.set_property("file-local-options/start", json.start_time) 399 | end 400 | 401 | -- set aspect ratio for anamorphic video 402 | if not (json.stretched_ratio == nil) and 403 | not option_was_set("video-aspect") then 404 | mp.set_property('file-local-options/video-aspect', json.stretched_ratio) 405 | end 406 | 407 | local stream_opts = mp.get_property_native("file-local-options/stream-lavf-o", {}) 408 | 409 | -- for rtmp 410 | if (json.protocol == "rtmp") then 411 | stream_opts = append_libav_opt(stream_opts, 412 | "rtmp_tcurl", streamurl) 413 | stream_opts = append_libav_opt(stream_opts, 414 | "rtmp_pageurl", json.page_url) 415 | stream_opts = append_libav_opt(stream_opts, 416 | "rtmp_playpath", json.play_path) 417 | stream_opts = append_libav_opt(stream_opts, 418 | "rtmp_swfverify", json.player_url) 419 | stream_opts = append_libav_opt(stream_opts, 420 | "rtmp_swfurl", json.player_url) 421 | stream_opts = append_libav_opt(stream_opts, 422 | "rtmp_app", json.app) 423 | end 424 | 425 | if json.proxy and json.proxy ~= "" then 426 | stream_opts = append_libav_opt(stream_opts, 427 | "http_proxy", json.proxy) 428 | end 429 | 430 | mp.set_property_native("file-local-options/stream-lavf-o", stream_opts) 431 | end 432 | 433 | function run_ytdl_hook(url) 434 | local start_time = os.clock() 435 | 436 | -- check for youtube-dl in mpv's config dir 437 | if not (ytdl.searched) then 438 | local exesuf = (package.config:sub(1,1) == '\\') and '.exe' or '' 439 | local ytdl_mcd = mp.find_config_file("youtube-dl" .. exesuf) 440 | if not (ytdl_mcd == nil) then 441 | msg.verbose("found youtube-dl at: " .. ytdl_mcd) 442 | ytdl.path = ytdl_mcd 443 | end 444 | ytdl.searched = true 445 | end 446 | 447 | -- strip ytdl:// 448 | if (url:find("ytdl://") == 1) then 449 | url = url:sub(8) 450 | end 451 | 452 | local format = mp.get_property("options/ytdl-format") 453 | local raw_options = mp.get_property_native("options/ytdl-raw-options") 454 | local allsubs = true 455 | local proxy = nil 456 | local use_playlist = false 457 | 458 | local command = { 459 | ytdl.path, "--no-warnings", "-J", "--flat-playlist", 460 | "--sub-format", "ass/srt/best" 461 | } 462 | 463 | -- Checks if video option is "no", change format accordingly, 464 | -- but only if user didn't explicitly set one 465 | if (mp.get_property("options/vid") == "no") 466 | and not option_was_set("ytdl-format") then 467 | 468 | format = "bestaudio/best" 469 | msg.verbose("Video disabled. Only using audio") 470 | end 471 | 472 | if (format == "") then 473 | format = "bestvideo+bestaudio/best" 474 | end 475 | table.insert(command, "--format") 476 | table.insert(command, format) 477 | 478 | for param, arg in pairs(raw_options) do 479 | table.insert(command, "--" .. param) 480 | if (arg ~= "") then 481 | table.insert(command, arg) 482 | end 483 | if (param == "sub-lang") and (arg ~= "") then 484 | allsubs = false 485 | elseif (param == "proxy") and (arg ~= "") then 486 | proxy = arg 487 | elseif (param == "yes-playlist") then 488 | use_playlist = true 489 | end 490 | end 491 | 492 | if (allsubs == true) then 493 | table.insert(command, "--all-subs") 494 | end 495 | if not use_playlist then 496 | table.insert(command, "--no-playlist") 497 | end 498 | table.insert(command, "--") 499 | table.insert(command, url) 500 | msg.debug("Running: " .. table.concat(command,' ')) 501 | local es, json, result, aborted = exec(command) 502 | 503 | if aborted then 504 | return 505 | end 506 | 507 | if (es < 0) or (json == nil) or (json == "") then 508 | local err = "youtube-dl failed: " 509 | if result.error and result.error == "init" then 510 | err = err .. "not found or not enough permissions" 511 | elseif not result.killed_by_us then 512 | err = err .. "unexpected error ocurred" 513 | else 514 | err = string.format("%s returned '%d'", err, es) 515 | end 516 | msg.error(err) 517 | return 518 | end 519 | 520 | local json, err = utils.parse_json(json) 521 | 522 | if (json == nil) then 523 | msg.error("failed to parse JSON data: " .. err) 524 | return 525 | end 526 | 527 | msg.verbose("youtube-dl succeeded!") 528 | msg.debug('ytdl parsing took '..os.clock()-start_time..' seconds') 529 | 530 | json["proxy"] = json["proxy"] or proxy 531 | 532 | -- what did we get? 533 | if json["direct"] then 534 | -- direct URL, nothing to do 535 | msg.verbose("Got direct URL") 536 | return 537 | elseif (json["_type"] == "playlist") 538 | or (json["_type"] == "multi_video") then 539 | -- a playlist 540 | 541 | if (#json.entries == 0) then 542 | msg.warn("Got empty playlist, nothing to play.") 543 | return 544 | end 545 | 546 | local self_redirecting_url = 547 | json.entries[1]["_type"] ~= "url_transparent" and 548 | json.entries[1]["webpage_url"] and 549 | json.entries[1]["webpage_url"] == json["webpage_url"] 550 | 551 | 552 | -- some funky guessing to detect multi-arc videos 553 | if self_redirecting_url and #json.entries > 1 554 | and json.entries[1].protocol == "m3u8_native" 555 | and json.entries[1].url then 556 | msg.verbose("multi-arc video detected, building EDL") 557 | 558 | local playlist = edl_track_joined(json.entries) 559 | 560 | msg.debug("EDL: " .. playlist) 561 | 562 | if not playlist then 563 | return 564 | end 565 | 566 | -- can't change the http headers for each entry, so use the 1st 567 | set_http_headers(json.entries[1].http_headers) 568 | 569 | mp.set_property("stream-open-filename", playlist) 570 | if not (json.title == nil) then 571 | mp.set_property("file-local-options/force-media-title", 572 | json.title) 573 | end 574 | 575 | -- there might not be subs for the first segment 576 | local entry_wsubs = nil 577 | for i, entry in pairs(json.entries) do 578 | if not (entry.requested_subtitles == nil) then 579 | entry_wsubs = i 580 | break 581 | end 582 | end 583 | 584 | if not (entry_wsubs == nil) and 585 | not (json.entries[entry_wsubs].duration == nil) then 586 | for j, req in pairs(json.entries[entry_wsubs].requested_subtitles) do 587 | local subfile = "edl://" 588 | for i, entry in pairs(json.entries) do 589 | if not (entry.requested_subtitles == nil) and 590 | not (entry.requested_subtitles[j] == nil) and 591 | url_is_safe(entry.requested_subtitles[j].url) then 592 | subfile = subfile..edl_escape(entry.requested_subtitles[j].url) 593 | else 594 | subfile = subfile..edl_escape("memory://WEBVTT") 595 | end 596 | subfile = subfile..",length="..entry.duration..";" 597 | end 598 | msg.debug(j.." sub EDL: "..subfile) 599 | mp.commandv("sub-add", subfile, "auto", req.ext, j) 600 | end 601 | end 602 | 603 | elseif self_redirecting_url and #json.entries == 1 then 604 | msg.verbose("Playlist with single entry detected.") 605 | add_single_video(json.entries[1]) 606 | else 607 | local playlist_index = parse_yt_playlist(url, json) 608 | local playlist = {"#EXTM3U"} 609 | for i, entry in pairs(json.entries) do 610 | local site = entry.url 611 | local title = entry.title 612 | 613 | if not (title == nil) then 614 | title = string.gsub(title, '%s+', ' ') 615 | table.insert(playlist, "#EXTINF:0," .. title) 616 | end 617 | 618 | --[[ some extractors will still return the full info for 619 | all clips in the playlist and the URL will point 620 | directly to the file in that case, which we don't 621 | want so get the webpage URL instead, which is what 622 | we want, but only if we aren't going to trigger an 623 | infinite loop 624 | --]] 625 | if entry["webpage_url"] and not self_redirecting_url then 626 | site = entry["webpage_url"] 627 | end 628 | 629 | -- links without protocol as returned by --flat-playlist 630 | if not site:find("://") then 631 | -- youtube extractor provides only IDs, 632 | -- others come prefixed with the extractor name and ":" 633 | local prefix = site:find(":") and "ytdl://" or 634 | "https://youtu.be/" 635 | table.insert(playlist, prefix .. site) 636 | elseif url_is_safe(site) then 637 | table.insert(playlist, site) 638 | end 639 | 640 | end 641 | 642 | if use_playlist and 643 | not option_was_set("playlist-start") and playlist_index then 644 | mp.set_property_number("playlist-start", playlist_index) 645 | end 646 | 647 | mp.set_property("stream-open-filename", "memory://" .. table.concat(playlist, "\n")) 648 | end 649 | 650 | else -- probably a video 651 | add_single_video(json) 652 | end 653 | msg.debug('script running time: '..os.clock()-start_time..' seconds') 654 | end 655 | 656 | if (not o.try_ytdl_first) then 657 | mp.add_hook("on_load", 10, function () 658 | msg.verbose('ytdl:// hook') 659 | local url = mp.get_property("stream-open-filename", "") 660 | if not (url:find("ytdl://") == 1) then 661 | msg.verbose('not a ytdl:// url') 662 | return 663 | end 664 | run_ytdl_hook(url) 665 | end) 666 | end 667 | 668 | mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 10, function() 669 | msg.verbose('full hook') 670 | local url = mp.get_property("stream-open-filename", "") 671 | if not (url:find("ytdl://") == 1) and 672 | not ((url:find("https?://") == 1) and not is_blacklisted(url)) then 673 | return 674 | end 675 | run_ytdl_hook(url) 676 | end) 677 | 678 | mp.add_hook("on_preloaded", 10, function () 679 | if next(chapter_list) ~= nil then 680 | msg.verbose("Setting chapters") 681 | 682 | mp.set_property_native("chapter-list", chapter_list) 683 | chapter_list = {} 684 | end 685 | end) -------------------------------------------------------------------------------- /.config/mpv/shaders/KrigBilateral.glsl: -------------------------------------------------------------------------------- 1 | // KrigBilateral by Shiandow 2 | // 3 | // This library is free software; you can redistribute it and/or 4 | // modify it under the terms of the GNU Lesser General Public 5 | // License as published by the Free Software Foundation; either 6 | // version 3.0 of the License, or (at your option) any later version. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | // Lesser General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU Lesser General Public 14 | // License along with this library. 15 | 16 | //!HOOK CHROMA 17 | //!BIND HOOKED 18 | //!BIND LUMA 19 | //!SAVE LOWRES_Y 20 | //!WIDTH LUMA.w 21 | //!WHEN CHROMA.w LUMA.w < 22 | //!DESC KrigBilateral Downscaling Y pass 1 23 | 24 | #define offset vec2(0,0) 25 | 26 | #define axis 1 27 | 28 | #define Kernel(x) dot(vec3(0.42659, -0.49656, 0.076849), cos(vec3(0, 1, 2) * acos(-1.) * (x + 1.))) 29 | 30 | vec4 hook() { 31 | // Calculate bounds 32 | float low = ceil((LUMA_pos - CHROMA_pt) * LUMA_size - offset - 0.5)[axis]; 33 | float high = floor((LUMA_pos + CHROMA_pt) * LUMA_size - offset - 0.5)[axis]; 34 | 35 | float W = 0.0; 36 | vec4 avg = vec4(0); 37 | vec2 pos = LUMA_pos; 38 | 39 | for (float k = low; k <= high; k++) { 40 | pos[axis] = LUMA_pt[axis] * (k - offset[axis] + 0.5); 41 | float rel = (pos[axis] - LUMA_pos[axis])*CHROMA_size[axis]; 42 | float w = Kernel(rel); 43 | 44 | vec4 y = textureGrad(LUMA_raw, pos, vec2(0.0), vec2(0.0)).xxxx * LUMA_mul; 45 | y.y *= y.y; 46 | avg += w * y; 47 | W += w; 48 | } 49 | avg /= W; 50 | avg.y = abs(avg.y - pow(avg.x, 2.0)); 51 | return avg; 52 | } 53 | 54 | //!HOOK CHROMA 55 | //!BIND HOOKED 56 | //!BIND LOWRES_Y 57 | //!SAVE LOWRES_Y 58 | //!WHEN CHROMA.w LUMA.w < 59 | //!DESC KrigBilateral Downscaling Y pass 2 60 | 61 | #define offset vec2(0,0) 62 | 63 | #define axis 0 64 | 65 | #define Kernel(x) dot(vec3(0.42659, -0.49656, 0.076849), cos(vec3(0, 1, 2) * acos(-1.) * (x + 1.))) 66 | 67 | vec4 hook() { 68 | // Calculate bounds 69 | float low = ceil((LOWRES_Y_pos - CHROMA_pt) * LOWRES_Y_size - offset - 0.5)[axis]; 70 | float high = floor((LOWRES_Y_pos + CHROMA_pt) * LOWRES_Y_size - offset - 0.5)[axis]; 71 | 72 | float W = 0.0; 73 | vec4 avg = vec4(0); 74 | vec2 pos = LOWRES_Y_pos; 75 | 76 | for (float k = low; k <= high; k++) { 77 | pos[axis] = LOWRES_Y_pt[axis] * (k - offset[axis] + 0.5); 78 | float rel = (pos[axis] - LOWRES_Y_pos[axis])*CHROMA_size[axis]; 79 | float w = Kernel(rel); 80 | 81 | vec4 y = textureGrad(LOWRES_Y_raw, pos, vec2(0.0), vec2(0.0)).xxxx * LOWRES_Y_mul; 82 | y.y *= y.y; 83 | avg += w * y; 84 | W += w; 85 | } 86 | avg /= W; 87 | avg.y = abs(avg.y - pow(avg.x, 2.0)) + LOWRES_Y_texOff(0).y; 88 | return avg; 89 | } 90 | 91 | //!HOOK CHROMA 92 | //!BIND HOOKED 93 | //!BIND LUMA 94 | //!BIND LOWRES_Y 95 | //!WIDTH LUMA.w 96 | //!HEIGHT LUMA.h 97 | //!WHEN CHROMA.w LUMA.w < 98 | //!OFFSET ALIGN 99 | //!DESC KrigBilateral Upscaling UV 100 | 101 | // -- Convenience -- 102 | #define sqr(x) dot(x,x) 103 | #define bitnoise 1.0/(2.0*255.0) 104 | #define noise 0.05//5.0*bitnoise 105 | #define chromaOffset vec2(0.0, 0.0) 106 | 107 | // -- Window Size -- 108 | #define taps 3 109 | #define even (float(taps) - 2.0 * floor(float(taps) / 2.0) == 0.0) 110 | #define minX int(1.0-ceil(float(taps)/2.0)) 111 | #define maxX int(floor(float(taps)/2.0)) 112 | 113 | #define Kernel(x) (cos(acos(-1.0)*(x)/float(taps))) // Hann kernel 114 | 115 | // -- Input processing -- 116 | #define GetY(coord) LOWRES_Y_tex(LOWRES_Y_pt*(pos+coord+vec2(0.5))).xy 117 | #define GetUV(coord) CHROMA_tex(CHROMA_pt*(pos+coord+vec2(0.5))).xy 118 | 119 | #define N (taps*taps - 1) 120 | 121 | #define M(i,j) Mx[min(i,j)*N + max(i,j) - min(i,j)*(min(i,j)+1)/2] 122 | 123 | #define C(i,j) (inversesqrt(1.0 + (X[i].y + X[j].y)/localVar) * exp(-0.5*(sqr(X[i].x - X[j].x)/(localVar + X[i].y + X[j].y) + sqr((coords[i] - coords[j])/radius))) + (X[i].x - y) * (X[j].x - y) / localVar) 124 | #define c(i) (inversesqrt(1.0 + X[i].y/localVar) * exp(-0.5*(sqr(X[i].x - y)/(localVar + X[i].y) + sqr((coords[i] - offset)/radius)))) 125 | 126 | vec4 hook() { 127 | vec2 pos = CHROMA_pos * HOOKED_size - chromaOffset - vec2(0.5); 128 | vec2 offset = pos - (even ? floor(pos) : round(pos)); 129 | pos -= offset; 130 | 131 | vec2 coords[N+1]; 132 | vec4 X[N+1]; 133 | float y = LUMA_texOff(0).x; 134 | vec4 total = vec4(0); 135 | 136 | coords[0] = vec2(-1,-1); coords[1] = vec2(-1, 0); coords[2] = vec2(-1, 1); 137 | coords[3] = vec2( 0,-1); coords[4] = vec2( 0, 1); coords[5] = vec2( 1,-1); 138 | coords[6] = vec2( 1, 0); coords[7] = vec2( 1, 1); coords[8] = vec2( 0, 0); 139 | 140 | for (int i=0; i 7 | //!COMPONENTS 3 8 | //!DESC TsubaDS calc L2 pass 1 9 | 10 | #define axis 1 11 | 12 | #define offset vec2(0,0) 13 | 14 | #define MN(B,C,x) (x < 1.0 ? ((2.-1.5*B-(C))*x + (-3.+2.*B+C))*x*x + (1.-(B)/3.) : (((-(B)/6.-(C))*x + (B+5.*C))*x + (-2.*B-8.*C))*x+((4./3.)*B+4.*C)) 15 | #define Kernel(x) MN(1.0/3.0, 1.0/3.0, abs(x)) 16 | #define taps 2.0 17 | 18 | vec4 hook() { 19 | vec2 base = PREKERNEL_pt * (PREKERNEL_pos * input_size + tex_offset); 20 | 21 | // Calculate bounds 22 | float low = ceil((PREKERNEL_pos - taps*POSTKERNEL_pt) * input_size - offset + tex_offset - 0.5)[axis]; 23 | float high = floor((PREKERNEL_pos + taps*POSTKERNEL_pt) * input_size - offset + tex_offset - 0.5)[axis]; 24 | 25 | float W = 0.0; 26 | vec4 avg = vec4(0); 27 | vec2 pos = base; 28 | 29 | for (float k = low; k <= high; k++) { 30 | pos[axis] = PREKERNEL_pt[axis] * (k - offset[axis] + 0.5); 31 | float rel = (pos[axis] - base[axis])*POSTKERNEL_size[axis]; 32 | float w = Kernel(rel); 33 | 34 | avg += w * pow(clamp(textureLod(PREKERNEL_raw, pos, 0.0) * PREKERNEL_mul, 0.0, 1.0), vec4(2.0)); 35 | W += w; 36 | } 37 | avg /= W; 38 | 39 | return avg; 40 | } 41 | 42 | //!HOOK POSTKERNEL 43 | //!BIND HOOKED 44 | //!BIND L2 45 | //!SAVE L2 46 | //!WHEN NATIVE_CROPPED.w POSTKERNEL.w > 47 | //!COMPONENTS 3 48 | //!DESC TsubaDS calc L2 pass 2 49 | 50 | #define axis 0 51 | 52 | #define offset vec2(0,0) 53 | 54 | #define MN(B,C,x) (x < 1.0 ? ((2.-1.5*B-(C))*x + (-3.+2.*B+C))*x*x + (1.-(B)/3.) : (((-(B)/6.-(C))*x + (B+5.*C))*x + (-2.*B-8.*C))*x+((4./3.)*B+4.*C)) 55 | #define Kernel(x) MN(1.0/3.0, 1.0/3.0, abs(x)) 56 | #define taps 2.0 57 | 58 | vec4 hook() { 59 | // Calculate bounds 60 | float low = ceil((L2_pos - taps*POSTKERNEL_pt) * L2_size - offset - 0.5)[axis]; 61 | float high = floor((L2_pos + taps*POSTKERNEL_pt) * L2_size - offset - 0.5)[axis]; 62 | 63 | float W = 0.0; 64 | vec4 avg = vec4(0); 65 | vec2 pos = L2_pos; 66 | 67 | for (float k = low; k <= high; k++) { 68 | pos[axis] = L2_pt[axis] * (k - offset[axis] + 0.5); 69 | float rel = (pos[axis] - L2_pos[axis])*POSTKERNEL_size[axis]; 70 | float w = Kernel(rel); 71 | 72 | avg += w * textureLod(L2_raw, pos, 0.0) * L2_mul; 73 | W += w; 74 | } 75 | avg /= W; 76 | 77 | return avg; 78 | } 79 | 80 | //!HOOK POSTKERNEL 81 | //!BIND HOOKED 82 | //!SAVE M 83 | //!WHEN NATIVE_CROPPED.h POSTKERNEL.h > 84 | //!COMPONENTS 3 85 | //!DESC TsubaDS calc Mean 86 | 87 | #define locality 8.0 88 | 89 | #define offset vec2(0,0) 90 | 91 | #define Kernel(x) pow(1.0 / locality, abs(x)) 92 | #define taps 3.0 93 | #define maxtaps taps 94 | 95 | vec4 ScaleH(vec2 pos) { 96 | // Calculate bounds 97 | float low = floor(-0.5*maxtaps - offset)[0]; 98 | float high = floor(+0.5*maxtaps - offset)[0]; 99 | 100 | float W = 0.0; 101 | vec4 avg = vec4(0); 102 | 103 | for (float k = 0.0; k < maxtaps; k++) { 104 | pos[0] = POSTKERNEL_pos[0] + POSTKERNEL_pt[0] * (k + low + 1.0); 105 | float rel = (k + low + 1.0) + offset[0]; 106 | float w = Kernel(rel); 107 | 108 | avg += w * clamp(POSTKERNEL_tex(pos), 0.0, 1.0); 109 | W += w; 110 | } 111 | avg /= W; 112 | 113 | return avg; 114 | } 115 | 116 | vec4 hook() { 117 | // Calculate bounds 118 | float low = floor(-0.5*maxtaps - offset)[1]; 119 | float high = floor(+0.5*maxtaps - offset)[1]; 120 | 121 | float W = 0.0; 122 | vec4 avg = vec4(0); 123 | vec2 pos = POSTKERNEL_pos; 124 | 125 | for (float k = 0.0; k < maxtaps; k++) { 126 | pos[1] = POSTKERNEL_pos[1] + POSTKERNEL_pt[1] * (k + low + 1.0); 127 | float rel = (k + low + 1.0) + offset[1]; 128 | float w = Kernel(rel); 129 | 130 | avg += w * ScaleH(pos); 131 | W += w; 132 | } 133 | avg /= W; 134 | 135 | return avg; 136 | } 137 | 138 | //!HOOK POSTKERNEL 139 | //!BIND HOOKED 140 | //!BIND L2 141 | //!BIND M 142 | //!SAVE R 143 | //!WHEN NATIVE_CROPPED.h POSTKERNEL.h > 144 | //!COMPONENTS 3 145 | //!DESC TsubaDS calc R 146 | 147 | #define locality 8.0 148 | 149 | #define offset vec2(0,0) 150 | 151 | #define Kernel(x) pow(1.0 / locality, abs(x)) 152 | #define taps 3.0 153 | #define maxtaps taps 154 | 155 | mat2x4 ScaleH(vec2 pos) { 156 | // Calculate bounds 157 | float low = floor(-0.5*maxtaps - offset)[0]; 158 | float high = floor(+0.5*maxtaps - offset)[0]; 159 | 160 | float W = 0.0; 161 | mat2x4 avg = mat2x4(0); 162 | 163 | for (float k = 0.0; k < maxtaps; k++) { 164 | pos[0] = L2_pos[0] + L2_pt[0] * (k + low + 1.0); 165 | float rel = (k + low + 1.0) + offset[0]; 166 | float w = Kernel(rel); 167 | 168 | avg += w * mat2x4(pow(clamp(POSTKERNEL_tex(pos), 0.0, 1.0), vec4(2.0)), L2_tex(pos)); 169 | W += w; 170 | } 171 | avg /= W; 172 | 173 | return avg; 174 | } 175 | 176 | vec4 hook() { 177 | // Calculate bounds 178 | float low = floor(-0.5*maxtaps - offset)[1]; 179 | float high = floor(+0.5*maxtaps - offset)[1]; 180 | 181 | float W = 0.0; 182 | mat2x4 avg = mat2x4(0); 183 | vec2 pos = L2_pos; 184 | 185 | for (float k = 0.0; k < maxtaps; k++) { 186 | pos[1] = L2_pos[1] + L2_pt[1] * (k + low + 1.0); 187 | float rel = (k + low + 1.0) + offset[1]; 188 | float w = Kernel(rel); 189 | 190 | avg += w * ScaleH(pos); 191 | W += w; 192 | } 193 | avg /= W; 194 | 195 | vec3 Sl = abs(avg[0].rgb - pow(M_texOff(0).rgb, vec3(2.0))); 196 | vec3 Sh = abs(avg[1].rgb - pow(M_texOff(0).rgb, vec3(2.0))); 197 | return vec4(mix(vec3(0.5), 1.0 / (1.0 + sqrt(Sh / Sl)), lessThan(vec3(5e-6), Sl)), 0.0); 198 | } 199 | 200 | //!HOOK POSTKERNEL 201 | //!BIND HOOKED 202 | //!BIND M 203 | //!BIND R 204 | //!WHEN NATIVE_CROPPED.h POSTKERNEL.h > 205 | //!DESC TsubaDS final pass 206 | 207 | #define locality 8.0 208 | 209 | #define offset vec2(0,0) 210 | 211 | #define Kernel(x) pow(1.0 / locality, abs(x)) 212 | #define taps 3.0 213 | #define maxtaps taps 214 | 215 | #define Gamma(x) ( pow(x, vec3(1.0/2.0)) ) 216 | #define GammaInv(x) ( pow(clamp(x, 0.0, 1.0), vec3(2.0)) ) 217 | 218 | mat3x3 ScaleH(vec2 pos) { 219 | // Calculate bounds 220 | float low = floor(-0.5*maxtaps - offset)[0]; 221 | float high = floor(+0.5*maxtaps - offset)[0]; 222 | 223 | float W = 0.0; 224 | mat3x3 avg = mat3x3(0); 225 | 226 | for (float k = 0.0; k < maxtaps; k++) { 227 | pos[0] = POSTKERNEL_pos[0] + POSTKERNEL_pt[0] * (k + low + 1.0); 228 | float rel = (k + low + 1.0) + offset[0]; 229 | float w = Kernel(rel); 230 | vec3 M = Gamma(M_tex(pos).rgb); 231 | vec3 R = R_tex(pos).rgb; 232 | R = 1.0 / R - 1.0; 233 | avg += w * mat3x3(R*M, M, R); 234 | W += w; 235 | } 236 | avg /= W; 237 | 238 | return avg; 239 | } 240 | 241 | vec4 hook() { 242 | // Calculate bounds 243 | float low = floor(-0.5*maxtaps - offset)[1]; 244 | float high = floor(+0.5*maxtaps - offset)[1]; 245 | 246 | float W = 0.0; 247 | mat3x3 avg = mat3x3(0); 248 | vec2 pos = POSTKERNEL_pos; 249 | 250 | for (float k = 0.0; k < maxtaps; k++) { 251 | pos[1] = POSTKERNEL_pos[1] + POSTKERNEL_pt[1] * (k + low + 1.0); 252 | float rel = (k + low + 1.0) + offset[1]; 253 | float w = Kernel(rel); 254 | 255 | avg += w * ScaleH(pos); 256 | W += w; 257 | } 258 | avg /= W; 259 | vec4 L = clamp(POSTKERNEL_texOff(0), 0.0, 1.0); 260 | return vec4(GammaInv(avg[1] + avg[2] * Gamma(L.rgb) - avg[0]), L.w); 261 | } -------------------------------------------------------------------------------- /.config/neofetch/config.conf: -------------------------------------------------------------------------------- 1 | # See this wiki page for more info: 2 | # https://github.com/dylanaraps/neofetch/wiki/Customizing-Info 3 | print_info() { 4 | #info title 5 | #info underline 6 | 7 | prin 8 | 9 | # info "Host" model 10 | info "$(color 6)┌OS" distro 11 | info "$(color 6)├$(color 4) Kernel" kernel 12 | info "$(color 6)├$(color 4) Uptime" uptime 13 | info "$(color 6)├$(color 4) Packages" packages 14 | 15 | #prin 16 | 17 | prin "$(color 6)├HW" "ASUS Crosshair VI Hero" 18 | info "$(color 6)├$(color 4) CPU" cpu 19 | info "$(color 6)├$(color 4) Memory" memory 20 | info "$(color 6)├$(color 4) GPU" gpu 21 | info "$(color 6)├$(color 4) Resolution" resolution 22 | 23 | #prin 24 | 25 | info "$(color 6)├DE" de 26 | info "$(color 6)├$(color 4) WM" wm 27 | info "$(color 6)├$(color 4) Theme" theme 28 | info "$(color 6)├$(color 4) Icons" icons 29 | 30 | #prin 31 | 32 | info "$(color 6)├TTY" term 33 | info "$(color 6)├$(color 4) Shell" shell 34 | prin "$(color 6)└$(color 4) Font" "Iosevka Term Extended 11" 35 | 36 | # info "Disk" disk 37 | 38 | # info "WM Theme" wm_theme 39 | # info "Theme" theme 40 | # info "Icons" icons 41 | # info "DE" de 42 | # info "WM" wm 43 | # info "CPU Usage" cpu_usage 44 | # info "Battery" battery 45 | # info "Font" font 46 | # info "Song" song 47 | # [[ $player ]] && prin "Music Player" "$player" 48 | # info "Local IP" local_ip 49 | # info "Public IP" public_ip 50 | # info "Users" users 51 | # info "Locale" locale # This only works on glibc systems. 52 | 53 | info cols 54 | } 55 | 56 | 57 | # Kernel 58 | 59 | 60 | # Shorten the output of the kernel function. 61 | # 62 | # Default: 'on' 63 | # Values: 'on', 'off' 64 | # Flag: --kernel_shorthand 65 | # Supports: Everything except *BSDs (except PacBSD and PC-BSD) 66 | # 67 | # Example: 68 | # on: '4.8.9-1-ARCH' 69 | # off: 'Linux 4.8.9-1-ARCH' 70 | kernel_shorthand="on" 71 | 72 | 73 | # Distro 74 | 75 | 76 | # Shorten the output of the distro function 77 | # 78 | # Default: 'off' 79 | # Values: 'on', 'off', 'tiny' 80 | # Flag: --distro_shorthand 81 | # Supports: Everything except Windows and Haiku 82 | distro_shorthand="off" 83 | 84 | # Show/Hide OS Architecture. 85 | # Show 'x86_64', 'x86' and etc in 'Distro:' output. 86 | # 87 | # Default: 'on' 88 | # Values: 'on', 'off' 89 | # Flag: --os_arch 90 | # 91 | # Example: 92 | # on: 'Arch Linux x86_64' 93 | # off: 'Arch Linux' 94 | os_arch="off" 95 | 96 | 97 | # Uptime 98 | 99 | 100 | # Shorten the output of the uptime function 101 | # 102 | # Default: 'on' 103 | # Values: 'on', 'off', 'tiny' 104 | # Flag: --uptime_shorthand 105 | # 106 | # Example: 107 | # on: '2 days, 10 hours, 3 mins' 108 | # off: '2 days, 10 hours, 3 minutes' 109 | # tiny: '2d 10h 3m' 110 | uptime_shorthand="on" 111 | 112 | 113 | # Memory 114 | 115 | 116 | # Show memory pecentage in output. 117 | # 118 | # Default: 'off' 119 | # Values: 'on', 'off' 120 | # Flag: --memory_percent 121 | # 122 | # Example: 123 | # on: '1801MiB / 7881MiB (22%)' 124 | # off: '1801MiB / 7881MiB' 125 | memory_percent="off" 126 | 127 | 128 | # Packages 129 | 130 | 131 | # Show/Hide Package Manager names. 132 | # 133 | # Default: 'tiny' 134 | # Values: 'on', 'tiny' 'off' 135 | # Flag: --package_managers 136 | # 137 | # Example: 138 | # on: '998 (pacman), 8 (flatpak), 4 (snap)' 139 | # tiny: '908 (pacman, flatpak, snap)' 140 | # off: '908' 141 | package_managers="on" 142 | 143 | 144 | # Shell 145 | 146 | 147 | # Show the path to $SHELL 148 | # 149 | # Default: 'off' 150 | # Values: 'on', 'off' 151 | # Flag: --shell_path 152 | # 153 | # Example: 154 | # on: '/bin/bash' 155 | # off: 'bash' 156 | shell_path="off" 157 | 158 | # Show $SHELL version 159 | # 160 | # Default: 'on' 161 | # Values: 'on', 'off' 162 | # Flag: --shell_version 163 | # 164 | # Example: 165 | # on: 'bash 4.4.5' 166 | # off: 'bash' 167 | shell_version="off" 168 | 169 | 170 | # CPU 171 | 172 | 173 | # CPU speed type 174 | # 175 | # Default: 'bios_limit' 176 | # Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. 177 | # Flag: --speed_type 178 | # Supports: Linux with 'cpufreq' 179 | # NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. 180 | speed_type="bios_limit" 181 | 182 | # CPU speed shorthand 183 | # 184 | # Default: 'off' 185 | # Values: 'on', 'off'. 186 | # Flag: --speed_shorthand 187 | # NOTE: This flag is not supported in systems with CPU speed less than 1 GHz 188 | # 189 | # Example: 190 | # on: 'i7-6500U (4) @ 3.1GHz' 191 | # off: 'i7-6500U (4) @ 3.100GHz' 192 | speed_shorthand="on" 193 | 194 | # Enable/Disable CPU brand in output. 195 | # 196 | # Default: 'on' 197 | # Values: 'on', 'off' 198 | # Flag: --cpu_brand 199 | # 200 | # Example: 201 | # on: 'Intel i7-6500U' 202 | # off: 'i7-6500U (4)' 203 | cpu_brand="on" 204 | 205 | # CPU Speed 206 | # Hide/Show CPU speed. 207 | # 208 | # Default: 'on' 209 | # Values: 'on', 'off' 210 | # Flag: --cpu_speed 211 | # 212 | # Example: 213 | # on: 'Intel i7-6500U (4) @ 3.1GHz' 214 | # off: 'Intel i7-6500U (4)' 215 | cpu_speed="on" 216 | 217 | # CPU Cores 218 | # Display CPU cores in output 219 | # 220 | # Default: 'logical' 221 | # Values: 'logical', 'physical', 'off' 222 | # Flag: --cpu_cores 223 | # Support: 'physical' doesn't work on BSD. 224 | # 225 | # Example: 226 | # logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) 227 | # physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) 228 | # off: 'Intel i7-6500U @ 3.1GHz' 229 | cpu_cores="logical" 230 | 231 | # CPU Temperature 232 | # Hide/Show CPU temperature. 233 | # Note the temperature is added to the regular CPU function. 234 | # 235 | # Default: 'off' 236 | # Values: 'C', 'F', 'off' 237 | # Flag: --cpu_temp 238 | # Supports: Linux, BSD 239 | # NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable 240 | # coretemp kernel module. This only supports newer Intel processors. 241 | # 242 | # Example: 243 | # C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' 244 | # F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' 245 | # off: 'Intel i7-6500U (4) @ 3.1GHz' 246 | cpu_temp="off" 247 | 248 | 249 | # GPU 250 | 251 | 252 | # Enable/Disable GPU Brand 253 | # 254 | # Default: 'on' 255 | # Values: 'on', 'off' 256 | # Flag: --gpu_brand 257 | # 258 | # Example: 259 | # on: 'AMD HD 7950' 260 | # off: 'HD 7950' 261 | gpu_brand="on" 262 | 263 | # Which GPU to display 264 | # 265 | # Default: 'all' 266 | # Values: 'all', 'dedicated', 'integrated' 267 | # Flag: --gpu_type 268 | # Supports: Linux 269 | # 270 | # Example: 271 | # all: 272 | # GPU1: AMD HD 7950 273 | # GPU2: Intel Integrated Graphics 274 | # 275 | # dedicated: 276 | # GPU1: AMD HD 7950 277 | # 278 | # integrated: 279 | # GPU1: Intel Integrated Graphics 280 | gpu_type="all" 281 | 282 | 283 | # Resolution 284 | 285 | 286 | # Display refresh rate next to each monitor 287 | # Default: 'off' 288 | # Values: 'on', 'off' 289 | # Flag: --refresh_rate 290 | # Supports: Doesn't work on Windows. 291 | # 292 | # Example: 293 | # on: '1920x1080 @ 60Hz' 294 | # off: '1920x1080' 295 | refresh_rate="off" 296 | 297 | 298 | # Gtk Theme / Icons / Font 299 | 300 | 301 | # Shorten output of GTK Theme / Icons / Font 302 | # 303 | # Default: 'off' 304 | # Values: 'on', 'off' 305 | # Flag: --gtk_shorthand 306 | # 307 | # Example: 308 | # on: 'Numix, Adwaita' 309 | # off: 'Numix [GTK2], Adwaita [GTK3]' 310 | gtk_shorthand="off" 311 | 312 | 313 | # Enable/Disable gtk2 Theme / Icons / Font 314 | # 315 | # Default: 'on' 316 | # Values: 'on', 'off' 317 | # Flag: --gtk2 318 | # 319 | # Example: 320 | # on: 'Numix [GTK2], Adwaita [GTK3]' 321 | # off: 'Adwaita [GTK3]' 322 | gtk2="on" 323 | 324 | # Enable/Disable gtk3 Theme / Icons / Font 325 | # 326 | # Default: 'on' 327 | # Values: 'on', 'off' 328 | # Flag: --gtk3 329 | # 330 | # Example: 331 | # on: 'Numix [GTK2], Adwaita [GTK3]' 332 | # off: 'Numix [GTK2]' 333 | gtk3="on" 334 | 335 | 336 | # IP Address 337 | 338 | 339 | # Website to ping for the public IP 340 | # 341 | # Default: 'http://ident.me' 342 | # Values: 'url' 343 | # Flag: --ip_host 344 | public_ip_host="http://ident.me" 345 | 346 | # Public IP timeout. 347 | # 348 | # Default: '2' 349 | # Values: 'int' 350 | # Flag: --ip_timeout 351 | public_ip_timeout=2 352 | 353 | 354 | # Disk 355 | 356 | 357 | # Which disks to display. 358 | # The values can be any /dev/sdXX, mount point or directory. 359 | # NOTE: By default we only show the disk info for '/'. 360 | # 361 | # Default: '/' 362 | # Values: '/', '/dev/sdXX', '/path/to/drive'. 363 | # Flag: --disk_show 364 | # 365 | # Example: 366 | # disk_show=('/' '/dev/sdb1'): 367 | # 'Disk (/): 74G / 118G (66%)' 368 | # 'Disk (/mnt/Videos): 823G / 893G (93%)' 369 | # 370 | # disk_show=('/'): 371 | # 'Disk (/): 74G / 118G (66%)' 372 | # 373 | disk_show=('/') 374 | 375 | # Disk subtitle. 376 | # What to append to the Disk subtitle. 377 | # 378 | # Default: 'mount' 379 | # Values: 'mount', 'name', 'dir' 380 | # Flag: --disk_subtitle 381 | # 382 | # Example: 383 | # name: 'Disk (/dev/sda1): 74G / 118G (66%)' 384 | # 'Disk (/dev/sdb2): 74G / 118G (66%)' 385 | # 386 | # mount: 'Disk (/): 74G / 118G (66%)' 387 | # 'Disk (/mnt/Local Disk): 74G / 118G (66%)' 388 | # 'Disk (/mnt/Videos): 74G / 118G (66%)' 389 | # 390 | # dir: 'Disk (/): 74G / 118G (66%)' 391 | # 'Disk (Local Disk): 74G / 118G (66%)' 392 | # 'Disk (Videos): 74G / 118G (66%)' 393 | disk_subtitle="dir" 394 | 395 | 396 | # Song 397 | 398 | 399 | # Manually specify a music player. 400 | # 401 | # Default: 'auto' 402 | # Values: 'auto', 'player-name' 403 | # Flag: --music_player 404 | # 405 | # Available values for 'player-name': 406 | # 407 | # amarok 408 | # audacious 409 | # banshee 410 | # bluemindo 411 | # clementine 412 | # cmus 413 | # deadbeef 414 | # deepin-music 415 | # dragon 416 | # elisa 417 | # exaile 418 | # gnome-music 419 | # gmusicbrowser 420 | # guayadeque 421 | # iTunes 422 | # juk 423 | # lollypop 424 | # mocp 425 | # mopidy 426 | # mpd 427 | # netease-cloud-music 428 | # pogo 429 | # pragha 430 | # qmmp 431 | # quodlibet 432 | # rhythmbox 433 | # sayonara 434 | # smplayer 435 | # spotify 436 | # tomahawk 437 | # vlc 438 | # xmms2d 439 | # yarock 440 | music_player="auto" 441 | 442 | # Format to display song information. 443 | # 444 | # Default: '%artist% - %album% - %title%' 445 | # Values: '%artist%', '%album%', '%title%' 446 | # Flag: --song_format 447 | # 448 | # Example: 449 | # default: 'Song: Jet - Get Born - Sgt Major' 450 | song_format="%artist% - %album% - %title%" 451 | 452 | # Print the Artist, Album and Title on separate lines 453 | # 454 | # Default: 'off' 455 | # Values: 'on', 'off' 456 | # Flag: --song_shorthand 457 | # 458 | # Example: 459 | # on: 'Artist: The Fratellis' 460 | # 'Album: Costello Music' 461 | # 'Song: Chelsea Dagger' 462 | # 463 | # off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' 464 | song_shorthand="off" 465 | 466 | # 'mpc' arguments (specify a host, password etc). 467 | # 468 | # Default: '' 469 | # Example: mpc_args=(-h HOST -P PASSWORD) 470 | mpc_args=() 471 | 472 | 473 | # Text Colors 474 | 475 | 476 | # Text Colors 477 | # 478 | # Default: 'distro' 479 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 480 | # Flag: --colors 481 | # 482 | # Each number represents a different part of the text in 483 | # this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' 484 | # 485 | # Example: 486 | # colors=(distro) - Text is colored based on Distro colors. 487 | # colors=(4 6 1 8 8 6) - Text is colored in the order above. 488 | colors=(distro) 489 | 490 | 491 | # Text Options 492 | 493 | 494 | # Toggle bold text 495 | # 496 | # Default: 'on' 497 | # Values: 'on', 'off' 498 | # Flag: --bold 499 | bold="on" 500 | 501 | # Enable/Disable Underline 502 | # 503 | # Default: 'on' 504 | # Values: 'on', 'off' 505 | # Flag: --underline 506 | underline_enabled="on" 507 | 508 | # Underline character 509 | # 510 | # Default: '-' 511 | # Values: 'string' 512 | # Flag: --underline_char 513 | underline_char="-" 514 | 515 | 516 | # Info Separator 517 | # Replace the default separator with the specified string. 518 | # 519 | # Default: ':' 520 | # Flag: --separator 521 | # 522 | # Example: 523 | # separator="->": 'Shell-> bash' 524 | # separator=" =": 'WM = dwm' 525 | separator=" " 526 | 527 | 528 | # Color Blocks 529 | 530 | 531 | # Color block range 532 | # The range of colors to print. 533 | # 534 | # Default: '0', '7' 535 | # Values: 'num' 536 | # Flag: --block_range 537 | # 538 | # Example: 539 | # 540 | # Display colors 0-7 in the blocks. (8 colors) 541 | # neofetch --block_range 0 7 542 | # 543 | # Display colors 0-15 in the blocks. (16 colors) 544 | # neofetch --block_range 0 15 545 | block_range=(0 7) 546 | 547 | # Toggle color blocks 548 | # 549 | # Default: 'on' 550 | # Values: 'on', 'off' 551 | # Flag: --color_blocks 552 | color_blocks="on" 553 | 554 | # Color block width in spaces 555 | # 556 | # Default: '3' 557 | # Values: 'num' 558 | # Flag: --block_width 559 | block_width=3 560 | 561 | # Color block height in lines 562 | # 563 | # Default: '1' 564 | # Values: 'num' 565 | # Flag: --block_height 566 | block_height=1 567 | 568 | 569 | # Progress Bars 570 | 571 | 572 | # Bar characters 573 | # 574 | # Default: '-', '=' 575 | # Values: 'string', 'string' 576 | # Flag: --bar_char 577 | # 578 | # Example: 579 | # neofetch --bar_char 'elapsed' 'total' 580 | # neofetch --bar_char '-' '=' 581 | bar_char_elapsed="-" 582 | bar_char_total="=" 583 | 584 | # Toggle Bar border 585 | # 586 | # Default: 'on' 587 | # Values: 'on', 'off' 588 | # Flag: --bar_border 589 | bar_border="on" 590 | 591 | # Progress bar length in spaces 592 | # Number of chars long to make the progress bars. 593 | # 594 | # Default: '15' 595 | # Values: 'num' 596 | # Flag: --bar_length 597 | bar_length=15 598 | 599 | # Progress bar colors 600 | # When set to distro, uses your distro's logo colors. 601 | # 602 | # Default: 'distro', 'distro' 603 | # Values: 'distro', 'num' 604 | # Flag: --bar_colors 605 | # 606 | # Example: 607 | # neofetch --bar_colors 3 4 608 | # neofetch --bar_colors distro 5 609 | bar_color_elapsed="distro" 610 | bar_color_total="distro" 611 | 612 | 613 | # Info display 614 | # Display a bar with the info. 615 | # 616 | # Default: 'off' 617 | # Values: 'bar', 'infobar', 'barinfo', 'off' 618 | # Flags: --cpu_display 619 | # --memory_display 620 | # --battery_display 621 | # --disk_display 622 | # 623 | # Example: 624 | # bar: '[---=======]' 625 | # infobar: 'info [---=======]' 626 | # barinfo: '[---=======] info' 627 | # off: 'info' 628 | cpu_display="off" 629 | memory_display="info" 630 | battery_display="bar" 631 | disk_display="bar" 632 | 633 | 634 | # Backend Settings 635 | 636 | 637 | # Image backend. 638 | # 639 | # Default: 'ascii' 640 | # Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', 641 | # 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' 642 | # Flag: --backend 643 | image_backend="ascii" 644 | 645 | # Image Source 646 | # 647 | # Which image or ascii file to display. 648 | # 649 | # Default: 'auto' 650 | # Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' 651 | # 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' 652 | # Flag: --source 653 | # 654 | # NOTE: 'auto' will pick the best image source for whatever image backend is used. 655 | # In ascii mode, distro ascii art will be used and in an image mode, your 656 | # wallpaper will be used. 657 | image_source=/home/led3f/.scripts/neofetch-new-fedora.txt 658 | 659 | 660 | # Ascii Options 661 | 662 | 663 | # Ascii distro 664 | # Which distro's ascii art to display. 665 | # 666 | # Default: 'auto' 667 | # Values: 'auto', 'distro_name' 668 | # Flag: --ascii_distro 669 | # 670 | # NOTE: Arch and Ubuntu have 'old' logo variants. 671 | # Change this to 'arch_old' or 'ubuntu_old' to use the old logos. 672 | # NOTE: Ubuntu has flavor variants. 673 | # Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME' or 'Ubuntu-Budgie' to use the flavors. 674 | # NOTE: Arch, Crux and Gentoo have a smaller logo variant. 675 | # Change this to 'arch_small', 'crux_small' or 'gentoo_small' to use the small logos. 676 | ascii_distro="auto" 677 | 678 | # Ascii Colors 679 | # 680 | # Default: 'distro' 681 | # Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' 682 | # Flag: --ascii_colors 683 | # 684 | # Example: 685 | # ascii_colors=(distro) - Ascii is colored based on Distro colors. 686 | # ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. 687 | ascii_colors=(distro) 688 | 689 | # Bold ascii logo 690 | # Whether or not to bold the ascii logo. 691 | # 692 | # Default: 'on' 693 | # Values: 'on', 'off' 694 | # Flag: --ascii_bold 695 | ascii_bold="on" 696 | 697 | 698 | # Image Options 699 | 700 | 701 | # Image loop 702 | # Setting this to on will make neofetch redraw the image constantly until 703 | # Ctrl+C is pressed. This fixes display issues in some terminal emulators. 704 | # 705 | # Default: 'off' 706 | # Values: 'on', 'off' 707 | # Flag: --loop 708 | image_loop="off" 709 | 710 | # Thumbnail directory 711 | # 712 | # Default: '~/.cache/thumbnails/neofetch' 713 | # Values: 'dir' 714 | thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" 715 | 716 | # Crop mode 717 | # 718 | # Default: 'normal' 719 | # Values: 'normal', 'fit', 'fill' 720 | # Flag: --crop_mode 721 | # 722 | # See this wiki page to learn about the fit and fill options. 723 | # https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F 724 | crop_mode="normal" 725 | 726 | # Crop offset 727 | # Note: Only affects 'normal' crop mode. 728 | # 729 | # Default: 'center' 730 | # Values: 'northwest', 'north', 'northeast', 'west', 'center' 731 | # 'east', 'southwest', 'south', 'southeast' 732 | # Flag: --crop_offset 733 | crop_offset="center" 734 | 735 | # Image size 736 | # The image is half the terminal width by default. 737 | # 738 | # Default: 'auto' 739 | # Values: 'auto', '00px', '00%', 'none' 740 | # Flags: --image_size 741 | # --size 742 | image_size="auto" 743 | 744 | # Gap between image and text 745 | # 746 | # Default: '3' 747 | # Values: 'num', '-num' 748 | # Flag: --gap 749 | gap=1 750 | 751 | # Image offsets 752 | # Only works with the w3m backend. 753 | # 754 | # Default: '0' 755 | # Values: 'px' 756 | # Flags: --xoffset 757 | # --yoffset 758 | yoffset=0 759 | xoffset=0 760 | 761 | # Image background color 762 | # Only works with the w3m backend. 763 | # 764 | # Default: '' 765 | # Values: 'color', 'blue' 766 | # Flag: --bg_color 767 | background_color= 768 | 769 | 770 | # Misc Options 771 | 772 | # Stdout mode 773 | # Turn off all colors and disables image backend (ASCII/Image). 774 | # Useful for piping into another command. 775 | # Default: 'off' 776 | # Values: 'on', 'off' 777 | stdout="off" 778 | -------------------------------------------------------------------------------- /.config/neofetch/girl: -------------------------------------------------------------------------------- 1 | ${c6} 2 | ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠤⠖⠚⢉⣩⣭⡭⠛⠓⠲⠦⣄⡀⠀⠀⠀⠀⠀⠀⠀ 3 | ⠀⠀⠀⠀⠀⠀⢀⡴⠋⠁⠀⠀⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠳⢦⡀⠀⠀⠀⠀ 4 | ⠀⠀⠀⠀⢀⡴⠃⢀⡴⢳⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣆⠀⠀⠀ 5 | ⠀⠀⠀⠀⡾⠁⣠⠋⠀⠈⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢧⠀⠀ 6 | ⠀⠀⠀⣸⠁⢰⠃⠀⠀⠀⠈⢣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣇⠀ 7 | ⠀⠀⠀⡇⠀⡾⡀⠀⠀⠀⠀⣀⣹⣆⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⠀ 8 | ⠀⠀⢸⠃⢀⣇⡈⠀⠀⠀⠀⠀⠀⢀⡑⢄⡀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇ 9 | ⠀⠀⢸⠀⢻⡟⡻⢶⡆⠀⠀⠀⠀⡼⠟⡳⢿⣦⡑⢄⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇ 10 | ⠀⠀⣸⠀⢸⠃⡇⢀⠇⠀⠀⠀⠀⠀⡼⠀⠀⠈⣿⡗⠂⠀⠀⠀⠀⠀⠀⠀⢸⠁ 11 | ⠀⠀⡏⠀⣼⠀⢳⠊⠀⠀⠀⠀⠀⠀⠱⣀⣀⠔⣸⠁⠀⠀⠀⠀⠀⠀⠀⢠⡟⠀ 12 | ⠀⠀⡇⢀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⢸⠃⠀ 13 | ⠀⢸⠃⠘⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠁⠀⠀⢀⠀⠀⠀⠀⠀⣾⠀⠀ 14 | ⠀⣸⠀⠀⠹⡄⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀⠀⠸⠀⠀⠀⠀⠀⡇⠀⠀ 15 | ⠀⡏⠀⠀⠀⠙⣆⠀⠀⠀⠀⠀⠀⠀⢀⣠⢶⡇⠀⠀⢰⡀⠀⠀⠀⠀⠀⡇⠀⠀ 16 | ⢰⠇⡄⠀⠀⠀⡿⢣⣀⣀⣀⡤⠴⡞⠉⠀⢸⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⣧⠀⠀ 17 | ⣸⠀⡇⠀⠀⠀⠀⠀⠀⠉⠀⠀⠀⢹⠀⠀⢸⠀⠀⢀⣿⠇⠀⠀⠀⠁⠀⢸⠀⠀ 18 | ⣿⠀⡇⠀⠀⠀⠀⠀⢀⡤⠤⠶⠶⠾⠤⠄⢸⠀⡀⠸⣿⣀⠀⠀⠀⠀⠀⠈⣇⠀ 19 | ⡇⠀⡇⠀⠀⡀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠸⡌⣵⡀⢳⡇⠀⠀⠀⠀⠀⠀⢹⡀ 20 | ⡇⠀⠇⠀⠀⡇⡸⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠮⢧⣀⣻⢂⠀⠀⠀⠀⠀⠀⢧ 21 | ⣇⠀⢠⠀⠀⢳⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡎⣆⠀⠀⠀⠀⠀⠘ 22 | ⢻⠀⠈⠰⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⠘⢮⣧⡀⠀⠀⠀⠀ 23 | ⠸⡆⠀⠀⠇⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠆⠀⠀⠀⠀⠀⠀⠀⠙⠳⣄⡀⢢⡀ 24 | -------------------------------------------------------------------------------- /.config/neofetch/neofetch-new-fedora.txt: -------------------------------------------------------------------------------- 1 | ${c1} .',;::::;,'. 2 | .';:cccccccccccc:;,. 3 | .;cccccccccccccccccccccc;. 4 | .:cccccccccccccccccccccccccc:. 5 | .;ccccccccccccc;${c2}.:dddl:.${c1};ccccccc;. 6 | .:ccccccccccccc;${c2}OWMKOOXMWd${c1};ccccccc:. 7 | .:ccccccccccccc;${c2}KMMc${c1};cc;${c2}xMMc${c1}:ccccccc:. 8 | ,cccccccccccccc;${c2}MMM.${c1};cc;${c2};WW:${c1}:cccccccc, 9 | :cccccccccccccc;${c2}MMM.${c1};cccccccccccccccc: 10 | :ccccccc;${c2}oxOOOo${c1};${c2}MMM0OOk.${c1};cccccccccccc: 11 | cccccc:${c2}0MMKxdd:${c1};${c2}MMMkddc.${c1};cccccccccccc; 12 | ccccc:${c2}XM0'${c1};cccc;${c2}MMM.${c1};cccccccccccccccc' 13 | ccccc;${c2}MMo${c1};ccccc;${c2}MMW.${c1};ccccccccccccccc; 14 | ccccc;${c2}0MNc.${c1}ccc${c2}.xMMd${c1}:ccccccccccccccc; 15 | cccccc;${c2}dNMWXXXWM0:${c1}:cccccccccccccc:, 16 | cccccccc;${c2}.:odl:.${c1};cccccccccccccc:,. 17 | :cccccccccccccccccccccccccccc:'. 18 | .:cccccccccccccccccccccc:;,.. 19 | '::cccccccccccccc::;,. -------------------------------------------------------------------------------- /.config/neofetch/wolf: -------------------------------------------------------------------------------- 1 | _ 2 | / \ _-' 3 | _/| \-''- _ / 4 | __-' { | \ 5 | / \ 6 | / "o. |o } 7 | | \ ; 8 | ', 9 | \_ __\ 10 | ''-_ \.// 11 | / '-____' 12 | / 13 | _' 14 | _-' 15 | -------------------------------------------------------------------------------- /.xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | userresources=$HOME/.Xresources 4 | usermodmap=$HOME/.Xmodmap 5 | sysresources=/etc/X11/xinit/.Xresources 6 | sysmodmap=/etc/X11/xinit/.Xmodmap 7 | 8 | # merge in defaults and keymaps 9 | 10 | if [ -f $sysresources ]; then 11 | xrdb -merge $sysresources 12 | fi 13 | 14 | if [ -f $sysmodmap ]; then 15 | xmodmap $sysmodmap 16 | fi 17 | 18 | if [ -f "$userresources" ]; then 19 | xrdb -merge "$userresources" 20 | fi 21 | 22 | if [ -f "$usermodmap" ]; then 23 | xmodmap "$usermodmap" 24 | fi 25 | 26 | # start some nice programs 27 | 28 | if [ -d /etc/X11/xinit/xinitrc.d ] ; then 29 | for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do 30 | [ -x "$f" ] && . "$f" 31 | done 32 | unset f 33 | fi 34 | 35 | 36 | # Xset 37 | xset s off -dpms & 38 | 39 | # Polkit 40 | /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & \ 41 | eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg) & 42 | 43 | # Xrandr 44 | xrandr --output HDMI-0 --mode 1440x900 -r 75 --pos 0x180 --rotate normal \ 45 | --output DVI-I-1 --primary --mode 1920x1080 -r 144 --pos 1440x0 --rotate normal & 46 | 47 | # Cursor 48 | xsetroot -cursor_name left_ptr 49 | 50 | # Numlock 51 | numlockx & 52 | 53 | # Window Managers 54 | exec herbstluftwm 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dots 2 | 3 | For Desktop Background image i'm using Nitrogen - https://github.com/l3ib/nitrogen 4 | 5 | Compositor is Picom - https://github.com/jonaburg/picom 6 | 7 | Spotify Cli for keyboard shorcuts - https://gist.github.com/streetturtle/fa6258f3ff7b17747ee3 8 | 9 | # herbstluftwm 10 | 11 | 12 | 13 | # herbstluftwm info 14 | 15 | Menu is Rofi - https://github.com/DaveDavenport/rofi 16 | 17 | Greenclip - https://github.com/erebe/greenclip 18 | 19 | Polybar - https://github.com/jaagr/polybar 20 | 21 | Dunst - https://github.com/dunst-project/dunst 22 | 23 | Polybar Font - Iosevka Nerd Font 24 | 25 | Colorschemes - https://github.com/deviantfero/wpgtk 26 | -------------------------------------------------------------------------------- /bin/clock: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | printf "%s" "$(date +"%a %b %d - %R"| sed 's/ / /g')" 3 | -------------------------------------------------------------------------------- /bin/cputemp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sensors | awk '/Tctl/ {sub(/^\+/, "", $2);print $2}' 3 | -------------------------------------------------------------------------------- /bin/eww: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LeD3F/dots/726f38abc469d7357b65ae5234f98202a72451e9/bin/eww -------------------------------------------------------------------------------- /bin/inhibit_activate: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | running=$(ps h -C xautolock | grep -wv $$ | wc -l); 3 | [[ $running < 1 ]] && notify-send "Inhibitor Already Active"&& exit; 4 | 5 | notify-send "Inhibitor" "Activated" 6 | pkill xautolock && xset s 0 7 | -------------------------------------------------------------------------------- /bin/inhibit_deactivate: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -z "$(pgrep xautolock)" ] 3 | then 4 | ~/bin/lock.sh & 5 | notify-send "Inhibitor" "Deactivated" 6 | else 7 | notify-send "Inhibitor Was Not Active" 8 | fi 9 | -------------------------------------------------------------------------------- /bin/lock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | xset s 500 & 3 | xautolock -time 5 -locker "betterlockscreen -l blur --display 1" -notify 30 -notifier "notify-send 'Locker' 'Locking screen in 30 seconds'" 4 | -------------------------------------------------------------------------------- /bin/mem: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | free -h | awk '/^Mem/ { print $3 }' | sed s/i//g 3 | -------------------------------------------------------------------------------- /bin/rxfetch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #colors 4 | #bold="(tput bold)" 5 | magenta="\033[1;35m" 6 | green="\033[1;32m" 7 | white="\033[1;37m" 8 | blue="\033[1;34m" 9 | red="\033[1;31m" 10 | black="\033[1;40;30m" 11 | yellow="\033[1;33m" 12 | cyan="\033[1;36m" 13 | reset="\033[0m" 14 | bgyellow="\033[1;43;33m" 15 | bgwhite="\033[1;47;37m" 16 | c0=${reset} 17 | c1=${magenta} 18 | c2=${green} 19 | c3=${white} 20 | c4=${blue} 21 | c5=${red} 22 | c6=${yellow} 23 | c7=${cyan} 24 | c8=${black} 25 | c9=${bgyellow} 26 | c10=${bgwhite} 27 | 28 | #getting the init 29 | get_init() { 30 | os=$(uname -o) 31 | if [[ $os = Android ]]; then 32 | varInit="init.rc" 33 | elif ! pidof -q systemd; then 34 | if [[ -f "/sbin/openrc" ]]; then 35 | varInit="openrc" 36 | else 37 | read -r varInit < /proc/1/comm 38 | fi 39 | else 40 | varInit="systemD" 41 | fi 42 | } 43 | 44 | #get total packages 45 | net_pkg() { 46 | pack=$(which {xbps-install,apk,apt,pacman,nix,dnf,rpm,dpkg,emerge} 2>&1 | grep -v "^which" | sed 's_.*/__') 47 | case ${pack} in 48 | "xbps-install") 49 | total=$(xbps-query -l | wc -l) 50 | ;; 51 | "apk") 52 | total=$(apk search | wc -l) 53 | ;; 54 | "apt") 55 | total=$(apt list --installed 2>/dev/null | wc -l) 56 | ;; 57 | "pacman") 58 | total=$(pacman -Q | wc -l) 59 | ;; 60 | "nix") 61 | total=$(nix-env -qa --installed "*" | wc -l) 62 | ;; 63 | "dnf") 64 | total=$(dnf list installed | wc -l) 65 | ;; 66 | "rpm") 67 | total=$(rpm -qa | wc -l) 68 | ;; 69 | "emerge") 70 | total=$(qlist -I | wc -l) 71 | ;; 72 | # "dpkg") 73 | # total=$(dpkg-query -l | wc -l) 74 | # ;; 75 | "") 76 | total="Unknown" 77 | ;; 78 | esac 79 | 80 | varPkg=$total 81 | } 82 | 83 | # check distro info for counting n.o of packages accordingly 84 | distro_detect() { 85 | os=$(uname -o) 86 | case ${os} in 87 | Android) 88 | distro="Android" 89 | if [ ! -f "${HOME}"/.termux/fonts/Material.ttf ]; then 90 | cp fonts/* "${HOME}"/.termux/fonts/ 91 | termux-reload-settings 92 | fi 93 | ;; 94 | *) 95 | distro=$(source /etc/os-release && printf '%s\n' "${PRETTY_NAME}") 96 | if [ ! -d "$HOME"/.local/share/fonts ]; then 97 | mkdir -p "$HOME"/.local/share/fonts 98 | fi 99 | if [ ! -f "$HOME"/.local/share/fonts/Material.ttf ] && [ ! -f /usr/share/fonts/Material.ttf ]; then 100 | cp ttf-material-design-icons/* $HOME/.local/share/fonts 101 | fc-cache -vf &>/dev/null 102 | fi 103 | ;; 104 | esac 105 | } 106 | 107 | storage_info() { 108 | IFS=, read storageavail storageused <<< "$(df -h / | awk '/^\//{print $2","$3}')" 109 | } 110 | 111 | # Get Memory usage 112 | get_mem() { 113 | free --mega | sed -n -E '2s/^[^0-9]*([0-9]+) *([0-9]+).*/'"${space}"'\2 \/ \1 MB/p' 114 | } 115 | 116 | # Get DE/WM 117 | # Reference: https://github.com/unixporn/robbb/blob/master/fetcher.sh 118 | get_de_wm() { 119 | wm="${XDG_CURRENT_DESKTOP#*:}" 120 | [ "$wm" ] || wm="$DESKTOP_SESSION" 121 | 122 | # for most WMs 123 | [ ! "$wm" ] && [ "$DISPLAY" ] && command -v xprop >/dev/null && { 124 | id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK) 125 | id=${id##* } 126 | wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t | grep '^_NET_WM_NAME' | cut -d\" -f 2) 127 | } 128 | 129 | # for non-EWMH WMs 130 | [ ! "$wm" ] || [ "$wm" = "LG3D" ] && 131 | wm=$(ps -e | grep -m 1 -o \ 132 | -e "sway" \ 133 | -e "kiwmi" \ 134 | -e "wayfire" \ 135 | -e "sowm" \ 136 | -e "catwm" \ 137 | -e "fvwm" \ 138 | -e "dwm" \ 139 | -e "2bwm" \ 140 | -e "monsterwm" \ 141 | -e "tinywm" \ 142 | -e "xmonad") 143 | 144 | varWm=${wm:-unknown} 145 | } 146 | get_init 147 | net_pkg 148 | get_de_wm 149 | # fetch output 150 | distro_detect 151 | storage_info 152 | echo " " 153 | echo -e " ${c1} :${c3} ${distro} $(uname -m)" 154 | echo -e " ${c2} :${c3} $(uname -r)" 155 | echo -e " ${c3}•${c8}_${c3}•${c0} ${c7} :${c3} ${varPkg}" 156 | echo -e " ${c8}${c0}${c9}oo${c0}${c8}|${c0} ${c4} :${c3} ${SHELL##*/}" 157 | echo -e " ${c8}/${c0}${c10} ${c0}${c8}'\'${c0} ${c6}﬙ :${c3} $(get_mem)" 158 | echo -e " ${c9}(${c0}${c8}\_;/${c0}${c9})${c0} ${c5} :${c3} ${varWm}" 159 | echo -e " ${c7}神:${c3}$(uptime -p | sed 's/up//')" 160 | echo -e " " 161 | echo -e " ${c6}󰮯 ${c6}${c2}󰊠 ${c2}${c4}󰊠 ${c4}${c5}󰊠 ${c5}${c7}󰊠 ${c7}" 162 | echo -e " \033[0m" 163 | -------------------------------------------------------------------------------- /bin/spotifystatus: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A dwm_bar function that shows the current artist, track, duration, and status from Spotify using playerctl 4 | # Joe Standring 5 | # GNU GPLv3 6 | 7 | # Dependencies: spotify/spotifyd, playerctl 8 | 9 | # NOTE: The official spotify client does not provide the track position or shuffle status through playerctl. This does work through spotifyd however. 10 | 11 | if ps -C spotify > /dev/null; then 12 | PLAYER="spotify" 13 | elif ps -C spotifyd > /dev/null; then 14 | PLAYER="spotifyd" 15 | fi 16 | 17 | if [ "$PLAYER" = "spotify" ] || [ "$PLAYER" = "spotifyd" ]; then 18 | ARTIST=$(playerctl metadata artist) 19 | TRACK=$(playerctl metadata title) 20 | POSITION=$(playerctl position | sed 's/..\{6\}$//') 21 | DURATION=$(playerctl metadata mpris:length | sed 's/.\{6\}$//') 22 | STATUS=$(playerctl -p spotify status) 23 | SHUFFLE=$(playerctl shuffle) 24 | 25 | if [ "$STATUS" = "Playing" ]; then 26 | STATUS="" 27 | else 28 | STATUS="" 29 | fi 30 | 31 | if [ "$SHUFFLE" = "On" ]; then 32 | SHUFFLE=" " 33 | else 34 | SHUFFLE="" 35 | fi 36 | 37 | 38 | if [ "$PLAYER" = "spotify" ]; then 39 | printf "$STATUS" 40 | else 41 | printf "%s%s %s - %s " "$SEP1" "$STATUS" "$ARTIST" "$TRACK" 42 | printf "%0d:%02d/" $((POSITION%3600/60)) $((POSITION%60)) 43 | printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60)) 44 | printf "%s%s" "$SHUFFLE" "$SEP2" 45 | fi 46 | fi 47 | -------------------------------------------------------------------------------- /bin/updates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | pkg_updates() { 3 | updates=$(checkupdates | wc -l) 4 | if [ "$updates" -eq 0 ]; then 5 | echo "Fully Updated" 6 | else 7 | echo "$updates"" updates" 8 | fi 9 | } 10 | pkg_updates 11 | -------------------------------------------------------------------------------- /bin/upt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | uptime --pretty | sed -e 's/up //g' -e 's/ days/d/g' -e 's/ day/d/g' -e 's/ hours/h/g' -e 's/ hour/h/g' -e 's/ minutes/m/g' -e 's/, / /g' 3 | -------------------------------------------------------------------------------- /bin/weather: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | curl -sf "wttr.in/Nizhniy_Novgorod?format=1" | sed -r 's/^.{4}//' | tee "$HOME/.local/share/weatherreport" || exit 1 ; #this exit will only work if tee (or before my changes, sed with output redirection) returns anything other than zero, if curl ends with an error this exit will not be called 3 | -------------------------------------------------------------------------------- /etc/X11/xorg.conf.d/00-keyboard.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "system-keyboard" 3 | MatchIsKeyboard "on" 4 | Option "XkbLayout" "us,ru" 5 | Option "XkbModel" "pc104" 6 | Option "XkbVariant" "," 7 | Option "XkbOptions" "grp:caps_toggle" 8 | EndSection 9 | -------------------------------------------------------------------------------- /etc/X11/xorg.conf.d/50-mouse-acceleration.conf: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "My Mouse" 3 | Driver "libinput" 4 | MatchIsPointer "yes" 5 | Option "AccelProfile" "flat" 6 | Option "AccelSpeed" "0" 7 | EndSection 8 | -------------------------------------------------------------------------------- /etc/environment: -------------------------------------------------------------------------------- 1 | # 2 | # This file is parsed by pam_env module 3 | # 4 | # Syntax: simple "KEY=VAL" pairs on separate lines 5 | # 6 | # 7 | 8 | __GL_SYNC_DISPLAY_DEVICE=DP-4 9 | QT_QPA_PLATFORMTHEME=qt5ct 10 | 11 | EDITOR=vim 12 | -------------------------------------------------------------------------------- /herb/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | ### Display ### 3 | monitor = DVI-I-1 4 | follow = none 5 | geometry = "350x85-10+50" 6 | indicate_hidden = yes 7 | shrink = no 8 | transparency = 0 9 | notification_height = 0 10 | separator_height = 0 11 | padding = 20 12 | horizontal_padding = 20 13 | frame_width = 2 14 | frame_color = "{color1}" 15 | separator_color = auto 16 | sort = yes 17 | idle_threshold = 120 18 | 19 | ### Text ### 20 | 21 | font = Iosevka Nerd Font 10 22 | line_height = 0 23 | markup = full 24 | format = "%s\n%b" 25 | alignment = left 26 | show_age_threshold = 60 27 | word_wrap = yes 28 | ellipsize = middle 29 | ignore_newline = no 30 | stack_duplicates = true 31 | hide_duplicate_count = false 32 | show_indicators = yes 33 | 34 | ### Icons ### 35 | 36 | icon_position = left 37 | max_icon_size = 60 38 | icon_path = /usr/share/icons/Papirus-Dark/16x16/status:/usr/share/icons/Papirus-Dark/16x16/devices 39 | 40 | ### History ### 41 | 42 | sticky_history = yes 43 | history_length = 20 44 | 45 | ### Misc/Advanced ### 46 | 47 | browser = /usr/bin/firefox -new-tab 48 | always_run_script = true 49 | title = Dunst 50 | class = Dunst 51 | startup_notification = false 52 | verbosity = mesg 53 | corner_radius = 0 54 | 55 | ### Legacy 56 | 57 | force_xinerama = false 58 | 59 | ### mouse 60 | 61 | mouse_left_click = close_current 62 | mouse_middle_click = do_action 63 | mouse_right_click = close_all 64 | 65 | [experimental] 66 | per_monitor_dpi = false 67 | 68 | [shortcuts] 69 | close = ctrl+space 70 | close_all = ctrl+shift+space 71 | history = ctrl+grave 72 | context = ctrl+shift+period 73 | 74 | [urgency_low] 75 | background = "{color0}" 76 | foreground = "{foreground}" 77 | frame_color = "{color1}" 78 | timeout = 10 79 | 80 | [urgency_normal] 81 | background = "{color0}" 82 | foreground = "{foreground}" 83 | frame_color = "{color2}" 84 | timeout = 10 85 | 86 | [urgency_critical] 87 | background = "{color0}" 88 | foreground = "{foreground}" 89 | frame_color = "{color3}" 90 | timeout = 0 91 | 92 | # vim: ft=cfg 93 | -------------------------------------------------------------------------------- /herb/herbstluftwm/autostart: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | hc() { 4 | herbstclient "$@" 5 | } 6 | 7 | hc emit_hook reload 8 | 9 | # remove all existing keybindings 10 | hc keyunbind --all 11 | 12 | # keybindings 13 | # if you have a super key you will be much happier with Mod set to Mod4 14 | Mod=Mod4 # Super Key 15 | Mod2=Mod1 # Alt Key 16 | 17 | hc keybind $Mod-Shift-q quit 18 | hc keybind $Mod-Shift-r reload 19 | hc keybind $Mod-Shift-c close 20 | hc keybind $Mod-Return spawn ${TERMINAL:-urxvtc} 21 | 22 | # basic movement 23 | # focusing clients 24 | hc keybind $Mod-Left focus left 25 | hc keybind $Mod-Down focus down 26 | hc keybind $Mod-Up focus up 27 | hc keybind $Mod-Right focus right 28 | 29 | # moving clients 30 | hc keybind $Mod-Shift-Left shift left 31 | hc keybind $Mod-Shift-Down shift down 32 | hc keybind $Mod-Shift-Up shift up 33 | hc keybind $Mod-Shift-Right shift right 34 | ## move windows through monitors 35 | hc keybind $Mod-Shift-h or / shift left / \ 36 | chain , lock , shift_to_monitor -l , focus_monitor -l , unlock 37 | hc keybind $Mod-Shift-j or / shift down / \ 38 | chain , lock , shift_to_monitor -d , focus_monitor -d , unlock 39 | hc keybind $Mod-Shift-k or / shift up / \ 40 | chain , lock , shift_to_monitor -u , focus_monitor -u , unlock 41 | hc keybind $Mod-Shift-l or / shift right / \ 42 | chain , lock , shift_to_monitor -r , focus_monitor -r , unlock 43 | 44 | # splitting frames 45 | # create an empty frame at the specified direction 46 | hc keybind $Mod-u split bottom 0.5 47 | hc keybind $Mod-o split right 0.5 48 | # let the current frame explode into subframes 49 | hc keybind $Mod-e split explode 50 | 51 | # resizing frames 52 | resizestep=0.05 53 | hc keybind $Mod-Control-Left resize left +$resizestep 54 | hc keybind $Mod-Control-Down resize down +$resizestep 55 | hc keybind $Mod-Control-Up resize up +$resizestep 56 | hc keybind $Mod-Control-Right resize right +$resizestep 57 | 58 | # tags 59 | tag_names=("null" "www" "cfg" "mul" "mus" "chat" "game") 60 | tag_keys=( {1..7} 0) 61 | 62 | hc set default_frame_layout 3 63 | hc set_layout grid 64 | 65 | hc rename default "${tag_names[0]}" || true 66 | for i in ${!tag_names[@]} ; do 67 | hc add "${tag_names[$i]}" 68 | key="${tag_keys[$i]}" 69 | if ! [ -z "$key" ] ; then 70 | hc keybind "$Mod-$key" use_index "$i" 71 | hc keybind "$Mod-Shift-$key" move_index "$i" 72 | fi 73 | done 74 | 75 | # cycle through tags 76 | hc keybind $Mod-period use_index +1 --skip-visible 77 | hc keybind $Mod-comma use_index -1 --skip-visible 78 | 79 | # layouting 80 | hc keybind $Mod-r remove 81 | hc keybind $Mod-s floating toggle 82 | hc keybind $Mod-f fullscreen toggle 83 | hc keybind $Mod-p pseudotile toggle 84 | # The following cycles through the available layouts within a frame, but skips 85 | # layouts, if the layout change wouldn't affect the actual window positions. 86 | # I.e. if there are two windows within a frame, the grid layout is skipped. 87 | hc keybind $Mod-space \ 88 | or , and . compare tags.focus.curframe_wcount = 2 \ 89 | . cycle_layout +1 vertical horizontal max vertical grid \ 90 | , cycle_layout +1 91 | 92 | # Layouts for tags 93 | hc load 5 ' 94 | (split horizontal:0.750000:0 95 | (clients grid:0 0x3800006) 96 | (clients max:0 0x3e00001)) 97 | ' 98 | 99 | # mouse 100 | hc mouseunbind --all 101 | hc mousebind $Mod-Button1 move 102 | hc mousebind $Mod-Button2 zoom 103 | hc mousebind $Mod-Button3 resize 104 | bind $Mod-Button3 resize 105 | 106 | # focus 107 | hc keybind $Mod-BackSpace cycle_monitor 108 | hc keybind $Mod-Tab cycle_all +1 109 | hc keybind $Mod-Shift-Tab cycle_all -1 110 | hc keybind $Mod-c cycle 111 | hc keybind $Mod-i jumpto urgent 112 | 113 | # Custom Hotkeys 114 | 115 | # screenshots 116 | ## fullscreen 117 | hc keybind Print spawn ~/.scripts/maim/screenshotfull.sh 118 | ## area 119 | hc keybind $Mod-a spawn ~/.scripts/maim/screenshotarea.sh 120 | ## window 121 | hc keybind $Mod2-s spawn ~/.scripts/maim/screenshotwindow.sh 122 | 123 | # rofi 124 | ## rofi desktop launcher 125 | hc keybind $Mod-d spawn ~/.scripts/rofi.sh 126 | ## rofi launcher 127 | hc keybind $Mod-Shift-d spawn ~/.scripts/rofirun.sh 128 | ## rofi window switcher 129 | hc keybind $Mod2-Tab spawn ~/.scripts/rofiwin.sh 130 | ## rofi clipboard 131 | hc keybind $Mod-x spawn ~/.scripts/roficlip.sh 132 | ## rofi power 133 | hc keybind $Mod2-e spawn ~/.scripts/powermenu.sh 134 | 135 | # lock screen 136 | hc keybind $Mod2-Ctrl-l spawn ~/.scripts/lock.sh 137 | 138 | # applications 139 | ## Firefox 140 | hc keybind $Mod-q spawn firefox 141 | ## KotatoGram 142 | hc keybind $Mod-t spawn kotatogram-desktop 143 | ## Nemo 144 | hc keybind $Mod-n spawn nemo 145 | ## Spotify 146 | hc keybind $Mod-m spawn spotify 147 | 148 | #pywal colors 149 | source ~/.cache/wal/colors.sh 150 | 151 | # theme 152 | hc attr theme.tiling.reset 1 153 | hc attr theme.floating.reset 1 154 | #hc set frame_border_active_color "$color15" 155 | #hc set frame_border_normal_color "$color1" 156 | #hc set frame_bg_normal_color "$color3" 157 | #hc set frame_bg_active_color "$color3" 158 | hc set frame_border_width 0 159 | hc set always_show_frame 0 160 | #hc set frame_bg_transparent 0 161 | hc set frame_active_opacity 1 162 | hc set frame_normal_opacity 1 163 | hc set frame_transparent_width 0 164 | hc set frame_gap 5 165 | 166 | hc attr theme.active.color "$color1" 167 | hc attr theme.normal.color "$color0" 168 | hc attr theme.urgent.color "$color15" 169 | hc attr theme.inner_width 2 170 | hc attr theme.inner_color "$color2" 171 | hc attr theme.border_width 4 172 | hc attr theme.floating.border_width 4 173 | hc attr theme.floating.outer_width 2 174 | hc attr theme.floating.outer_color "$color0" 175 | hc attr theme.active.inner_color "$color0" 176 | hc attr theme.active.outer_color "$color1" 177 | hc attr theme.background_color "$color0" 178 | 179 | hc set window_gap 5 180 | hc set frame_padding 0 181 | hc set smart_window_surroundings 0 182 | hc set smart_frame_surroundings 0 183 | hc set mouse_recenter_gap 1 184 | 185 | # rules 186 | hc unrule --all # clear rules 187 | hc rule focus=on 188 | hc rule floatplacement=center 189 | # give focus to most common terminals 190 | #hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on 191 | hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on 192 | hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on 193 | hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off 194 | hc rule class~'[Pp]olybar' manage=off 195 | hc set focus_follows_mouse 1 196 | 197 | ## apps 198 | hc rule class=Code tag=cfg 199 | hc rule class=firefox tag=www 200 | hc rule class=smplayer tag=mul 201 | hc rule class=Gimp-2.10 tag=mul 202 | hc rule class=KotatogramDesktop tag=chat 203 | hc rule class=Spotify tag=mus 204 | hc rule class=discord tag=null 205 | hc rule class=Steam tag=game 206 | hc rule class=Lutris tag=game floating=on 207 | hc rule class=qBittorrent tag=mul 208 | #floating rules 209 | hc rule class=Pavucontrol floating=on 210 | hc rule class=Baobab floating=on 211 | hc rule class=File-roller floating=on 212 | hc rule class=Nitrogen floating=on 213 | hc rule class=Galculator floating=on 214 | hc rule class=Wpg floating=on 215 | hc rule class=Pamac-manager floating=on 216 | hc rule class=Yad floating=on 217 | hc rule class=steam_proton floating=on 218 | hc rule class=qt5ct floating=on 219 | hc rule class=file_progress floating=on 220 | 221 | # unlock, just to be sure 222 | hc unlock 223 | 224 | # Monitor Setup 225 | hc set_monitors 1440x900+0+180 1920x1080+1440+0 226 | hc set swap_monitors_to_get_tag 0 227 | hc set tree_style '╾│ ├└╼─┐' 228 | 229 | # Floating tag 230 | hc floating game on 231 | 232 | # find the panel 233 | panel=~/.config/polybar/launch.sh 234 | for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do 235 | #start it on each monitor 236 | "$panel" & 237 | hc pad 0 0 238 | done 239 | 240 | #Autostart 241 | urxvtd -q -f -o & 242 | nitrogen --restore & 243 | dunst & 244 | greenclip daemon & 245 | bash $HOME/.config/wpg/wp_init.sh & 246 | picom --experimental-backend & 247 | -------------------------------------------------------------------------------- /herb/polybar/colors: -------------------------------------------------------------------------------- 1 | ;; ┌────────────────────────────────────────────────────────────┐ 2 | ;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█░░░█▀█░█▀▄░█▀▀│ 3 | ;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░░░█░█░█▀▄░▀▀█│ 4 | ;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀│ 5 | ;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│ 6 | ;; └────────────────────────────────────────────────────────────┘ 7 | 8 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 9 | 10 | [color] 11 | 12 | ;; main colors 13 | background = {background} 14 | background-alt = {color7} 15 | foreground = {background} 16 | foreground-alt = {color7} 17 | primary = {color1} 18 | red = {color3} 19 | yellow = {color2} 20 | 21 | 22 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 23 | -------------------------------------------------------------------------------- /herb/polybar/config.ini: -------------------------------------------------------------------------------- 1 | ;; ┌────────────────────────────────────────────────────────────┐ 2 | ;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀│ 3 | ;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░█░█▀▀░░█░░█░█│ 4 | ;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀│ 5 | ;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│ 6 | ;; └────────────────────────────────────────────────────────────┘ 7 | 8 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 9 | 10 | ;; Global WM Settings 11 | 12 | [global/wm] 13 | margin-bottom = 0 14 | margin-top = 0 15 | 16 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 17 | 18 | include-file = ~/.config/polybar/colors 19 | include-file = ~/.config/polybar/modules.ini 20 | include-file = ~/.config/polybar/user_modules.ini 21 | 22 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 23 | 24 | ;; Bar Settings 25 | 26 | [bar/main] 27 | monitor = DVI-I-1 28 | monitor-fallback = 29 | monitor-strict = false 30 | 31 | override-redirect = false 32 | 33 | bottom = false 34 | 35 | fixed-center = true 36 | 37 | width = 100% 38 | height = 38 39 | offset-x = 0% 40 | offset-y = 0% 41 | 42 | background = ${color.background} 43 | foreground = ${color.foreground} 44 | 45 | radius-top = 0.0 46 | radius-bottom = 0.0 47 | 48 | line-size = 6 49 | line-color = ${color.background} 50 | 51 | border-bottom-size = 2 52 | border-bottom-color = ${color.primary} 53 | 54 | padding = 0 55 | module-margin-left = 0 56 | module-margin-right = 0 57 | 58 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 59 | 60 | font-0 = "Iosevka Nerd Font:size=10;4" 61 | font-1 = "feather:size=10;3" 62 | 63 | modules-left = sep workspaces sep spotify title 64 | modules-center = date 65 | modules-right = weather sep keyboard sep cpu sep pulseaudio sep updates sep 66 | 67 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 68 | 69 | separator = 70 | 71 | dim-value = 1.0 72 | 73 | wm-name = 74 | 75 | locale = 76 | 77 | tray-position = right 78 | tray-detached = false 79 | tray-maxsize = 16 80 | tray-background = ${color.background} 81 | tray-offset-x = 0 82 | tray-offset-y = 0 83 | tray-padding = 0 84 | tray-scale = 1.0 85 | 86 | 87 | enable-ipc = true 88 | 89 | click-left = 90 | click-middle = 91 | click-right = 92 | scroll-up = 93 | scroll-down = 94 | double-click-left = 95 | double-click-middle = 96 | double-click-right = 97 | 98 | 99 | cursor-click = 100 | cursor-scroll = 101 | 102 | 103 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 104 | 105 | [settings] 106 | throttle-output = 5 107 | throttle-output-for = 10 108 | 109 | screenchange-reload = false 110 | 111 | compositing-background = source 112 | compositing-foreground = over 113 | compositing-overline = over 114 | compositing-underline = over 115 | compositing-border = over 116 | 117 | pseudo-transparency = false 118 | 119 | 120 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 121 | -------------------------------------------------------------------------------- /herb/polybar/custom/spotify_status.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import dbus 5 | import argparse 6 | 7 | parser = argparse.ArgumentParser() 8 | parser.add_argument( 9 | '-t', 10 | '--trunclen', 11 | type=int, 12 | metavar='trunclen' 13 | ) 14 | parser.add_argument( 15 | '-f', 16 | '--format', 17 | type=str, 18 | metavar='custom format', 19 | dest='custom_format' 20 | ) 21 | parser.add_argument( 22 | '-p', 23 | '--playpause', 24 | type=str, 25 | metavar='play-pause indicator', 26 | dest='play_pause' 27 | ) 28 | parser.add_argument( 29 | '--font', 30 | type=str, 31 | metavar='the index of the font to use for the main label', 32 | dest='font' 33 | ) 34 | parser.add_argument( 35 | '--playpause-font', 36 | type=str, 37 | metavar='the index of the font to use to display the playpause indicator', 38 | dest='play_pause_font' 39 | ) 40 | parser.add_argument( 41 | '-q', 42 | '--quiet', 43 | action='store_true', 44 | help="if set, don't show any output when the current song is paused", 45 | dest='quiet', 46 | ) 47 | 48 | args = parser.parse_args() 49 | 50 | 51 | def fix_string(string): 52 | # corrects encoding for the python version used 53 | if sys.version_info.major == 3: 54 | return string 55 | else: 56 | return string.encode('utf-8') 57 | 58 | 59 | def truncate(name, trunclen): 60 | if len(name) > trunclen: 61 | name = name[:trunclen] 62 | name += '...' 63 | if ('(' in name) and (')' not in name): 64 | name += ')' 65 | return name 66 | 67 | 68 | 69 | # Default parameters 70 | output = fix_string(u'{play_pause} {artist}: {song}') 71 | trunclen = 25 72 | play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused 73 | 74 | label_with_font = '%{{T{font}}}{label}%{{T-}}' 75 | font = args.font 76 | play_pause_font = args.play_pause_font 77 | 78 | quiet = args.quiet 79 | 80 | # parameters can be overwritten by args 81 | if args.trunclen is not None: 82 | trunclen = args.trunclen 83 | if args.custom_format is not None: 84 | output = args.custom_format 85 | if args.play_pause is not None: 86 | play_pause = args.play_pause 87 | 88 | try: 89 | session_bus = dbus.SessionBus() 90 | spotify_bus = session_bus.get_object( 91 | 'org.mpris.MediaPlayer2.spotify', 92 | '/org/mpris/MediaPlayer2' 93 | ) 94 | 95 | spotify_properties = dbus.Interface( 96 | spotify_bus, 97 | 'org.freedesktop.DBus.Properties' 98 | ) 99 | 100 | metadata = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata') 101 | status = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus') 102 | 103 | # Handle play/pause label 104 | 105 | play_pause = play_pause.split(',') 106 | 107 | if status == 'Playing': 108 | play_pause = play_pause[0] 109 | elif status == 'Paused': 110 | play_pause = play_pause[1] 111 | else: 112 | play_pause = str() 113 | 114 | if play_pause_font: 115 | play_pause = label_with_font.format(font=play_pause_font, label=play_pause) 116 | 117 | # Handle main label 118 | 119 | artist = fix_string(metadata['xesam:artist'][0]) if metadata['xesam:artist'] else '' 120 | song = fix_string(metadata['xesam:title']) if metadata['xesam:title'] else '' 121 | album = fix_string(metadata['xesam:album']) if metadata['xesam:album'] else '' 122 | 123 | if (quiet and status == 'Paused') or (not artist and not song and not album): 124 | print('') 125 | else: 126 | if font: 127 | artist = label_with_font.format(font=font, label=artist) 128 | song = label_with_font.format(font=font, label=song) 129 | album = label_with_font.format(font=font, label=album) 130 | 131 | # Add 4 to trunclen to account for status symbol, spaces, and other padding characters 132 | print(truncate(output.format(artist=artist, 133 | song=song, 134 | play_pause=play_pause, 135 | album=album), trunclen + 4)) 136 | 137 | except Exception as e: 138 | if isinstance(e, dbus.exceptions.DBusException): 139 | print('') 140 | else: 141 | print(e) 142 | -------------------------------------------------------------------------------- /herb/polybar/custom/weather.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import requests 3 | import os 4 | import sys 5 | 6 | 7 | def get_geo(): 8 | url = "http://ip-api.com/json" 9 | resp = requests.get(url) 10 | json = resp.json() 11 | return json["lat"], json["lon"] 12 | 13 | 14 | def get_response(app_id, location=None): 15 | url = "https://api.openweathermap.org/data/2.5/weather" 16 | params = {"appid": app_id, "units": "metric"} 17 | if location is None: 18 | lat, lon = get_geo() 19 | params.update({"lat": lat, "lon": lon}) 20 | else: 21 | params["q"] = location 22 | return requests.get(url, params=params) 23 | 24 | 25 | def get_weather_string(app_id, location=None): 26 | resp = get_response(app_id, location) 27 | data = resp.json() 28 | temperature = int(data["main"]["temp"]) 29 | if temperature > 0: 30 | temperature = f"+{temperature}" 31 | else: 32 | temperature = f"{temperature}" 33 | condition = data["weather"][0]["main"] 34 | return f"{temperature}°C, {condition}" 35 | 36 | 37 | def get_browser_url(app_id, location=None): 38 | json = get_response(app_id, location).json() 39 | id = json["id"] 40 | return f"https://openweathermap.org/city/{id}" 41 | 42 | 43 | if __name__ == "__main__": 44 | if (app_id := os.getenv("OPENWEATHER_APP_ID")) is None: 45 | print("OPENWEATHER_APP_ID is not defined") 46 | sys.exit(1) 47 | try: 48 | location = os.getenv("OPENWEATHER_LOCATION") 49 | if len(sys.argv) >= 2 and sys.argv[1] == "open": 50 | os.system(f"xdg-open {get_browser_url(app_id, location)}") 51 | else: 52 | print(get_weather_string(app_id, location)) 53 | except: 54 | pass 55 | -------------------------------------------------------------------------------- /herb/polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Add this script to your wm startup file. 4 | 5 | DIR="$HOME/.config/polybar/" 6 | 7 | # Terminate already running bar instances 8 | killall -q polybar 9 | 10 | # Wait until the processes have been shut down 11 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 12 | 13 | # Launch the bar 14 | polybar -q main -c "$DIR"/config.ini & 15 | -------------------------------------------------------------------------------- /herb/polybar/modules.ini: -------------------------------------------------------------------------------- 1 | ;; ┌────────────────────────────────────────────────────────────────┐ 2 | ;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▄█░█▀█░█▀▄░█░█░█░░░█▀▀░█▀▀│ 3 | ;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░█░█░█░█░█░█░█░█░░░█▀▀░▀▀█│ 4 | ;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀░▀░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░▀▀▀│ 5 | ;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 6 | ;; └────────────────────────────────────────────────────────────────┘ 7 | 8 | ;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 9 | 10 | [module/cpu] 11 | type = internal/cpu 12 | interval = 1 13 | 14 | format =