commit 3dab77f7794d20f402471c7c742c601fdfef3caf Author: Şahin Akkaya Date: Mon Dec 25 13:21:57 2023 +0300 Move old config to old-dots branch diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..aaacaa4 --- /dev/null +++ b/.Xresources @@ -0,0 +1,29 @@ +Xft.autohint: 0 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintslight +Xft.hinting: 1 +Xft.antialias: 1 +Xft.rgba: rgb + +# colors +*background: #2E3440 +*foreground: #D8DEE9 +*cursorColor: #D8DEE9 + +*color0: #3B4252 +*color1: #BF616A +*color2: #A3BE8C +*color3: #EBCB8B +*color4: #81A1C1 +*color5: #B48EAD +*color6: #88C0D0 +*color7: #E5E9F0 + +*color8: #4C566A +*color9: #BF616A +*color10: #A3BE8C +*color11: #EBCB8B +*color12: #81A1C1 +*color13: #B48EAD +*color14: #8FBCBB +*color15: #ECEFF4 diff --git a/.agignore b/.agignore new file mode 100644 index 0000000..486feba --- /dev/null +++ b/.agignore @@ -0,0 +1,5 @@ +*.pyc +venv +.vscode +.idea +*~ diff --git a/.config/Asocia/splash b/.config/Asocia/splash new file mode 100644 index 0000000..5cbcaae --- /dev/null +++ b/.config/Asocia/splash @@ -0,0 +1,10 @@ + + + + + +_______ _____ +___ |__Welcome back, _________(_)______ _ +__ /| |__ ___/_ __ \_ ___/__ / _ __ `/ +_ ___ |_(__ ) / /_/ // /__ _ / / /_/ / +/_/ |_|/____/ \____/ \___/ /_/ \__,_/ diff --git a/.config/betterlockscreenrc b/.config/betterlockscreenrc new file mode 100644 index 0000000..abcfafc --- /dev/null +++ b/.config/betterlockscreenrc @@ -0,0 +1,36 @@ +# ~/.config/betterlockscreenrc + +# default options +display_on=0 +span_image=false +lock_timeout=300 +fx_list=(dim blur dimblur pixel dimpixel color) +dim_level=40 +blur_level=1 +pixel_scale=10,1000 +solid_color=333333 +wallpaper_cmd="feh --bg-fill" +# i3lockcolor_bin="i3lock-color" # Manually set command for i3lock-color + +# default theme +loginbox=00000066 +loginshadow=00000000 +locktext="Type satrtapassword to unlock..." +font="sans-serif" +ringcolor=ffffffff +insidecolor=00000000 +separatorcolor=00000000 +ringvercolor=ffffffff +insidevercolor=00000000 +ringwrongcolor=ffffffff +insidewrongcolor=d23c3dff +timecolor=ffffffff +time_format="%H:%M:%S" +greetercolor=ffffffff +layoutcolor=ffffffff +keyhlcolor=d23c3dff +bshlcolor=d23c3dff +verifcolor=ffffffff +wrongcolor=d23c3dff +modifcolor=d23c3dff +bgcolor=000000ff diff --git a/.config/crontab b/.config/crontab new file mode 100644 index 0000000..712cf83 --- /dev/null +++ b/.config/crontab @@ -0,0 +1,27 @@ + +DISPLAY=:0 +XDG_RUNTIME_DIR=/run/user/1000 + + +# Example of job definition: +# .---------------- minute (0 - 59) +# | .------------- hour (0 - 23) +# | | .---------- day of month (1 - 31) +# | | | .------- month (1 - 12) OR Jan-Dec +# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR SUN-SAT +# | | | | | +# * * * * * user-name command to be executed + +# * any value +# , value list separator +# - range of values +# / step values + +* * * * * /home/sahin/scripts/check-battery.sh 6 + +# At every 15th minute past every hour from 6 through 19. +*/15 06-19 * * * curl 'https://sks.itu.edu.tr/ExternalPages/sks/yemek-menu-v2/uzerinde-calisilan/yemek-menu.aspx' 2>/dev/null | grep -oP "js-nyro-modal.*?>\K(.+?)(?=<[is].*>)" > /home/sahin/.cronresults/todaysmenu + +* * * * * cat /var/spool/cron/sahin > /home/sahin/.config/crontab + +* * * * * /home/sahin/GitRepositories/binary-wallpaper/set_binary_wallpaper.sh diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc new file mode 100644 index 0000000..c56a53f --- /dev/null +++ b/.config/dunst/dunstrc @@ -0,0 +1,209 @@ + +[global] + + # --- Display --- # + + # The monitor to be displayed to + monitor = 0 + + # Follow monitor with mouse + follow = mouse + + # The geometry of the window + # widthxheight +/-x+/-y + geometry = "270x6-24+68" + + # geometry = "280x50-10+48" + + # Show how many messages are hidden + indicate_hidden = yes + + # Shrink window if it's smaller than the width. + shrink = no + + # The transparency of the window. + transparency = 1 + + # Set height to padding + font size + notification_height = 0 + + # Draw a line between multiple notifications + separator_height = 3 + separator_color = "#auto" + + # Set notification padding + padding = 16 + horizontal_padding = 16 + + # Disable frame (border) + frame_width = 3 + + # Sort messages by urgency. + sort = no + + # Disable idle time + idle_threshold = 0 + + + # --- Text --- # + + # Set the font + # font = "Noto Sans 11" + # font = "Hack Nerd Font 9.5" + font = JetBrains Mono 10 + + # Set line height to font height + line_height = 4 + + # Reference for markup and formatting: + # bold + # italic + # strikethrough + # underline + # . + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + + markup = full + format = "%s\n%b" + + # Left align the text + alignment = left + + # Vertical alignment of message text and icon. + vertical_alignment = center + + # Show age of message if message is old + show_age_threshold = 120 + + # Wrap text if it doesn't fit in geometry + word_wrap = yes + + # Where to place ellipses if word wrap is disabled + # ellipsize = middle + + # Use newlines '\n' in notifications. + ignore_newline = no + + # Don't stack together notifications + stack_duplicates = false + + # Hide the count of stacked notifications + # hide_duplicate_count = false + + # Display indicators for URLs (U) and actions (A). + show_indicators = yes + + + # ---- Icons ---- # + + # Align icons left/right/off + icon_position = left + + # Scale small icons up to this size, set to 0 to disable. + min_icon_size = 0 + + # Scale larger icons down to this size, set to 0 to disable + max_icon_size = 40 + + # Paths to default icons. + icon_path = /usr/share/icons/ePapirus/128x128/apps:/usr/share/icons/ePapirus/128x128/devices:/usr/share/icons/ePapirus/128x128/mimetypes:/usr/share/icons/ePapirus/128x128/places:/usr/share/icons/Papirus/48x48/actions:/usr/share/icons/Papirus/48x48/apps:/usr/share/icons/Papirus/48x48/devices:/usr/share/icons/Papirus/48x48:emblems:/usr/share/icons/Papirus/48x48/emotes:/usr/share/icons/Papirus/48x48/mimetypes:/usr/share/icons/Papirus/48x48/places:/usr/share/icons/Papirus/48x48/status:/usr/share/icons/Papirus/16x16/actions:/usr/share/icons/Papirus/16x16/apps:/usr/share/icons/Papirus/16x16/devices:/usr/share/icons/Papirus/16x16/emblems:/usr/share/icons/Papirus/16x16/emotes:/usr/share/icons/Papirus/16x16/mimetypes:/usr/share/icons/Papirus/16x16/panel:/usr/share/icons/Papirus/16x16/places:/usr/share/icons/Papirus/16x16/status + + + # --- History --- # + + # Avoid timing out hidden notifications + sticky_history = yes + + # Maximum amount of notifications kept in history + history_length = 100 + + + # --- Misc/Advanced --- # + + dmenu = /usr/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/firefox -new-tab + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = false + + # Define the title of the windows spawned by dunst + title = Dunst + + # Define the class of the windows spawned by dunst + class = Dunst + + # Avoid printing a notification on startup + startup_notification = false + + # Manage dunst's desire for talking + verbosity = mesg + + # Define the corner radius of the notification window + corner_radius = 0 + + # Don't gnore the dbus closeNotification message. + ignore_dbusclose = false + + + # --- Legacy --- # + + # Use the Xinerama extension instead of RandR for multi-monitor support. + force_xinerama = false + + + # --- Mouse --- # + mouse_middle_click = close_current + mouse_left_click = do_action, close_current + mouse_right_click = close_all + + + # --- Shortcuts --- # + # Close notification. + close = ctrl+space + + # Close all notifications. + close_all = ctrl+shift+space + + # Redisplay last message(s). + history = ctrl+grave + + # Context menu. + context = ctrl+shift+period + + +[experimental] + per_monitor_dpi = false + + +# --- Colors --- # + +[urgency_low] + # background = "#6BC6DE" + # foreground = "#d1e2e8" + + background = "#282C33" + foreground = "#D8D8D8" + timeout = 8 + +[urgency_normal] + # background = "#6BC6DE" + # foreground = "#d1e2e8" + background = "#282C33" + foreground = "#D8D8D8" + timeout = 8 + +[urgency_critical] + background = "#dd130ddd" + foreground = "#ffffff" + frame_color = "#30343B" + timeout = 0 + icon = abrt diff --git a/.config/eww/bar/eww.scss b/.config/eww/bar/eww.scss new file mode 100644 index 0000000..b12ef5f --- /dev/null +++ b/.config/eww/bar/eww.scss @@ -0,0 +1,531 @@ +/** EWW.SCSS +Created by saimoom **/ +*{ + all: unset; + font-family: "Iosevka Nerd Font", feather; + // font-family: DaddyTimeMono NF; +} + +// Variable Color's +$background: #1A1B26; +$foreground: #A9B1D6; + +$black: #24283B; +$gray: #565F89; +$red: #F7768E; +$green: #73DACA; +$yellow: #E0AF68; +$blue: #7AA2F7; +$magenta: #BB9AF7; +$cyan: #7DCFFF; +$white: $foreground; +/** General **/ +.bar_class { + background-color: #0f0f17; + border-radius: 16px; +} +.module { + margin: 0px 0px 0px 0px; + border-radius: 10px 16px 0px 10px; +} + +/** tooltip!! **/ +tooltip.background { + background-color: #0f0f17; + font-size: 18; + border-radius: 10px; + color: #bfc9db; +} + +tooltip label { + margin: 6px; +} + + +/** Widgets **/ + +.clock_time_sep { + font-size: 27; + color: #bfc9db; + margin: 0px 4px 1px 4px; +} +.clock_time_class, .clock_minute_class { + font-size: 23; +} +.clock_date_class { + font-size: 18; + margin: 0px 20px 0px -1px; + color: #d7beda; +} +.clock_minute_class { + margin: 0px 20px 0px 3px; + color: #bfc9db; +} + +.clock_time_class { + color: #bfc9db; + font-weight: bold; + margin: 0px 5px 0px 0px; +} + +.diskbar { + color: #AD5C6C; + background-color: #38384d; + border-radius: 10px; +} +.cpubar { + color: #297379; + background-color: #38384d; + border-radius: 10px; +} + +.membar { + color: #e0b089; + background-color: #38384d; + border-radius: 10px; +} + + +.bat{ + // font-family: JetBrainsMono Nerd Font; + font-family: Iosevka Nerd Font; + font-size: 1.2em; + padding-right: .5rem; + color: $blue; +} +.brightbar trough highlight { + background-image: linear-gradient(to right, #e4c9af 30%, #f2cdcd 50%, #e0b089 100% *50); + border-radius: 10px; +} +.volbar trough highlight { + background-image: linear-gradient(to right, #afcee0 30%, #a1bdce 50%, #77a5bf 100% *50); + border-radius: 10px; +} +.volume_icon { + font-size: 22; + color: #a1bdce; + margin: 0px 10px 0px 10px; +} + +.module_essid { + font-size: 18; + color: #a1bdce; + margin: 0px 10px 0px 0px; +} +.module_vpn { + font-size: 18; + color: #77DD77; + margin: 0px 10px 0px 0px; +} +.module-wif { + font-size: 22; + color: #a1bdce; + border-radius: 100%; + margin: 0px 10px 0px 5px; +} +.iconcpu { + color: #297379; +} + + +.icondisk { + color: #AD5C6C; +} + +.iconmem { + color: #e0b089; +} +.iconbat { + color: #afbea2; +} +.iconbat, .iconmem, .iconcpu, .icondisk { + font-size: 15; + margin: 10px; +} +.bright_icon { + font-size: 22; + color: #e4c9af; + margin: 0px 10px 0px 10px; +} + + +.separ { + color: #3e424f; + font-weight: bold; + font-size: 22px; + margin: 0px 8px 0px 8px; +} + +.mem_module, .cpu_module, .disk_module{ + background-color: #0f0f17; + border-radius: 16px; + margin: 0px 10px 0px 3px; +} +scale trough { + all: unset; + background-color: #22242b; + box-shadow: 0 2px 3px 2px #06060b; + border-radius: 16px; + min-height: 10px; + min-width: 70px; + margin: 0px 10px 0px 0px; +} + +.works { + font-size: 27px; + // font-size: 45px; + font-weight: normal; + font-family: Iosevka Nerd Font; + margin: 5px 0px 0px 20px; + background-color: #0f0f17; +} + +.0 , .01, .02, .03, .04, .05, .06, .07, .08, .09, .00, +.011, .022, .033, .044, .055, .066, .077, .088, .099, .000 { + margin: 5px 10px 0px 0px; +} + +/* Unoccupied */ +.0 { + color:#131d2c; +} + +/* Occupied */ +.01, .02, .03, .04, .05, .06, .07, .08, .09, .00 { + color: #5c6c82; +} + +/* Focused */ +.011, .022, .033, .044, .055, .066, .077, .088, .099, .000 { + color: #e4e6ea +} + +.033.thunderbird { + color: #1E5EBB; +} + +.066.twitter { + color: #1C9CEA; +} + +.firefox.077 { + color: #DF5D00; +} + + +.twitch.088 { + color: #613F9F; +} + +.discord.099 { + color:#5661EF; +} + + +.telegram.000 { + color: #0084C6; +} + +.song_cover_art { + background-size: cover; + background-position: center; + min-height: 24px; + min-width: 24px; + margin: 10px; + border-radius: 100px; +} + +.song { + color: #a1bdce; + font-size : 18px; + font-weight : bold; + margin : 3px 5px 0px 0px; +} + +.song_btn_play { + color: #a1bdce; + font-size : 28px; + margin : 3px 0px 0px 5px; + +} + + +.song_btn_prev, .song_btn_next { + color: #bfc9db; + font-size : 24px; + margin : 3px 0px 0px 5px; + +} +// Calendar +.cal { + background-color: #0f0f17; + font-family: "JetBrainsMono Nerd Font"; + font-size: 18px; + font-weight: normal; + + .cal-in { + padding: 0px 10px 0px 10px; + color: #bfc9db; + + .cal { + &.highlight { + padding: 20px; + } + + padding: 5px 5px 5px 5px; + margin-left: 10px; + } + } +} + + + +calendar:selected { + color: $blue; + font-size: 24px; + background: $background; +} + +calendar.header { + color: $blue; + font-weight: bold; +} + +calendar.button { + color: $magenta; +} + +calendar.highlight { + color: $magenta; + font-weight: bold; +} + +calendar:indeterminate { + color: $background; +} + + + + + + + +.sys_sep { + color: #38384d; + font-size: 18; + margin: 0px 10px 0px 10px; +} +.sys_text_bat_sub, .sys_text_mem_sub { + font-size: 16; + color: #bbc5d7; + margin: 5px 0px 0px 25px; +} +.sys_text_bat, .sys_text_mem { + font-size: 21; + font-weight: bold; + margin: 14px 0px 0px 25px; +} +.sys_icon_bat, .sys_icon_mem { + font-size: 30; + margin: 30px; +} +.sys_win { + background-color: #0f0f17; +} +.sys_bat { + color: #afbea2; + background-color: #38384d; + border-radius: 10px; +} +.sys_mem { + color: #e4c9af; + background-color: #38384d; + border-radius: 10px; +} +.sys_icon_bat, .sys_text_bat { + color: #afbea2; +} +.sys_icon_mem, .sys_text_mem { + color: #e4c9af; +} +.sys_bat_box { + border-radius: 16px; + margin: 15px 10px 10px 20px; +} +.sys_mem_box { + border-radius: 16px; + margin: 10px 10px 15px 20px; +} + +.music_pop { + background-color: #0f0f17; + border-radius: 16px; +} +.music_cover_art { + background-size: cover; + background-position: center; + min-height: 100px; + box-shadow: 5px 5px 5px 5px #06060b; + min-width: 170px; + margin: 20px; + border-radius: 20px; +} + +.music { + color: #a1bdce; + font-size : 20px; + font-weight : bold; + margin : 20px 0px 0px -15px; +} + +.music_artist { + color: #bbc5d7; + font-size : 16px; + font-weight : normal; + margin : 0px 0px 0px 0px; +} + +.music_btn_prev, .music_btn_play, .music_btn_next { + font-family: Iosevka Nerd Font; +} +.music_btn_prev { + color: #bbc5d7; + font-size : 32px; + font-weight : normal; + margin: 0px 0px 0px 0px; +} +.music_btn_play { + color: #a1bdce; + font-size : 48px; + font-weight : normal; + margin: 0px 0px 0px 0px; +} +.music_btn_next { + color: #bbc5d7; + font-size : 32px; + font-weight : normal; + margin: 0px 0px 0px 0px; +} + +.music_bar scale trough highlight { + all: unset; + background-image: linear-gradient(to right, #afcee0 30%, #a1bdce 50%, #77a5bf 100% *50); + border-radius: 24px; +} +.music_bar scale trough { + all: unset; + background-color: #232232; + box-shadow: 0 6px 5px 2px #06060b; + border-radius: 24px; + min-height: 13px; + min-width: 190px; + margin : -10px 10px 20px 0px; +} + +.audio-box { + background-color: #0f0f17; + border-radius: 16px; +} +.speaker_icon { + background-size: cover; + background-image: url('images/speaker.png'); + background-position: center; + min-height: 70px; + min-width: 75px; + margin: 10px 20px 5px 20px; + border-radius: 12px; +} + +.speaker_text { + color: #a1bdce; + font-size : 26px; + font-weight : bold; + margin: 20px 0px 0px 0px; +} + +.speaker_bar scale trough highlight { + all: unset; + background-image: linear-gradient(to right, #afcee0 30%, #a1bdce 50%, #77a5bf 100% *50); + border-radius: 24px; +} +.speaker_bar scale trough { + all: unset; + background-color: #232232; + box-shadow: 0 6px 5px 2px #06060b; + border-radius: 24px; + min-height: 13px; + min-width: 120px; + margin : 0px 0px 5px 0px; +} + +.mic_icon { + background-size: cover; + background-image: url('images/mic.png'); + background-position: center; + min-height: 70px; + min-width: 75px; + margin: 5px 20px 20px 20px; + border-radius: 12px; +} + +.mic_text { + color: #a1bdce; + font-size : 26px; + font-weight : bold; + margin: 0px 0px 0px 0px; +} + +.mic_bar scale trough highlight { + all: unset; + background-image: linear-gradient(to right, #afcee0 30%, #a1bdce 50%, #77a5bf 100% *50); + border-radius: 24px; +} +.mic_bar scale trough { + all: unset; + box-shadow: 0 6px 5px 2px #06060b; + background-color: #232232; + border-radius: 24px; + min-height: 13px; + min-width: 120px; + margin : 0px 0px 20px 0px; +} + +.audio_sep { + color: #38384d; + font-size: 18; + margin : 0px 0px 0px 0px; +} + + +// Powermenu +.powermenu { + font-family: feather; + font-size: 1.3em; + font-weight: bold; +} +.button-qtres, .button-reb, .button-lock, +.button-quit, .button-off{ + padding: .5rem .2rem .5rem .2rem; + // transition: all .2s ease-in-out; +} +.button-off{ + color: $red; + margin-right: 15px; +} +.button-qtres:hover, .button-reb:hover, .button-lock:hover, +.button-quit:hover, .button-off:hover{ + font-size: 1.2em; + box-shadow: inset 0 0 0 10em $background; +} +.button-bspres{ + color: $green; +} +.button-reb{ + color: $yellow +} +.button-quit{ + color: $magenta; +} +.button-lock{ + color: $blue; +} diff --git a/.config/eww/bar/eww.yuck b/.config/eww/bar/eww.yuck new file mode 100644 index 0000000..f85085d --- /dev/null +++ b/.config/eww/bar/eww.yuck @@ -0,0 +1,463 @@ +;; Variables +(defpoll clock_time :interval "5s" "date +\%H") +(defpoll clock_minute :interval "5s" "date +\%M") +(defpoll clock_date :interval "5s" "date '+%d/%m'") +(defpoll volume_percent :interval "3s" :run-while vol_reveal "amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") +(defpoll mic_percent :interval "3s" :run-while vol_reveal "amixer -D pulse sget Capture | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%'") +(defpoll brightness_percent :interval "5s" :run-while br_reveal "brightnessctl -m -d intel_backlight | awk -F, '{print substr($4, 0, length($4)-1)}' | tr -d '%'") +(defpoll caps_num_scroll_indicator :interval "300ms" "scripts/indicator") +(defvar vol_reveal false) +(defvar bat_rev false) +(defvar cpu_rev false) +(defvar mem_rev false) +(defvar disk_rev false) +(defvar br_reveal false) +(defvar vpn_reveal false) +(defvar bluetooth_rev false) +(defvar music_reveal false) +(defvar wifi_rev false) +(defvar time_rev false) +(defvar power_rev false) +(deflisten workspace "scripts/workspace") + +(deflisten CURRENT_LAYOUT_SYMBOL "scripts/layout") + +(defvar eww "$HOME/scripts/eww -c $HOME/.config/eww/bar") + + +(defpoll COL_WLAN :interval "1m" "~/.config/eww/bar/scripts/wifi --COL") +(defpoll ESSID_WLAN :interval "1m" "~/.config/eww/bar/scripts/wifi --ESSID") +(defpoll VPN_NAME :interval "1s" "rofi-wireguard") +(defpoll BLUETOOTHDEV :interval "1s" "rofi-bluetooth --status") +(defpoll WLAN_ICON :interval "1m" "~/.config/eww/bar/scripts/wifi --ICON") + + +(defpoll song :interval "2s" "~/.config/eww/bar/scripts/music_info --song") +(defpoll song_artist :interval "2s" "~/.config/eww/bar/scripts/music_info --artist") +(defpoll current_status :interval "1s" "~/.config/eww/bar/scripts/music_info --time") +(defpoll song_status :interval "2s" "~/.config/eww/bar/scripts/music_info --status") +(defpoll cover_art :interval "2s" "~/.config/eww/bar/scripts/music_info --cover") + + +;; widgets + +(defwidget wifi [] + (eventbox :onhover "${eww} update wifi_rev=true" + :onhoverlost "${eww} update wifi_rev=false" + (box :vexpand "false" :hexpand "false" :space-evenly "false" + (button :class "module-wif" :onclick "networkmanager_dmenu" :wrap "false" :limit-width 12 :style "color: ${COL_WLAN};" WLAN_ICON) + (revealer :transition "slideleft" + :reveal wifi_rev + :duration "350ms" + (label :class "module_essid" + :text ESSID_WLAN + ))))) + + +(defwidget workspaces [] + (literal :content workspace)) + +(defwidget sep [] + (box :class "module-2" :vexpand "false" :hexpand "false" + (label :class "separ" :text "|"))) + +(defwidget clock_module [] + (eventbox :onhover "${eww} update time_rev=true" + :onhoverlost "${eww} update time_rev=false" + (box :class "module" :space-evenly "false" :orientation "h" :spacing "3" + (label :text clock_time :class "clock_time_class" ) + (label :text ":" :class "clock_time_sep" ) + (label :text clock_minute :class "clock_minute_class") + (revealer :transition "slideleft" + :reveal time_rev + :duration "350ms" + (button :class "clock_date_class" + :onclick "$HOME/.config/eww/bar/scripts/pop calendar" clock_date + ) + )))) + +(defwidget volume [] + (eventbox :onhover "${eww} update vol_reveal=true" + :onhoverlost "${eww} update vol_reveal=false" + (box :class "module-2" :space-evenly "false" :orientation "h" :spacing "3" + (button :onclick "scripts/pop audio" :class "volume_icon" "${BLUETOOTHDEV=="" ? "": ""}") + (revealer :transition "slideleft" + :reveal vol_reveal + :duration "350ms" + (scale :class "volbar" + :value volume_percent + :orientation "h" + :tooltip "${volume_percent}%" + :max 100 + :min 0 + :onchange "amixer -D pulse sset Master {}%" ))))) + +(defwidget bright [] + (eventbox :onhover "${eww} update br_reveal=true" :onhoverlost "${eww} update br_reveal=false" + (box :class "module-2" :space-evenly "false" :orientation "h" :spacing "3" + (label :text "" :class "bright_icon" :tooltip "brightness") + (revealer :transition "slideleft" + :reveal br_reveal + :duration "350ms" + (scale :class "brightbar" + :value brightness_percent + :orientation "h" + :tooltip "${brightness_percent}%" + :max 100 + :min 0 + :onchange "brightnessctl set {}%" ))))) + +;; Battery Widgets ;; +(defwidget bat [] + (eventbox :onhover "${eww} update bat_rev=true" + :onhoverlost "${eww} update bat_rev=false" + (box :space-evenly "false" + (label :class "bat" + :text battery + :tooltip "Battery: ${EWW_BATTERY["BAT0"].capacity}%") + + (revealer :transition "slideleft" + :reveal bat_rev + :duration "350ms" + :class "bat" + (label :text "${battery==""? "Charging": "Battery"}: ${EWW_BATTERY["BAT0"].capacity}%")) + ))) +(defpoll battery :interval "1s" "scripts/battery icon") + +(defwidget metric [widget widget_rev value tooltip_text] + (eventbox + :onhover "${eww} update ${widget}_rev=true" + :onhoverlost "${eww} update ${widget}_rev=false" + (box :class "${widget}_module" :vexpand "false" :hexpand "false" + (circular-progress + :value value + :class "${widget}bar" + :thickness 4 + (button + :class "icon${widget}" + :limit-width 9 + :tooltip tooltip_text + :onclick "$HOME/.config/eww/bar/scripts/pop system" + :show_truncated false + :wrap false + (revealer + :transition "slideleft" + :reveal widget_rev + :duration "350ms" + :class "icon${widget}" + (label + :text value + :tooltip "${tooltip_text}: ${value}%" + ) + ) + ) + ) + ) + ) + ) + +(defwidget metrics [] + (box :orientation "h" + :space-evenly false + (metric :widget "disk" :widget_rev disk_rev :value "${round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}" :tooltip_text "Disk usage") + (metric :widget "cpu" :widget_rev cpu_rev :value "${round(EWW_CPU.avg, 0)}" :tooltip_text "CPU usage") + (metric :widget "mem" :widget_rev mem_rev :value "${round(EWW_RAM.used_mem_perc, 0)}" :tooltip_text "RAM usage") + )) + + +(defwidget keyboard [] + (box :class "volume_icon" + :orientation "v" + (label :text caps_num_scroll_indicator + :style "font-size: 7;" + :valign "end" + ) + (label :text CURRENT_LAYOUT_SYMBOL + :valign "start" + :vexpand false + ) + + )) + + +(defwidget vpn [] + (eventbox :onhover "${eww} update vpn_reveal=true" + :onhoverlost "${eww} update vpn_reveal=false" + (box :vexpand "false" :hexpand "false" :space-evenly "false" + (button :class "module-wif" :timeout "10s" :onclick "rofi-wireguard --toggle" :wrap "false" + :limit-width 12 :style "color: ${VPN_NAME=="" ? "#3e424f": "#77DD77"};" "") + (revealer :transition "slideright" + :reveal vpn_reveal + :duration "350ms" + (button :class "module-wif" :timeout "10s" :onclick "rofi-wireguard --toggle" :wrap "false" + :limit-width 12 :style "color: ${VPN_NAME=="" ? "#3e424f": "#77DD77"};" VPN_NAME) + )))) + +(defwidget bluetooth [] + (eventbox :onhover "${eww} update bluetooth_rev=true" + :onhoverlost "${eww} update bluetooth_rev=false" + (box :vexpand "false" :hexpand "false" :space-evenly "false" + (button :class "module-wif" :timeout "30s" :onclick "rofi-bluetooth" :wrap "false" :limit-width 12 + :style "color: ${BLUETOOTHDEV=="" ? "#3e424f": "#77DD77"};" {BLUETOOTHDEV=="" ? "" : ""}) + (revealer :transition "slideright" + :reveal bluetooth_rev + :duration "350ms" + (button :class "module-wif" :timeout "30s" :onclick "rofi-bluetooth" :wrap "false" :limit-width 12 + :style "color: ${BLUETOOTHDEV=="" ? "#3e424f": "#77DD77"};" BLUETOOTHDEV) + )))) + +(defwidget power [] + (eventbox :onhover "${eww} update power_rev=true" + :onhoverlost "${eww} update power_rev=false" + (box :orientation "h" + :space-evenly "false" + :vexpand "false" + :class "powermenu" + (revealer :transition "slideleft" + :reveal power_rev + :duration "550ms" + (box :orientation "h" + :space-evenly "false" + + (button :class "button-qtres" + :tooltip "Restart qtile" + :onclick "scripts/qtile restart" "" ) + + (button :class "button-reb" + :tooltip "Reboot" + :onclick "reboot" "") + + (button :class "button-quit" + :tooltip "Logout" + :onclick "scripts/qtile shutdown" "") + + (button :class "button-lock" + :tooltip "Lock Screen" + :onclick "lock-screen" ""))) + + (button :class "button-off" + :tooltip "Shutdown" + :onclick "shutdown now" "")))) + + +;; Music +(defwidget music [] + (eventbox :onhover "${eww} update music_reveal=true" + :onhoverlost "${eww} update music_reveal=false" + (box :class "module-2" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" + (box :class "song_cover_art" :vexpand "false" :hexpand "false" :style "background-image: url('${cover_art}');") + (button :class "song" :onclick "~/.config/eww/bar/scripts/pop music" song) + (revealer :transition "slideright" + :reveal music_reveal + :duration "350ms" + (box :vexpand "false" :hexpand "false" :orientation "h" + (button :class "song_btn_prev" :onclick "~/.config/eww/bar/scripts/music_info --prev" "") + (button :class "song_btn_play" :onclick "~/.config/eww/bar/scripts/music_info --toggle" song_status) + (button :class "song_btn_next" :onclick "~/.config/eww/bar/scripts/music_info --next" "")))))) + + +(defwidget left [] + (box :orientation "h" + :space-evenly false + :halign "end" + :class "left_modules" + (keyboard) + (vpn) + (bluetooth) + (bright) + (volume) + (wifi) + (sep) + (metrics) + (bat) + (sep) + (clock_module) + (power))) + + +(defwidget right [] + (box :orientation "h" + :space-evenly false + :halign "start" + :class "right_modules" + (workspaces))) + + +(defwidget center [] + (box :orientation "h" + :space-evenly false + :halign "center" + :class "center_modules" + (music))) + + +(defwidget topbar [] + (centerbox +:orientation "h" + :class "bar_class" + (right) + (center) + (left) + ) + ) + +(defwindow bar + :monitor 0 + :geometry (geometry :x "0%" + :y "4px" + :width "99%" + :height "50px" + :anchor "top center") + :stacking "fg" + :reserve (struts :distance "58px" :side "top") + :windowtype "dock" + :wm-ignore false + (topbar)) + +(defwidget system [] + (box :class "sys_win" :orientation "v" :space-evenly "false" :hexpand "false" :vexpand "false" :spacing 0 + (box :class "sys_bat_box" :orientation "h" :space-evenly "false" + (circular-progress :value "${EWW_BATTERY["BAT0"].capacity}" + :class "sys_bat" + :thickness 9 + (label :text "" + :class "sys_icon_bat" + :limit-width 2 + :show_truncated false + :wrap false)) + (box :orientation "v" :space-evenly "false" :spacing 0 :hexpand "false" :vexpand "false" + (label :text "battery" + :halign "start" + :class "sys_text_bat" + :limit-width 9 + :show_truncated false + :wrap false) + (label :text "${EWW_BATTERY["BAT0"].capacity}%" + :halign "start" + :class "sys_text_bat_sub" + :limit-width 22 + :show_truncated false + :wrap false) + (label :text "${EWW_BATTERY["BAT0"].status}" + :halign "start" + :class "sys_text_bat_sub" + :limit-width 22 + :show_truncated false + :wrap false))) + (label :text "" :class "sys_sep" :halign "center") + (box :class "sys_mem_box" :orientation "h" :space-evenly "false" :halign "start" + (circular-progress :value "${round(EWW_RAM.used_mem_perc, 0)}" + :class "sys_mem" + :thickness 9 + (label :text "" + :class "sys_icon_mem" + :limit-width 2 + :show_truncated false + :wrap false + :angle 0.0)) + (box :orientation "v" :space-evenly "false" :spacing 0 :hexpand "false" :vexpand "false" + (label :text "memory" + :halign "start" + :class "sys_text_mem" + :limit-width 9 + :show_truncated false + :wrap false) + (label :text "${round(EWW_RAM.used_mem/1024, 0)} | ${round(EWW_RAM.total_mem/1024, 0)}mb " + :halign "start" + :class "sys_text_mem_sub" + :limit-width 22 + :show_truncated false + :wrap false) + (label :text "${round(EWW_RAM.free_mem/1024,0)}mb free" + :halign "start" + :class "sys_text_mem_sub" + :limit-width 22 + :show_truncated false + :wrap false))))) + +(defwidget cal [] + (box :class "cal" :orientation "v" + (box :class "cal-in" + (calendar :class "cal" + ; :onclick "echo {} is selected >> /home/sahin/caltest" + :show-day-names true + :show-heading true + :show-details true + :show-week-numbers true + )))) + +(defwindow calendar + :geometry (geometry :x "-20px" + :y "7%" + :anchor "top right" + :width "270px" + :height "60px") + (cal)) + + + +(defwidget audio [] + (box :class "audio-box" :orientation "v" :space-evenly "false" :vexpand "false" :hexpand "false" + (box :halign "v" :space-evenly "false" :hexpand "false" :vexpand "false" + (box :class "speaker_icon" :orientation "v") + (box :orientation "v" :halign "center" :vexpand "false" :hexpand "false" + (label :class "speaker_text" :text "speaker" :valign "center" :halign "left" ) + (box :class "speaker_bar" :halign "center" :vexpand "false" :hexpand "false" + (scale :value volume_percent + :space-evenly "false" + :orientation "h" + :onchange "amixer -D pulse sset Master {}%" + :tooltip "volume on ${volume_percent}%" + :max 100 + :min 0)))) + (label :text "" :class "audio_sep" :halign "center") + (box :halign "v" :space-evenly "false" :hexpand "false" :vexpand "false" + (box :class "mic_icon" :orientation "v") + (box :orientation "v" :halign "center" :vexpand "false" :hexpand "false" + (label :class "mic_text" :text "mic" :valign "center" :halign "left" ) + (box :class "mic_bar" :halign "center" :vexpand "false" :hexpand "false" + (scale :value mic_percent + :space-evenly "false" + :orientation "h" + :tooltip "mic on ${mic_percent}%" + :onchange "amixer -D pulse sset Capture {}%" + :max 100 + :min 0)))))) + +(defwindow audio_ctl + :geometry (geometry :x "-20px" + :y "7%" + :anchor "top right" + :width "280px" + :height "60px") + (audio)) + + +(defwindow system + :geometry (geometry :x "-20px" + :y "7%" + :anchor "top right" + :width "290px" + :height "120px") + (system)) + +;; Music +(defwidget music_pop [] + (box :class "music_pop" :orientation "h" :space-evenly "false" :vexpand "false" :hexpand "false" + (box :class "music_cover_art" :vexpand "false" :hexpand "false" :style "background-image: url('${cover_art}');") + (box :orientation "v" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" + (label :halign "center" :class "music" :wrap "true" :limit-width 13 :text song) + (label :halign "center" :class "music_artist" :wrap "true" :limit-width 15 :text song_artist) + (box :orientation "h" :spacing 15 :halign "center" :space-evenly "false" :vexpand "false" :hexpand "false" + (button :class "music_btn_prev" :onclick "~/.config/eww/bar/scripts/music_info --prev" "") + (button :class "music_btn_play" :onclick "~/.config/eww/bar/scripts/music_info --toggle" song_status) + (button :class "music_btn_next" :onclick "~/.config/eww/bar/scripts/music_info --next" "")) + (box :class "music_bar" :halign "center" :vexpand "false" :hexpand "false" :space-evenly "false" + (scale :onscroll "mpc -q seek {}" :min 0 :active "true" :max 100 :value current_status))))) + + +;; music +(defwindow music_win :stacking "fg" :focusable "false" :screen 1 + :geometry (geometry :x "0" :y "7%" :width 428 :height 104 :anchor "top center") + (music_pop)) + diff --git a/.config/eww/bar/images/mic.png b/.config/eww/bar/images/mic.png new file mode 100644 index 0000000..d77f315 Binary files /dev/null and b/.config/eww/bar/images/mic.png differ diff --git a/.config/eww/bar/images/music.png b/.config/eww/bar/images/music.png new file mode 100644 index 0000000..11804f5 Binary files /dev/null and b/.config/eww/bar/images/music.png differ diff --git a/.config/eww/bar/images/speaker.png b/.config/eww/bar/images/speaker.png new file mode 100644 index 0000000..79e005b Binary files /dev/null and b/.config/eww/bar/images/speaker.png differ diff --git a/.config/eww/bar/scripts/battery b/.config/eww/bar/scripts/battery new file mode 100755 index 0000000..d2ad310 --- /dev/null +++ b/.config/eww/bar/scripts/battery @@ -0,0 +1,43 @@ +#!/bin/sh + +bat=/sys/class/power_supply/BAT0/ +per="$(cat "$bat/capacity")" + +icon() { + +[ $(cat "$bat/status") = Charging ] && echo "" && exit + +if [ "$per" -gt "90" ]; then + icon="" +elif [ "$per" -gt "80" ]; then + icon="" +elif [ "$per" -gt "70" ]; then + icon="" +elif [ "$per" -gt "60" ]; then + icon="" +elif [ "$per" -gt "50" ]; then + icon="" +elif [ "$per" -gt "40" ]; then + icon="" +elif [ "$per" -gt "30" ]; then + icon="" +elif [ "$per" -gt "20" ]; then + icon="" +elif [ "$per" -gt "10" ]; then + icon="" +elif [ "$per" -gt "0" ]; then + icon="" +else + echo  && exit +fi +echo "$icon" +} + +percent() { +echo $per +} + +[ "$1" = "icon" ] && icon && exit +[ "$1" = "percent" ] && percent && exit +exit + diff --git a/.config/eww/bar/scripts/indicator b/.config/eww/bar/scripts/indicator new file mode 100755 index 0000000..3946cf4 --- /dev/null +++ b/.config/eww/bar/scripts/indicator @@ -0,0 +1,14 @@ +#!/bin/bash + +query=$(xset q | grep -Po "(?:Caps|Num|Scroll)\s+Lock:\s*(\w*)" | grep -Po "(off|on)") + + +result="" +for i in $query +do + [ $i = "off" ] && result+="ﰊ "|| result+="ﰉ " +done + +# somehow results are shown reversed. So i am reversing them here to fix it +echo $result | rev | xargs + diff --git a/.config/eww/bar/scripts/layout b/.config/eww/bar/scripts/layout new file mode 100755 index 0000000..780105f --- /dev/null +++ b/.config/eww/bar/scripts/layout @@ -0,0 +1,9 @@ +#!/bin/bash +xprop -spy -root _XKB_RULES_NAMES | while read -r line; do + variant=$(echo $line | cut -d',' -f4 | tr -d '"') + if [[ "$variant" == " cdhpt" ]]; then + echo "" + else + echo "" + fi +done diff --git a/.config/eww/bar/scripts/music_info b/.config/eww/bar/scripts/music_info new file mode 100755 index 0000000..ffafe87 --- /dev/null +++ b/.config/eww/bar/scripts/music_info @@ -0,0 +1,98 @@ +#!/bin/bash +# scripts by adi1090x + +## Get data +STATUS="$(mpc status)" +COVER="/tmp/.music_cover.png" +MUSIC_DIR="$HOME/Music" + +## Get status +get_status() { + if [[ $STATUS == *"[playing]"* ]]; then + echo "" + else + echo "奈" + fi +} + +## Get song +get_song() { + song=`mpc -f %title% current` + if [[ -z "$song" ]]; then + echo "Offline" + else + echo "$song" + fi +} + +## Get artist +get_artist() { + artist=`mpc -f %artist% current` + if [[ -z "$artist" ]]; then + echo "" + else + echo "$artist" + fi +} + +## Get time +get_time() { + time=`mpc status | grep "%)" | awk '{print $4}' | tr -d '(%)'` + if [[ -z "$time" ]]; then + echo "0" + else + echo "$time" + fi +} +get_ctime() { + ctime=`mpc status | grep "#" | awk '{print $3}' | sed 's|/.*||g'` + if [[ -z "$ctime" ]]; then + echo "0:00" + else + echo "$ctime" + fi +} +get_ttime() { + ttime=`mpc -f %time% current` + if [[ -z "$ttime" ]]; then + echo "0:00" + else + echo "$ttime" + fi +} + +## Get cover +get_cover() { + ffmpeg -i "${MUSIC_DIR}/$(mpc current -f %file%)" "${COVER}" -y &> /dev/null + STATUS=$? + + # Check if the file has a embbeded album art + if [ "$STATUS" -eq 0 ];then + echo "$COVER" + else + echo "images/music.png" + fi +} + +## Execute accordingly +if [[ "$1" == "--song" ]]; then + get_song +elif [[ "$1" == "--artist" ]]; then + get_artist +elif [[ "$1" == "--status" ]]; then + get_status +elif [[ "$1" == "--time" ]]; then + get_time +elif [[ "$1" == "--ctime" ]]; then + get_ctime +elif [[ "$1" == "--ttime" ]]; then + get_ttime +elif [[ "$1" == "--cover" ]]; then + get_cover +elif [[ "$1" == "--toggle" ]]; then + mpc -q toggle +elif [[ "$1" == "--next" ]]; then + { mpc -q next; get_cover; } +elif [[ "$1" == "--prev" ]]; then + { mpc -q prev; get_cover; } +fi diff --git a/.config/eww/bar/scripts/pop b/.config/eww/bar/scripts/pop new file mode 100755 index 0000000..ced6877 --- /dev/null +++ b/.config/eww/bar/scripts/pop @@ -0,0 +1,89 @@ +#!/bin/bash + +calendar() { +LOCK_FILE="$HOME/.cache/eww-calendar.lock" +EWW_BIN="eww" + +run() { + ${EWW_BIN} -c $HOME/.config/eww/bar open calendar +} + +# Open widgets +if [[ ! -f "$LOCK_FILE" ]]; then + ${EWW_BIN} -c $HOME/.config/eww/bar close system music_win audio_ctl + touch "$LOCK_FILE" + run && echo "ok good!" +else + ${EWW_BIN} -c $HOME/.config/eww/bar close calendar + rm "$LOCK_FILE" && echo "closed" +fi +} + + +system() { +LOCK_FILE_MEM="$HOME/.cache/eww-system.lock" + +run() { + ${EWW_BIN} -c $HOME/.config/eww/bar open system +} + +# Open widgets +if [[ ! -f "$LOCK_FILE_MEM" ]]; then + ${EWW_BIN} -c $HOME/.config/eww/bar close calendar music_win audio_ctl + touch "$LOCK_FILE_MEM" + run && echo "ok good!" +else + ${EWW_BIN} -c $HOME/.config/eww/bar close system + rm "$LOCK_FILE_MEM" && echo "closed" +fi +} + + +music() { +LOCK_FILE_SONG="$HOME/.cache/eww-song.lock" + +run() { + ${EWW_BIN} -c $HOME/.config/eww/bar open music_win +} + +# Open widgets +if [[ ! -f "$LOCK_FILE_SONG" ]]; then + ${EWW_BIN} -c $HOME/.config/eww/bar close system calendar + touch "$LOCK_FILE_SONG" + run && echo "ok good!" +else + ${EWW_BIN} -c $HOME/.config/eww/bar close music_win + rm "$LOCK_FILE_SONG" && echo "closed" +fi +} + + + +audio() { +LOCK_FILE_AUDIO="$HOME/.cache/eww-audio.lock" + +run() { + ${EWW_BIN} -c $HOME/.config/eww/bar open audio_ctl +} + +# Open widgets +if [[ ! -f "$LOCK_FILE_AUDIO" ]]; then + ${EWW_BIN} -c $HOME/.config/eww/bar close system calendar music + touch "$LOCK_FILE_AUDIO" + run && echo "ok good!" +else + ${EWW_BIN} -c $HOME/.config/eww/bar close audio_ctl + rm "$LOCK_FILE_AUDIO" && echo "closed" +fi +} + + +if [ "$1" = "calendar" ]; then +calendar +elif [ "$1" = "system" ]; then +system +elif [ "$1" = "music" ]; then +music +elif [ "$1" = "audio" ]; then +audio +fi diff --git a/.config/eww/bar/scripts/qtile b/.config/eww/bar/scripts/qtile new file mode 100755 index 0000000..ad8e24c --- /dev/null +++ b/.config/eww/bar/scripts/qtile @@ -0,0 +1,12 @@ +#!/bin/bash + +case "$1" in + switch) qtile cmd-obj -o group $2 -f toscreen + ;; + restart) qtile cmd-obj -o cmd -f restart + ;; + shutdown) qtile cmd-obj -o cmd -f shutdown + ;; +esac + + diff --git a/.config/eww/bar/scripts/wifi b/.config/eww/bar/scripts/wifi new file mode 100755 index 0000000..024994d --- /dev/null +++ b/.config/eww/bar/scripts/wifi @@ -0,0 +1,26 @@ +#!/bin/bash + +status=$(nmcli g | grep -oE "disconnected") +essid=$(nmcli c | grep wlan0 | awk '{print ($1)}') + +if [ $status ] ; then + icon="" + text="" + col="#575268" + +else + icon="" + text="${essid}" + col="#a1bdce" +fi + + + +if [[ "$1" == "--COL" ]]; then + echo $col +elif [[ "$1" == "--ESSID" ]]; then + echo $text +elif [[ "$1" == "--ICON" ]]; then + echo $icon +fi + diff --git a/.config/eww/bar/scripts/workspace b/.config/eww/bar/scripts/workspace new file mode 100755 index 0000000..ca6747a --- /dev/null +++ b/.config/eww/bar/scripts/workspace @@ -0,0 +1,6 @@ +#!/bin/bash +dir=`dirname $0` +python3 $dir/workspaces.py +tail -F -n1 ~/.cache/workspaces | while read -r; do + python3 $dir/workspaces.py +done diff --git a/.config/eww/bar/scripts/workspaces.py b/.config/eww/bar/scripts/workspaces.py new file mode 100644 index 0000000..082c3c5 --- /dev/null +++ b/.config/eww/bar/scripts/workspaces.py @@ -0,0 +1,53 @@ +from libqtile.command.client import CommandClient +c = CommandClient() + + +groups = {} + +for name, group in c.call('groups').items(): + if name == "scratchpad": + continue + occupied = len(group["windows"]) > 0 + focused = group['screen'] is not None + groups[name] = {"occupied": occupied, "focused": focused} + +output = '(box :class "works" :orientation "h" :spacing 5 :space-evenly "false" ' +for name, prop in groups.items(): + command = f"scripts/qtile switch {name}" + class_ = "0" + focused, occupied = prop['focused'], prop['occupied'] + if focused: + class_ += name * 2 + elif occupied: + class_ += name + + if occupied: + if name == "3": + class_ += " thunderbird" + elif name == "6": + class_ += " twitter" + elif name == "7": + class_ += " firefox" + elif name == "8": + class_ += " twitch" + elif name == "9": + class_ += " discord" + elif name == "0": + class_ += " telegram" + icons = { + "1": "1", + "2": "", + "3": "", + "4": "", + "5": "", + "6": "", + "7": "", + "8": "既", + "9": "ﭮ", + "0": "", + } + icon = icons[name] + output += f'(button :onclick "{command}" :class "{class_}" "{icon}") ' + +output += ')' +print(output) diff --git a/.config/layouts/colemak/cdhpt.xml b/.config/layouts/colemak/cdhpt.xml new file mode 100644 index 0000000..73f870c --- /dev/null +++ b/.config/layouts/colemak/cdhpt.xml @@ -0,0 +1,12 @@ + + + cdhpt + English (Programmer Colemak-DH with Turkish support) + + + + + cdhisopt + English (Programmer Colemak-DH ISO with Turkish support) + + diff --git a/.config/layouts/colemak/colemakdh b/.config/layouts/colemak/colemakdh new file mode 100644 index 0000000..99bfc2f --- /dev/null +++ b/.config/layouts/colemak/colemakdh @@ -0,0 +1,62 @@ +// Colemak-DH (ANSI) symbols for xkb on X.Org Server 7.x +// 2014-10-25 by SteveP, https://colemakmods.github.io/mod-dh/ + +xkb_symbols "cdhpt" { + + name[Group1]= "English (Programmer Colemak-DH with Turkish support)"; + + key { [ grave, asciitilde, dead_tilde, asciitilde ] }; + key { [ at, 1 ] }; + key { [ bracketleft, 2 ] }; + key { [ braceleft, 3 ] }; + key { [ parenleft, 4 ] }; + key { [ plus, 5 ] }; + key { [ equal, 6 ] }; + key { [ parenright, 7 ] }; + key { [ braceright, 8 ] }; + key { [ bracketright, 9 ] }; + key { [ percent, 0 ] }; + key { [ asterisk, numbersign ] }; + key { [ ampersand, exclam ] }; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ f, F ] }; + key { [ p, P ] }; + key { [ b, B ] }; + key { [ j, J ] }; + key { [ l, L ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ y, Y ] }; + key { [ semicolon, colon ] }; + key { [ minus, underscore ] }; + key { [ dollar, asciicircum ] }; + key { [ backslash, bar ] }; + + key { [ a, A ] }; + key { [ r, R ] }; + key { [ s, S, scedilla, Scedilla ] }; + key { [ t, T ] }; + key { [ g, G, gbreve, Gbreve ] }; + key { [ m, M ] }; + key { [ n, N ] }; + key { [ e, E ] }; + key { [ i, I, idotless, Iabovedot ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; + key { [ apostrophe, quotedbl ] }; + + key { [ z, Z ] }; + key { [ x, X ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ d, D ] }; + key { [ v, V ] } ; + key { [ k, K ] }; + key { [ h, H ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; + + key { [ space, space, space, nobreakspace ] }; + + include "level3(ralt_switch)" +}; diff --git a/.config/layouts/colemak/colemakdhiso b/.config/layouts/colemak/colemakdhiso new file mode 100644 index 0000000..86205b7 --- /dev/null +++ b/.config/layouts/colemak/colemakdhiso @@ -0,0 +1,38 @@ +// Colemak-DH (ISO) symbols for xkb on X.Org Server 7.x +// https://colemakmods.github.io/mod-dh/ + +xkb_symbols "cdhisopt" { + + include "us(colemak_dh)" + name[Group1]= "English (Programmer Colemak-DH ISO with Turkish support)"; + + key { [ grave, asciitilde, dead_tilde, asciitilde ] }; + key { [ at, 1 ] }; + key { [ bracketleft, 2 ] }; + key { [ braceleft, 3 ] }; + key { [ parenleft, 4 ] }; + key { [ plus, 5 ] }; + key { [ equal, 6 ] }; + key { [ parenright, 7 ] }; + key { [ braceright, 8 ] }; + key { [ bracketright, 9 ] }; + key { [ percent, 0 ] }; + key { [ asterisk, numbersign ] }; + key { [ ampersand, exclam ] }; + + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ minus, underscore ] }; + key { [ m, M, Left, Left ] }; + key { [ n, N, Down, Down ] }; + key { [ e, E, Up, Up ] }; + key { [ i, I, Right, Right ] }; + key { [ apostrophe, quotedbl, idotless, Iabovedot ] }; + key { [ s, S, scedilla, Scedilla ] }; + key { [ g, G, gbreve, Gbreve ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; + key { [ dollar, asciicircum ] }; + key { [ backslash, bar, asciitilde, brokenbar] }; + + include "level3(ralt_switch)" +}; diff --git a/.config/layouts/dvorak/rdvpt b/.config/layouts/dvorak/rdvpt new file mode 100644 index 0000000..5a20603 --- /dev/null +++ b/.config/layouts/dvorak/rdvpt @@ -0,0 +1,61 @@ +// based on Michael Paulson's poor ideas. + +partial alphanumeric_keys +xkb_symbols "rdvpt" { + + include "level3(ralt_switch)" + name[Group1]= "English (Real Programmers Dvorak)"; + + key { [ grave, asciitilde, dead_grave, dead_tilde ] }; + + key { [ at, 1 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ bracketleft, 2 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ braceleft, 3 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ parenleft, 4 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ plus, 5 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ equal, 6, dead_circumflex, dead_circumflex ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ parenright, 7 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ braceright, 8 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ bracketright, 9, dead_grave] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC"}; + key { [ percent, 0 ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ asterisk, numbersign ] }; + key { [ ampersand , exclam ] }; + + key { [ semicolon, colon, dead_acute, dead_diaeresis ] }; + key { [ comma, less, dead_cedilla, dead_caron ] }; + key { [ period, greater, dead_abovedot, periodcentered ] }; + key { [ p, P ] }; + key { [ y, Y ] }; + key { [ f, F ] }; + key { [ g, G, gbreve, Gbreve ] }; + key { [ c, C ,ccedilla, Ccedilla ] }; + key { [ r, R ] }; + key { [ l, L ] }; + key { [ slash, question ] }; + key { [ dollar, asciicircum] }; + + key { [ a, A ] }; + key { [ o, O,odiaeresis, Odiaeresis ] }; + key { [ e, E ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ i, I, idotless,Iabovedot ] }; + key { [ d, D ] }; + key { [ h, H ] }; + key { [ t, T ] }; + key { [ n, N ] }; + key { [ s, S,scedilla, Scedilla ] }; + key { [ minus, underscore ] ,type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + + key { [ apostrophe, quotedbl, dead_ogonek, dead_doubleacute ] }; + key { [ q, Q ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ x, X ] }; + key { [ b, B, grave,dead_grave ] }; + key { [ m, M ] }; + key { [ w, W ] }; + key { [ v, V ] }; + key { [ z, Z ] }; + + key { [ backslash, bar ] }; +}; diff --git a/.config/layouts/dvorak/rdvpt.map b/.config/layouts/dvorak/rdvpt.map new file mode 100644 index 0000000..dbcb043 --- /dev/null +++ b/.config/layouts/dvorak/rdvpt.map @@ -0,0 +1,100 @@ +! Real Programmer's Dvorak keymap with Turkish support +! +! Original from: http://www.kaufmann.no/roland/dvorak/ +! This file edited by: Merlin Dou (11 March 2014) +! +! This file is free software; you can redistribute it and/or modify +! it under the terms of the GNU General Public License as published by +! the Free Software Foundation; either version 2 of the License, or +! (at your option) any later version. +! +! This program is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU General Public License for more details. +! +! You should have received a copy of the GNU General Public License +! along with this program; if not, write to the Free Software +! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +! +keymaps 0-2,4-6,8-9,12 +alt_is_meta +include "linux-with-two-alt-keys.inc" +strings as usual +! -------------------------------------------------------------------------- +! Row 1 +! -------------------------------------------------------------------------- +keycode 1 = Escape +! -------------------------------------------------------------------------- +! Row 2 +! -------------------------------------------------------------------------- + +keycode 41 = grave asciitilde +keycode 2 = at 1 +keycode 3 = bracketleft 2 +keycode 4 = braceleft 3 +keycode 5 = parenleft 4 +keycode 6 = plus 5 +keycode 7 = equal 6 +keycode 8 = parenright 7 +keycode 9 = braceright 8 +keycode 10 = bracketright 9 +keycode 11 = percent 0 +keycode 12 = asterisk numbersign +keycode 13 = ampersand exclam +keycode 14 = Delete +! -------------------------------------------------------------------------- +! Row 3 +! -------------------------------------------------------------------------- +keycode 15 = Tab +keycode 16 = semicolon colon +keycode 17 = comma less +keycode 18 = period greater +keycode 19 = p +keycode 20 = y +keycode 21 = f +keycode 22 = g +keycode 23 = c +keycode 24 = r +keycode 25 = l +keycode 26 = slash question +keycode 27 = dollar asciicircum +keycode 28 = Return +! -------------------------------------------------------------------------- +! Row 4 +! -------------------------------------------------------------------------- +keycode 58 = Caps_Lock +keycode 30 = a +keycode 31 = o +keycode 32 = e +keycode 33 = u +keycode 34 = i +keycode 35 = d +keycode 36 = h +keycode 37 = t +keycode 38 = n +keycode 39 = s +keycode 40 = minus underscore +keycode 43 = backslash bar +! -------------------------------------------------------------------------- +! Row 5 +! -------------------------------------------------------------------------- +keycode 42 = Shift +keycode 44 = apostrophe quotedbl +keycode 45 = q +keycode 46 = j +keycode 47 = k +keycode 48 = x +keycode 49 = b +keycode 50 = m +keycode 51 = w +keycode 52 = v +keycode 53 = z +keycode 54 = Shift +! -------------------------------------------------------------------------- +! Row 6 +! -------------------------------------------------------------------------- +keycode 29 = Control +keycode 56 = Alt +keycode 57 = space +keycode 97 = Control diff --git a/.config/layouts/dvorak/rdvpt.xml b/.config/layouts/dvorak/rdvpt.xml new file mode 100644 index 0000000..b998cec --- /dev/null +++ b/.config/layouts/dvorak/rdvpt.xml @@ -0,0 +1,6 @@ + + + rdvpt + English (real programmer Dvorak with Turkish characters) + + diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf new file mode 100644 index 0000000..541f581 --- /dev/null +++ b/.config/mpd/mpd.conf @@ -0,0 +1,426 @@ +# An example configuration file for MPD. +# Read the user manual for documentation: http://www.musicpd.org/doc/user/ + + +# Files and directories ####################################################### +# +# This setting controls the top directory which MPD will search to discover the +# available audio files and add them to the daemon's online database. This +# setting defaults to the XDG directory, otherwise the music directory will be +# be disabled and audio files will only be accepted over ipc socket (using +# file:// protocol) or streaming files over an accepted protocol. +# +#music_directory "~/music" +music_directory "~/Music" +# +# This setting sets the MPD internal playlist directory. The purpose of this +# directory is storage for playlists created by MPD. The server will use +# playlist files not created by the server but only if they are in the MPD +# format. This setting defaults to playlist saving being disabled. +# +#playlist_directory "~/.mpd/playlists" +playlist_directory "~/.config/mpd/playlists" +# +# This setting sets the location of the MPD database. This file is used to +# load the database at server start up and store the database while the +# server is not up. This setting defaults to disabled which will allow +# MPD to accept files over ipc socket (using file:// protocol) or streaming +# files over an accepted protocol. +# +# db_file "~/.mpd/database" + +db_file "~/.config/mpd/database" +# These settings are the locations for the daemon log files for the daemon. +# +# The special value "syslog" makes MPD use the local syslog daemon. This +# setting defaults to logging to syslog. +# +# If you use systemd, do not configure a log_file. With systemd, MPD +# defaults to the systemd journal, which is fine. +# +# log_file "~/.mpd/log" +log_file "syslog" + +# This setting sets the location of the file which stores the process ID +# for use of mpd --kill and some init scripts. This setting is disabled by +# default and the pid file will not be stored. +# +# If you use systemd, do not configure a pid_file. +# +# pid_file "~/.mpd/pid" +pid_file "~/.config/mpd/pid" + +# This setting sets the location of the file which contains information about +# most variables to get MPD back into the same general shape it was in before +# it was brought down. This setting is disabled by default and the server +# state will be reset on server start up. +# +#state_file "~/.mpd/state" +state_file "~/.config/mpd/state" +# +# The location of the sticker database. This is a database which +# manages dynamic information attached to songs. +# +#sticker_file "~/.mpd/sticker.sql" +sticker_file "~/.config/mpd/sticker.sql" +# +############################################################################### + + +# General music daemon options ################################################ +# +# This setting specifies the user that MPD will run as. MPD should never run as +# root and you may use this setting to make MPD change its user ID after +# initialization. This setting is disabled by default and MPD is run as the +# current user. +# +#user "nobody" +# +# This setting specifies the group that MPD will run as. If not specified +# primary group of user specified with "user" setting will be used (if set). +# This is useful if MPD needs to be a member of group such as "audio" to +# have permission to use sound card. +# +#group "nogroup" +# +# This setting sets the address for the daemon to listen on. Careful attention +# should be paid if this is assigned to anything other than the default, any. +# This setting can deny access to control of the daemon. Not effective if +# systemd socket activiation is in use. +# +# For network +#bind_to_address "any" +# +# And for Unix Socket +#bind_to_address "~/.mpd/socket" +# +# This setting is the TCP port that is desired for the daemon to get assigned +# to. +# +#port "6600" +# +# Suppress all messages below the given threshold. Use "verbose" for +# troubleshooting. Available setting arguments are "notice", "info", "verbose", +# "warning" and "error". +# +#log_level "notice" +# +# Setting "restore_paused" to "yes" puts MPD into pause mode instead +# of starting playback after startup. +# +#restore_paused "no" +# +# This setting enables MPD to create playlists in a format usable by other +# music players. +# +#save_absolute_paths_in_playlists "no" +# +# This setting defines a list of tag types that will be extracted during the +# audio file discovery process. The complete list of possible values can be +# found in the user manual. +#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" +# +# This example just enables the "comment" tag without disabling all +# the other supported tags: +#metadata_to_use "+comment" +# +# This setting enables automatic update of MPD's database when files in +# music_directory are changed. +# +#auto_update "yes" +auto_update "yes" +# +# Limit the depth of the directories being watched, 0 means only watch +# the music directory itself. There is no limit by default. +# +#auto_update_depth "3" +# +############################################################################### + + +# Symbolic link behavior ###################################################### +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links outside of the configured music_directory. +# +#follow_outside_symlinks "yes" +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links inside of the configured music_directory. +# +#follow_inside_symlinks "yes" +# +############################################################################### + + +# Zeroconf / Avahi Service Discovery ########################################## +# +# If this setting is set to "yes", service information will be published with +# Zeroconf / Avahi. +# +#zeroconf_enabled "yes" +# +# The argument to this setting will be the Zeroconf / Avahi unique name for +# this MPD server on the network. %h will be replaced with the hostname. +# +#zeroconf_name "Music Player @ %h" +# +############################################################################### + + +# Permissions ################################################################# +# +# If this setting is set, MPD will require password authorization. The password +# setting can be specified multiple times for different password profiles. +# +#password "password@read,add,control,admin" +# +# This setting specifies the permissions a user has who has not yet logged in. +# +#default_permissions "read,add,control,admin" +# +############################################################################### + + +# Database ####################################################################### +# +# An example of a database section instead of the old 'db_file' setting. +# It enables mounting other storages into the music directory. +# +#database { +# plugin "simple" +# path "~/.local/share/mpd/db +# cache_directory "~/.local/share/mpd/cache" +#} +# +# An example of database config for a sattelite setup +# +#music_directory "nfs://fileserver.local/srv/mp3" +#database { +# plugin "proxy" +# host "other.mpd.host" +# port "6600" +#} + +# Input ####################################################################### +# +input { + plugin "curl" +# proxy "proxy.isp.com:8080" +# proxy_user "user" +# proxy_password "password" +} + +# +############################################################################### + +# Audio Output ################################################################ +# +# MPD supports various audio output types, as well as playing through multiple +# audio outputs at the same time, through multiple audio_output settings +# blocks. Setting this block is optional, though the server will only attempt +# autodetection for one sound card. +# +# An example of an ALSA output: +# +#audio_output { +# type "alsa" +# name "My ALSA Device" +## device "hw:0,0" # optional +## mixer_type "hardware" # optional +## mixer_device "default" # optional +## mixer_control "PCM" # optional +## mixer_index "0" # optional +#} +# +# An example of an OSS output: +# +#audio_output { +# type "oss" +# name "My OSS Device" +## device "/dev/dsp" # optional +## mixer_type "hardware" # optional +## mixer_device "/dev/mixer" # optional +## mixer_control "PCM" # optional +#} +# +# An example of a shout output (for streaming to Icecast): +# +#audio_output { +# type "shout" +# encoder "vorbis" # optional +# name "My Shout Stream" +# host "localhost" +# port "8000" +# mount "/mpd.ogg" +# password "hackme" +# quality "5.0" +# bitrate "128" +# format "44100:16:1" +## protocol "icecast2" # optional +## user "source" # optional +## description "My Stream Description" # optional +## url "http://example.com" # optional +## genre "jazz" # optional +## public "no" # optional +## timeout "2" # optional +## mixer_type "software" # optional +#} +# +# An example of a recorder output: +# +#audio_output { +# type "recorder" +# name "My recorder" +# encoder "vorbis" # optional, vorbis or lame +# path "/var/lib/mpd/recorder/mpd.ogg" +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +#} +# +# An example of a httpd output (built-in HTTP streaming server): +# +#audio_output { +# type "httpd" +# name "My HTTP Stream" +# encoder "vorbis" # optional, vorbis or lame +# port "8000" +# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +# max_clients "0" # optional 0=no limit +#} +# +# An example of a pulseaudio output (streaming to a remote pulseaudio server) +# +#audio_output { +# type "pulse" +# name "My Pulse Output" +## server "remote_server" # optional +## sink "remote_server_sink" # optional +## media_role "media_role" #optional +#} +# +# An example of a winmm output (Windows multimedia API). +# +#audio_output { +# type "winmm" +# name "My WinMM output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## mixer_type "hardware" # optional +#} +# +# An example of a wasapi output (Windows multimedia API). +# +#audio_output { +# type "wasapi" +# name "My WASAPI output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## Exclusive mode blocks all other audio source, and get best audio quality without resampling. +## exclusive "no" # optional +## Enumerate all devices in log. +## enumerate "no" # optional +#} +# +# An example of an openal output. +# +#audio_output { +# type "openal" +# name "My OpenAL output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +#} +# +# An example of an sndio output. +# +#audio_output { +# type "sndio" +# name "sndio output" +# mixer_type "hardware" +#} +# +# An example of an OS X output: +# +#audio_output { +# type "osx" +# name "My OS X Device" +## device "Built-in Output" # optional +## channel_map "-1,-1,0,1" # optional +#} +# +## Example "pipe" output: +# +#audio_output { +# type "pipe" +# name "my pipe" +# command "aplay -f cd 2>/dev/null" +## Or if you're want to use AudioCompress +# command "AudioCompress -m | aplay -f cd 2>/dev/null" +## Or to send raw PCM stream through PCM: +# command "nc example.org 8765" +# format "44100:16:2" +#} +# +## An example of a null output (for no audio output): +# +#audio_output { +# type "null" +# name "My Null Output" +# mixer_type "none" # optional +#} +# +############################################################################### + + +# Normalization automatic volume adjustments ################################## +# +# This setting specifies the type of ReplayGain to use. This setting can have +# the argument "off", "album", "track" or "auto". "auto" is a special mode that +# chooses between "track" and "album" depending on the current state of +# random playback. If random playback is enabled then "track" mode is used. +# See for +# more details about ReplayGain. +# This setting is off by default. +# +#replaygain "album" +# +# This setting sets the pre-amp used for files that have ReplayGain tags. By +# default this setting is disabled. +# +#replaygain_preamp "0" +# +# This setting sets the pre-amp used for files that do NOT have ReplayGain tags. +# By default this setting is disabled. +# +#replaygain_missing_preamp "0" +# +# This setting enables or disables ReplayGain limiting. +# MPD calculates actual amplification based on the ReplayGain tags +# and replaygain_preamp / replaygain_missing_preamp setting. +# If replaygain_limit is enabled MPD will never amplify audio signal +# above its original level. If replaygain_limit is disabled such amplification +# might occur. By default this setting is enabled. +# +#replaygain_limit "yes" +# +# This setting enables on-the-fly normalization volume adjustment. This will +# result in the volume of all playing audio to be adjusted so the output has +# equal "loudness". This setting is disabled by default. +# +#volume_normalization "no" +# +############################################################################### + +# Character Encoding ########################################################## +# +# If file or directory names do not display correctly for your locale then you +# may need to modify this setting. +# +#filesystem_charset "UTF-8" +# +############################################################################### diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf new file mode 100644 index 0000000..f903b7a --- /dev/null +++ b/.config/mpv/input.conf @@ -0,0 +1,180 @@ +# mpv keybindings +# +# Location of user-defined bindings: ~/.config/mpv/input.conf +# + +# Lines starting with # are comments. Use SHARP to assign the # key. +# Copy this file and uncomment and edit the bindings you want to change. +# +# List of commands and further details: DOCS/man/input.rst +# List of special keys: --input-keylist +# Keybindings testing mode: mpv --input-test --force-window --idle +# +# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore'). +# +# Strings need to be quoted and escaped: +# KEY show-text "This is a single backslash: \\ and a quote: \" !" +# +# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with +# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal). +# +# The default keybindings are hardcoded into the mpv binary. +# You can disable them completely with: --no-input-default-bindings + +# Developer note: +# On compilation, this file is baked into the mpv binary, and all lines are +# uncommented (unless '#' is followed by a space) - thus this file defines the +# default key bindings. + +# If this is enabled, treat all the following bindings as default. +#default-bindings start + +#MBTN_LEFT ignore # don't do anything +#MBTN_LEFT_DBL cycle fullscreen # toggle fullscreen +#MBTN_RIGHT cycle pause # toggle pause/playback mode +#MBTN_BACK playlist-prev # skip to the previous file +#MBTN_FORWARD playlist-next # skip to the next file + +# Mouse wheels, touchpad or other input devices that have axes +# if the input devices supports precise scrolling it will also scale the +# numeric value accordingly +#WHEEL_UP seek 10 # seek 10 seconds forward +#WHEEL_DOWN seek -10 # seek 10 seconds backward +#WHEEL_LEFT add volume -2 +#WHEEL_RIGHT add volume 2 + +## Seek units are in seconds, but note that these are limited by keyframes +#RIGHT seek 5 # seek 5 seconds forward +#LEFT seek -5 # seek 5 seconds backward +#UP seek 60 # seek 1 minute forward +#DOWN seek -60 # seek 1 minute backward +# Do smaller, always exact (non-keyframe-limited), seeks with shift. +# Don't show them on the OSD (no-osd). +#Shift+RIGHT no-osd seek 1 exact # seek exactly 1 second forward +#Shift+LEFT no-osd seek -1 exact # seek exactly 1 second backward +#Shift+UP no-osd seek 5 exact # seek exactly 5 seconds forward +#Shift+DOWN no-osd seek -5 exact # seek exactly 5 seconds backward +#Ctrl+LEFT no-osd sub-seek -1 # seek to the previous subtitle +#Ctrl+RIGHT no-osd sub-seek 1 # seek to the next subtitle +#Ctrl+Shift+LEFT sub-step -1 # change subtitle timing such that the previous subtitle is displayed +#Ctrl+Shift+RIGHT sub-step 1 # change subtitle timing such that the next subtitle is displayed +#Alt+left add video-pan-x 0.1 # move the video right +#Alt+right add video-pan-x -0.1 # move the video left +#Alt+up add video-pan-y 0.1 # move the video down +#Alt+down add video-pan-y -0.1 # move the video up +#Alt++ add video-zoom 0.1 # zoom in +#Alt+- add video-zoom -0.1 # zoom out +#Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 # reset zoom and pan settings +#PGUP add chapter 1 # seek to the next chapter +#PGDWN add chapter -1 # seek to the previous chapter +#Shift+PGUP seek 600 # seek 10 minutes forward +#Shift+PGDWN seek -600 # seek 10 minutes backward +#[ multiply speed 1/1.1 # decrease the playback speed +#] multiply speed 1.1 # increase the playback speed +< multiply speed 1/1.5 +> multiply speed 1.5 +#BS set speed 1.0 # reset the speed to normal +#Shift+BS revert-seek # undo the previous (or marked) seek +#Shift+Ctrl+BS revert-seek mark # mark the position for revert-seek +#q quit +#Q quit-watch-later # exit and remember the playback position +#q {encode} quit 4 +#ESC set fullscreen no # leave fullscreen +#ESC {encode} quit 4 +#p cycle pause # toggle pause/playback mode +#. frame-step # advance one frame and pause +#, frame-back-step # go back by one frame and pause +#SPACE cycle pause # toggle pause/playback mode +#> playlist-next # skip to the next file +#ENTER playlist-next # skip to the next file +#< playlist-prev # skip to the previous file +#O no-osd cycle-values osd-level 3 1 # toggle displaying the OSD on user interaction or always +#o show-progress # show playback progress +#P show-progress # show playback progress +#i script-binding stats/display-stats # display information and statistics +#I script-binding stats/display-stats-toggle # toggle displaying information and statistics +#` script-binding console/enable # open the console +#z add sub-delay -0.1 # shift subtitles 100 ms earlier +#Z add sub-delay +0.1 # delay subtitles by 100 ms +#x add sub-delay +0.1 # delay subtitles by 100 ms +#ctrl++ add audio-delay 0.100 # change audio/video sync by delaying the audio +#ctrl+- add audio-delay -0.100 # change audio/video sync by shifting the audio earlier +#Shift+g add sub-scale +0.1 # increase the subtitle font size +#Shift+f add sub-scale -0.1 # decrease the subtitle font size +#9 add volume -2 +#/ add volume -2 +#0 add volume 2 +#* add volume 2 +#m cycle mute # toggle mute +#1 add contrast -1 +#2 add contrast 1 +#3 add brightness -1 +#4 add brightness 1 +#5 add gamma -1 +#6 add gamma 1 +#7 add saturation -1 +#8 add saturation 1 +#Alt+0 set current-window-scale 0.5 # halve the window size +#Alt+1 set current-window-scale 1.0 # reset the window size +#Alt+2 set current-window-scale 2.0 # double the window size +#d cycle deinterlace # toggle the deinterlacing filter +#r add sub-pos -1 # move subtitles up +#R add sub-pos +1 # move subtitles down +#t add sub-pos +1 # move subtitles down +#v cycle sub-visibility # hide or show the subtitles +#Alt+v cycle secondary-sub-visibility # hide or show the secondary subtitles +#V cycle sub-ass-vsfilter-aspect-compat # toggle stretching SSA/ASS subtitles with anamorphic videos to match the historical renderer +#u cycle-values sub-ass-override "force" "no" # toggle overriding SSA/ASS subtitle styles with the normal styles +#j cycle sub # switch subtitle track +#J cycle sub down # switch subtitle track backwards +#SHARP cycle audio # switch audio track +#_ cycle video # switch video track +#T cycle ontop # toggle placing the video on top of other windows +#f cycle fullscreen # toggle fullscreen +#s screenshot # take a screenshot of the video in its original resolution with subtitles +#S screenshot video # take a screenshot of the video in its original resolution without subtitles +#Ctrl+s screenshot window # take a screenshot of the window with OSD and subtitles +#Alt+s screenshot each-frame # automatically screenshot every frame; issue this command again to stop taking screenshots +#w add panscan -0.1 # decrease panscan +#W add panscan +0.1 # shrink black bars by cropping the video +#e add panscan +0.1 # shrink black bars by cropping the video +#A cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1" # cycle the video aspect ratio ("-1" is the container aspect) +#POWER quit +#PLAY cycle pause # toggle pause/playback mode +#PAUSE cycle pause # toggle pause/playback mode +#PLAYPAUSE cycle pause # toggle pause/playback mode +#PLAYONLY set pause no # unpause +#PAUSEONLY set pause yes # pause +#STOP quit +#FORWARD seek 60 # seek 1 minute forward +#REWIND seek -60 # seek 1 minute backward +#NEXT playlist-next # skip to the next file +#PREV playlist-prev # skip to the previous file +#VOLUME_UP add volume 2 +#VOLUME_DOWN add volume -2 +#MUTE cycle mute # toggle mute +#CLOSE_WIN quit +#CLOSE_WIN {encode} quit 4 +#ctrl+w quit +#E cycle edition # switch edition +#l ab-loop # set/clear A-B loop points +#L cycle-values loop-file "inf" "no" # toggle infinite looping +#ctrl+c quit 4 +#DEL script-binding osc/visibility # cycle OSC visibility between never, auto (mouse-move) and always +#ctrl+h cycle-values hwdec "auto" "no" # toggle hardware decoding +#F8 show-text ${playlist} # show the playlist +#F9 show-text ${track-list} # show the list of video, audio and sub tracks + +# +# Legacy bindings (may or may not be removed in the future) +# +! add chapter -1 # seek to the previous chapter +@ add chapter 1 # seek to the next chapter + +# +# Not assigned by default +# (not an exhaustive list of unbound commands) +# + +# ? cycle sub-forced-only # toggle DVD forced subs +# ? stop # stop playback (quit or enter idle mode) diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf new file mode 100644 index 0000000..9e8862e --- /dev/null +++ b/.config/mpv/mpv.conf @@ -0,0 +1,3 @@ +script-opts=ytdl_hook-ytdl_path=/usr/bin/yt-dlp +ytdl-format=bestvideo[height<=?480]+bestaudio/best + diff --git a/.config/mpv/scripts/autload.lua b/.config/mpv/scripts/autload.lua new file mode 100644 index 0000000..62b55c0 --- /dev/null +++ b/.config/mpv/scripts/autload.lua @@ -0,0 +1,212 @@ +-- This script automatically loads playlist entries before and after the +-- the currently played file. It does so by scanning the directory a file is +-- located in when starting playback. It sorts the directory entries +-- alphabetically, and adds entries before and after the current file to +-- the internal playlist. (It stops if it would add an already existing +-- playlist entry at the same position - this makes it "stable".) +-- Add at most 5000 * 2 files when starting a file (before + after). +--[[ +To configure this script use file autoload.conf in directory script-opts (the "script-opts" +directory must be in the mpv configuration directory, typically ~/.config/mpv/). + +Example configuration would be: + +disabled=no +images=no +videos=yes +audio=yes +ignore_hidden=yes + +--]] MAXENTRIES = 5000 + +local msg = require 'mp.msg' +local options = require 'mp.options' +local utils = require 'mp.utils' + +o = { + disabled = false, + images = true, + videos = true, + audio = true, + ignore_hidden = true +} +options.read_options(o) + +function Set(t) + local set = {} + for _, v in pairs(t) do set[v] = true end + return set +end + +function SetUnion(a, b) + local res = {} + for k in pairs(a) do res[k] = true end + for k in pairs(b) do res[k] = true end + return res +end + +EXTENSIONS_VIDEO = Set { + 'mkv', 'avi', 'mp4', 'ogv', 'webm', 'rmvb', 'flv', 'wmv', 'mpeg', 'mpg', + 'm4v', '3gp' +} + +EXTENSIONS_AUDIO = Set { + 'mp3', 'wav', 'ogm', 'flac', 'm4a', 'wma', 'ogg', 'opus' +} + +EXTENSIONS_IMAGES = Set { + 'jpg', 'jpeg', 'png', 'tif', 'tiff', 'gif', 'webp', 'svg', 'bmp' +} + +EXTENSIONS = Set {} +if o.videos then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_VIDEO) end +if o.audio then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_AUDIO) end +if o.images then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_IMAGES) end + +function add_files_at(index, files) + index = index - 1 + local oldcount = mp.get_property_number('playlist-count', 1) + for i = 1, #files do + mp.commandv('loadfile', files[i], 'append') + mp.commandv('playlist-move', oldcount + i - 1, index + i - 1) + end +end + +function get_extension(path) + match = string.match(path, '%.([^%.]+)$') + if match == nil then + return 'nomatch' + else + return match + end +end + +table.filter = function(t, iter) + for i = #t, 1, -1 do if not iter(t[i]) then table.remove(t, i) end end +end + +-- splitbynum and alnumcomp from alphanum.lua (C) Andre Bogus +-- Released under the MIT License +-- http://www.davekoelle.com/files/alphanum.lua + +-- split a string into a table of number and string values +function splitbynum(s) + local result = {} + for x, y in (s or ''):gmatch('(%d*)(%D*)') do + if x ~= '' then table.insert(result, tonumber(x)) end + if y ~= '' then table.insert(result, y) end + end + return result +end + +function clean_key(k) + k = (' ' .. k .. ' '):gsub('%s+', ' '):sub(2, -2):lower() + return splitbynum(k) +end + +-- compare two strings +function alnumcomp(x, y) + local xt, yt = clean_key(x), clean_key(y) + for i = 1, math.min(#xt, #yt) do + local xe, ye = xt[i], yt[i] + if type(xe) == 'string' then + ye = tostring(ye) + elseif type(ye) == 'string' then + xe = tostring(xe) + end + if xe ~= ye then return xe < ye end + end + return #xt < #yt +end + +local autoloaded = nil + +function find_and_add_entries() + local path = mp.get_property('path', '') + local dir, filename = utils.split_path(path) + msg.trace(('dir: %s, filename: %s'):format(dir, filename)) + if o.disabled then + msg.verbose('stopping: autoload disabled') + return + elseif #dir == 0 then + msg.verbose('stopping: not a local path') + return + end + + local pl_count = mp.get_property_number('playlist-count', 1) + -- check if this is a manually made playlist + if (pl_count > 1 and autoloaded == nil) or + (pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == + nil) then + msg.verbose('stopping: manually made playlist') + return + else + autoloaded = true + end + + local pl = mp.get_property_native('playlist', {}) + local pl_current = mp.get_property_number('playlist-pos-1', 1) + msg.trace(('playlist-pos-1: %s, playlist: %s'):format(pl_current, + utils.to_string(pl))) + + local files = utils.readdir(dir, 'files') + if files == nil then + msg.verbose('no other files in directory') + return + end + table.filter(files, function(v, k) + -- The current file could be a hidden file, ignoring it doesn't load other + -- files from the current directory. + if (o.ignore_hidden and not (v == filename) and string.match(v, '^%.')) then + return false + end + local ext = get_extension(v) + if ext == nil then return false end + return EXTENSIONS[string.lower(ext)] + end) + table.sort(files, alnumcomp) + + if dir == '.' then dir = '' end + + -- Find the current pl entry (dir+"/"+filename) in the sorted dir list + local current + for i = 1, #files do + if files[i] == filename then + current = i + break + end + end + if current == nil then return end + msg.trace('current file position in files: ' .. current) + + local append = {[-1] = {}, [1] = {}} + for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1 + for i = 1, MAXENTRIES do + local file = files[current + i * direction] + local pl_e = pl[pl_current + i * direction] + if file == nil or file[1] == '.' then break end + + local filepath = dir .. file + if pl_e then + -- If there's a playlist entry, and it's the same file, stop. + msg.trace(pl_e.filename .. ' == ' .. filepath .. ' ?') + if pl_e.filename == filepath then break end + end + + if direction == -1 then + if pl_current == 1 then -- never add additional entries in the middle + msg.info('Prepending ' .. file) + table.insert(append[-1], 1, filepath) + end + else + msg.info('Adding ' .. file) + table.insert(append[1], filepath) + end + end + end + + add_files_at(pl_current + 1, append[1]) + add_files_at(pl_current, append[-1]) +end + +mp.register_event('start-file', find_and_add_entries) diff --git a/.config/mpv/scripts/mpv_chapters.js b/.config/mpv/scripts/mpv_chapters.js new file mode 100644 index 0000000..c89b8c3 --- /dev/null +++ b/.config/mpv/scripts/mpv_chapters.js @@ -0,0 +1,173 @@ +"use strict"; + +//display chapter on osd and easily switch between chapters by click on title of chapter +mp.register_event("file-loaded", init); +mp.observe_property("chapter", "number", onChapterChange); +mp.observe_property("chapter-list/count", "number", init); +var options = { + font_size: 16, + font_color: "00FFFF", + border_size: 1.0, + border_color: "000000", + font_color_currentChapter: "C27F1B", +}; +var playinfo = { + chapters: [], //array + chaptercount: "", // int + assinterface: [], //array(deprecated, use single assdraw instead) + currentChapter: "", //int + loaded:false, +}; +var toggle_switch = false; +var assdraw = mp.create_osd_overlay("ass-events"); +var autohidedelay = mp.get_property_number("cursor-autohide"); +//function +function init() { + playinfo.chapters = getChapters(); + playinfo.chaptercount = playinfo.chapters.length; + if(playinfo.chaptercount == 0){ + return; + } + while (playinfo.chaptercount * options.font_size > 1000 / 1.5) { + options.font_size = options.font_size - 1; + } + drawChapterList(); + mp.msg.info("initiated"); + playinfo.loaded = true; +} +function getChapters() { + var chapterCount = mp.get_property("chapter-list/count"); + if (chapterCount === 0) { + return ["null"]; + } else { + var chaptersArray = []; + for (var index = 0; index < chapterCount; index++) { + var chapterTitle = mp.get_property_native( + "chapter-list/" + index + "/title" + ); + + if (chapterTitle != undefined) { + chaptersArray.push(chapterTitle); + } + } + return chaptersArray; + } +} + +function drawChapterList() { + var resY = 0; + var resX = 0; + var assdrawdata = ""; + function setPos(str, _X, _Y) { + str = str + "{\\pos(" + _X + ", " + _Y + ")}"; + return str; + } + function setborderSize(str) { + str = str + "{\\bord" + options.border_size + "}"; + return str; + } + function setborderColor(str) { + str = str + "{\\3c&H" + options.border_color + "&}"; + return str; + } + function setFontColor(str, index) { + var _color; + if (playinfo.currentChapter == index) { + _color = options.font_color_currentChapter; + } else { + _color = options.font_color; + } + str = str + "{\\c&H" + _color + "&}"; + return str; + } + function setFont(str) { + str = str + "{\\fs" + options.font_size + "}"; + return str; + } + function setEndofmodifiers(str) { + str = str + "{\\p0}"; + return str; + } + function setEndofLine(str) { + str = str + "\n"; + return str; + } + playinfo.chapters.forEach(function (element, index) { + assdrawdata = setPos(assdrawdata, resX, resY); + assdrawdata = setborderSize(assdrawdata); + assdrawdata = setborderColor(assdrawdata); + assdrawdata = setFontColor(assdrawdata, index); + assdrawdata = setFont(assdrawdata); + assdrawdata = setEndofmodifiers(assdrawdata); + assdrawdata = assdrawdata + element; + assdrawdata = setEndofLine(assdrawdata); + resY += options.font_size; + }); + assdraw.data = assdrawdata + +} + +function toggleOverlay() { + if(!playinfo.loaded){ + return; + } + if (!toggle_switch) { + drawChapterList(); + assdraw.update(); + mp.set_property("cursor-autohide", "no"); + toggle_switch = !toggle_switch; + } else { + assdraw.remove(); + mp.set_property("cursor-autohide", autohidedelay); + toggle_switch = !toggle_switch; + } +} + +function onChapterChange() { + playinfo.currentChapter = mp.get_property_native("chapter"); + if (playinfo.currentChapter != undefined) { + drawChapterList(); + } + + if ((playinfo.currentChapter != undefined) & toggle_switch) { + assdraw.update(); + } +} +function pos2chapter(x, y, overallscale) { + var vectical = y / (options.font_size * overallscale); + if(vectical > playinfo.chaptercount){ + return null; + } + var intVectical = Math.floor(vectical); + var lengthofTitleClicked = playinfo.chapters[intVectical].length; + var lengthofTitleClicked_px = + (lengthofTitleClicked * options.font_size) / overallscale; + if (x < lengthofTitleClicked_px) { + return intVectical; + } else { + return null; + } +} +function getOverallScale() { + return mp.get_osd_size().height / 720; +} +function onMBTN_LEFT() { + //get mouse position + if(!playinfo.loaded){ + return; + } + if (toggle_switch) { + var overallscale = getOverallScale(); + var pos = mp.get_mouse_pos(); + var chapterClicked = pos2chapter(pos.x, pos.y, overallscale); + if (chapterClicked != null) { + mp.set_property_native("chapter", chapterClicked); + } + } +} +mp.add_key_binding("TAB", "tab", function () { + toggleOverlay(); +}); +mp.add_key_binding("MBTN_LEFT", "mbtn_left", function () { + onMBTN_LEFT(); +}); diff --git a/.config/mpv/scripts/sponsorblock.lua b/.config/mpv/scripts/sponsorblock.lua new file mode 100644 index 0000000..16999dc --- /dev/null +++ b/.config/mpv/scripts/sponsorblock.lua @@ -0,0 +1,597 @@ +-- sponsorblock.lua +-- +-- This script skips sponsored segments of YouTube videos +-- using data from https://github.com/ajayyy/SponsorBlock +local ON_WINDOWS = package.config:sub(1, 1) ~= '/' + +local options = { + server_address = 'https://sponsor.ajay.app', + + python_path = ON_WINDOWS and 'python' or 'python3', + + -- Categories to fetch + categories = 'sponsor,intro,outro,interaction,selfpromo', + + -- Categories to skip automatically + skip_categories = 'sponsor,intro,outro,interaction,selfpromo', + + -- If true, sponsored segments will only be skipped once + skip_once = true, + + -- Note that sponsored segments may ocasionally be inaccurate if this is turned off + -- see https://blog.ajay.app/voting-and-pseudo-randomness-or-sponsorblock-or-youtube-sponsorship-segment-blocker + local_database = false, + + -- Update database on first run, does nothing if local_database is false + auto_update = true, + + -- How long to wait between local database updates + -- Format: "X[d,h,m]", leave blank to update on every mpv run + auto_update_interval = '6h', + + -- User ID used to submit sponsored segments, leave blank for random + user_id = '', + + -- Name to display on the stats page https://sponsor.ajay.app/stats/ leave blank to keep current name + display_name = '', + + -- Tell the server when a skip happens + report_views = true, + + -- Auto upvote skipped sponsors + auto_upvote = false, + + -- Use sponsor times from server if they're more up to date than our local database + server_fallback = true, + + -- Create chapters at sponsor boundaries for OSC display and manual skipping + make_chapters = true, + + -- Minimum duration for sponsors (in seconds), segments under that threshold will be ignored + min_duration = 1, + + -- Fade audio for smoother transitions + audio_fade = false, + + -- Audio fade step, applied once every 100ms until cap is reached + audio_fade_step = 10, + + -- Audio fade cap + audio_fade_cap = 0, + + -- Fast forward through sponsors instead of skipping + fast_forward = false, + + -- Playback speed modifier when fast forwarding, applied once every second until cap is reached + fast_forward_increase = .2, + + -- Playback speed cap + fast_forward_cap = 2, + + -- Length of the sha256 prefix (3-32) when querying server, 0 to disable + sha256_length = 4, + + -- Pattern for video id in local files, ignored if blank + -- Recommended value for base youtube-dl is "-([%w-_]+)%.[mw][kpe][v4b]m?$" + local_pattern = '', + + -- Legacy option, use skip_categories instead + skip = true +} + +mp.options = require 'mp.options' +mp.options.read_options(options, 'sponsorblock') + +local legacy = mp.command_native_async == nil +if legacy then options.local_database = false end + +local utils = require 'mp.utils' +scripts_dir = mp.find_config_file('scripts') + +local sponsorblock = utils.join_path(scripts_dir, + 'sponsorblock_shared/sponsorblock.py') +local uid_path = utils.join_path(scripts_dir, + 'sponsorblock_shared/sponsorblock.txt') +local database_file = options.local_database and + utils.join_path(scripts_dir, + 'sponsorblock_shared/sponsorblock.db') or + '' +local youtube_id = nil +local ranges = {} +local init = false +local segment = {a = 0, b = 0, progress = 0, first = true} +local retrying = false +local last_skip = {uuid = '', dir = nil} +local speed_timer = nil +local fade_timer = nil +local fade_dir = nil +local volume_before = mp.get_property_number('volume') +local categories = {} +local all_categories = { + 'sponsor', 'intro', 'outro', 'interaction', 'selfpromo', 'music_offtopic' +} +local chapter_cache = {} + +for category in string.gmatch(options.skip_categories, '([^,]+)') do + categories[category] = true +end + +function file_exists(name) + local f = io.open(name, 'r') + if f ~= nil then + io.close(f) + return true + else + return false + end +end + +function t_count(t) + local count = 0 + for _ in pairs(t) do count = count + 1 end + return count +end + +function time_sort(a, b) + if a.time == b.time then return string.match(a.title, 'segment end') end + return a.time < b.time +end + +function parse_update_interval() + local s = options.auto_update_interval + if s == '' then return 0 end -- Interval Disabled + + local num, mod = s:match '^(%d+)([hdm])$' + + if num == nil or mod == nil then + mp.osd_message('[sponsorblock] auto_update_interval ' .. s .. ' is invalid', + 5) + return nil + end + + local time_table = {m = 60, h = 60 * 60, d = 60 * 60 * 24} + + return num * time_table[mod] +end + +function clean_chapters() + local chapters = mp.get_property_native('chapter-list') + local new_chapters = {} + for _, chapter in pairs(chapters) do + if chapter.title ~= 'Preview segment start' and chapter.title ~= + 'Preview segment end' then table.insert(new_chapters, chapter) end + end + mp.set_property_native('chapter-list', new_chapters) +end + +function create_chapter(chapter_title, chapter_time) + local chapters = mp.get_property_native('chapter-list') + local duration = mp.get_property_native('duration') + table.insert(chapters, { + title = chapter_title, + time = (duration == nil or duration > chapter_time) and chapter_time or + duration - .001 + }) + table.sort(chapters, time_sort) + mp.set_property_native('chapter-list', chapters) +end + +function process(uuid, t, new_ranges) + start_time = tonumber(string.match(t, '[^,]+')) + end_time = tonumber(string.sub(string.match(t, ',[^,]+'), 2)) + for o_uuid, o_t in pairs(ranges) do + if (start_time >= o_t.start_time and start_time <= o_t.end_time) or + (o_t.start_time >= start_time and o_t.start_time <= end_time) then + new_ranges[o_uuid] = o_t + return + end + end + category = string.match(t, '[^,]+$') + if categories[category] and end_time - start_time >= options.min_duration then + new_ranges[uuid] = { + start_time = start_time, + end_time = end_time, + category = category, + skipped = false + } + end + if options.make_chapters and not chapter_cache[uuid] then + chapter_cache[uuid] = true + local category_title = (category:gsub('^%l', string.upper):gsub('_', ' ')) + create_chapter(category_title .. ' segment start (' .. + string.sub(uuid, 1, 6) .. ')', start_time) + create_chapter( + category_title .. ' segment end (' .. string.sub(uuid, 1, 6) .. ')', + end_time) + end +end + +function getranges(_, exists, db, more) + if type(exists) == 'table' and exists['status'] == '1' then + if options.server_fallback then + mp.add_timeout(0, function() getranges(true, true, '') end) + else + return mp.osd_message('[sponsorblock] database update failed, gave up') + end + end + if db ~= '' and db ~= database_file then db = database_file end + if exists ~= true and not file_exists(db) then + if not retrying then + mp.osd_message('[sponsorblock] database update failed, retrying...') + retrying = true + end + return update() + end + if retrying then + mp.osd_message('[sponsorblock] database update succeeded') + retrying = false + end + local sponsors + local args = { + options.python_path, sponsorblock, 'ranges', db, options.server_address, + youtube_id, options.categories, tostring(options.sha256_length) + } + if not legacy then + sponsors = mp.command_native({ + name = 'subprocess', + capture_stdout = true, + playback_only = false, + args = args + }) + else + sponsors = utils.subprocess({args = args}) + end + mp.msg.debug('Got: ' .. string.gsub(sponsors.stdout, '[\n\r]', '')) + if not string.match(sponsors.stdout, '^%s*(.*%S)') then return end + if string.match(sponsors.stdout, 'error') then return getranges(true, true) end + local new_ranges = {} + local r_count = 0 + if more then r_count = -1 end + for t in string.gmatch(sponsors.stdout, '[^:%s]+') do + uuid = string.match(t, '([^,]+),[^,]+$') + if ranges[uuid] then + new_ranges[uuid] = ranges[uuid] + else + process(uuid, t, new_ranges) + end + r_count = r_count + 1 + end + local c_count = t_count(ranges) + if c_count == 0 or r_count >= c_count then ranges = new_ranges end +end + +function fast_forward() + if options.fast_forward and options.fast_forward == true then + speed_timer = nil + mp.set_property('speed', 1) + end + local last_speed = mp.get_property_number('speed') + local new_speed = math.min(last_speed + options.fast_forward_increase, + options.fast_forward_cap) + if new_speed <= last_speed then return end + mp.set_property('speed', new_speed) +end + +function fade_audio(step) + local last_volume = mp.get_property_number('volume') + local new_volume = math.max(options.audio_fade_cap, + math.min(last_volume + step, volume_before)) + if new_volume == last_volume then + if step >= 0 then fade_dir = nil end + if fade_timer ~= nil then fade_timer:kill() end + fade_timer = nil + return + end + mp.set_property('volume', new_volume) +end + +function skip_ads(name, pos) + if pos == nil then return end + local sponsor_ahead = false + for uuid, t in pairs(ranges) do + if (options.fast_forward == uuid or not options.skip_once or not t.skipped) and + t.start_time <= pos and t.end_time > pos then + if options.fast_forward == uuid then return end + if options.fast_forward == false then + mp.osd_message('[sponsorblock] ' .. t.category .. ' skipped') + mp.set_property('time-pos', t.end_time) + else + mp.osd_message('[sponsorblock] skipping ' .. t.category) + end + t.skipped = true + last_skip = {uuid = uuid, dir = nil} + if options.report_views or options.auto_upvote then + local args = { + options.python_path, sponsorblock, 'stats', database_file, + options.server_address, youtube_id, uuid, + options.report_views and '1' or '', uid_path, options.user_id, + options.auto_upvote and '1' or '' + } + if not legacy then + mp.command_native_async({ + name = 'subprocess', + playback_only = false, + args = args + }, function() end) + else + utils.subprocess_detached({args = args}) + end + end + if options.fast_forward ~= false then + options.fast_forward = uuid + if speed_timer ~= nil then speed_timer:kill() end + speed_timer = mp.add_periodic_timer(1, fast_forward) + end + return + elseif (not options.skip_once or not t.skipped) and t.start_time <= pos + 1 and + t.end_time > pos + 1 then + sponsor_ahead = true + end + end + if options.audio_fade then + if sponsor_ahead then + if fade_dir ~= false then + if fade_dir == nil then + volume_before = mp.get_property_number('volume') + end + if fade_timer ~= nil then fade_timer:kill() end + fade_dir = false + fade_timer = mp.add_periodic_timer(.1, function() + fade_audio(-options.audio_fade_step) + end) + end + elseif fade_dir == false then + fade_dir = true + if fade_timer ~= nil then fade_timer:kill() end + fade_timer = mp.add_periodic_timer(.1, function() + fade_audio(options.audio_fade_step) + end) + end + end + if options.fast_forward and options.fast_forward ~= true then + options.fast_forward = true + speed_timer:kill() + speed_timer = nil + mp.set_property('speed', 1) + end +end + +function vote(dir) + if last_skip.uuid == '' then + return mp.osd_message( + '[sponsorblock] no sponsors skipped, can\'t submit vote') + end + local updown = dir == '1' and 'up' or 'down' + if last_skip.dir == dir then + return mp.osd_message('[sponsorblock] ' .. updown .. + 'vote already submitted') + end + last_skip.dir = dir + local args = { + options.python_path, sponsorblock, 'stats', database_file, + options.server_address, youtube_id, last_skip.uuid, '', uid_path, + options.user_id, dir + } + if not legacy then + mp.command_native_async({ + name = 'subprocess', + playback_only = false, + args = args + }, function() end) + else + utils.subprocess({args = args}) + end + mp.osd_message('[sponsorblock] ' .. updown .. 'vote submitted') +end + +function update() + mp.command_native_async({ + name = 'subprocess', + playback_only = false, + args = { + options.python_path, sponsorblock, 'update', database_file, + options.server_address + } + }, getranges) +end + +function file_loaded() + local initialized = init + ranges = {} + segment = {a = 0, b = 0, progress = 0, first = true} + last_skip = {uuid = '', dir = nil} + chapter_cache = {} + local video_path = mp.get_property('path', '') + mp.msg.debug('Path: ' .. video_path) + local video_referer = string.match(mp.get_property('http-header-fields', ''), + 'Referer:([^,]+)') or '' + mp.msg.debug('Referer: ' .. video_referer) + + local urls = { + 'https?://youtu%.be/([%w-_]+).*', + 'https?://w?w?w?%.?youtube%.com/v/([%w-_]+).*', '/watch.*[?&]v=([%w-_]+).*', + '/embed/([%w-_]+).*' + } + youtube_id = nil + for i, url in ipairs(urls) do + youtube_id = youtube_id or string.match(video_path, url) or + string.match(video_referer, url) + end + youtube_id = youtube_id or string.match(video_path, options.local_pattern) + + if not youtube_id or string.len(youtube_id) < 11 or + (local_pattern and string.len(youtube_id) ~= 11) then return end + youtube_id = string.sub(youtube_id, 1, 11) + mp.msg.debug('Found YouTube ID: ' .. youtube_id) + init = true + if not options.local_database then + getranges(true, true) + else + local exists = file_exists(database_file) + if exists and options.server_fallback then + getranges(true, true) + mp.add_timeout(0, function() getranges(true, true, '', true) end) + elseif exists then + getranges(true, true) + elseif options.server_fallback then + mp.add_timeout(0, function() getranges(true, true, '') end) + end + end + if initialized then return end + if options.skip then mp.observe_property('time-pos', 'native', skip_ads) end + if options.display_name ~= '' then + local args = { + options.python_path, sponsorblock, 'username', database_file, + options.server_address, youtube_id, '', '', uid_path, options.user_id, + options.display_name + } + if not legacy then + mp.command_native_async({ + name = 'subprocess', + playback_only = false, + args = args + }, function() end) + else + utils.subprocess_detached({args = args}) + end + end + if not options.local_database or + (not options.auto_update and file_exists(database_file)) then return end + + if file_exists(database_file) then + local db_info = utils.file_info(database_file) + local cur_time = os.time(os.date('*t')) + local upd_interval = parse_update_interval() + if upd_interval == nil or os.difftime(cur_time, db_info.mtime) < + upd_interval then return end + end + + update() +end + +function set_segment() + if not youtube_id then return end + local pos = mp.get_property_number('time-pos') + if pos == nil then return end + if segment.progress > 1 then segment.progress = segment.progress - 2 end + if segment.progress == 1 then + segment.progress = 0 + segment.b = pos + mp.osd_message( + '[sponsorblock] segment boundary B set, press again for boundary A', 3) + else + segment.progress = 1 + segment.a = pos + mp.osd_message( + '[sponsorblock] segment boundary A set, press again for boundary B', 3) + end + if options.make_chapters and not segment.first then + local start_time = math.min(segment.a, segment.b) + local end_time = math.max(segment.a, segment.b) + if end_time - start_time ~= 0 and end_time ~= 0 then + clean_chapters() + create_chapter('Preview segment start', start_time) + create_chapter('Preview segment end', end_time) + end + end + segment.first = false +end + +function select_category(selected) + for category in string.gmatch(options.categories, '([^,]+)') do + mp.remove_key_binding('select_category_' .. category) + mp.remove_key_binding('kp_select_category_' .. category) + end + submit_segment(selected) +end + +function submit_segment(category) + if not youtube_id then return end + local start_time = math.min(segment.a, segment.b) + local end_time = math.max(segment.a, segment.b) + if end_time - start_time == 0 or end_time == 0 then + mp.osd_message('[sponsorblock] empty segment, not submitting') + elseif segment.progress <= 1 then + segment.progress = segment.progress + 2 + local category_list = '' + for category_id, category in pairs(all_categories) do + local category_title = (category:gsub('^%l', string.upper):gsub('_', ' ')) + category_list = category_list .. category_id .. ': ' .. category_title .. + '\n' + mp.add_forced_key_binding(tostring(category_id), + 'select_category_' .. category, + function() select_category(category) end) + mp.add_forced_key_binding('KP' .. tostring(category_id), + 'kp_select_category_' .. category, + function() select_category(category) end) + end + mp.osd_message(string.format( + '[sponsorblock] press a number to select category for segment: %.2d:%.2d:%.2d to %.2d:%.2d:%.2d\n\n' .. + category_list .. + '\nyou can press Shift+G again for default (Sponsor) or hide this message with g', + math.floor(start_time / (60 * 60)), + math.floor(start_time / 60 % 60), + math.floor(start_time % 60), + math.floor(end_time / (60 * 60)), + math.floor(end_time / 60 % 60), math.floor(end_time % 60)), + 30) + else + mp.osd_message('[sponsorblock] submitting segment...', 30) + local submit + local args = { + options.python_path, sponsorblock, 'submit', database_file, + options.server_address, youtube_id, tostring(start_time), + tostring(end_time), uid_path, options.user_id, category or 'sponsor' + } + if not legacy then + submit = mp.command_native({ + name = 'subprocess', + capture_stdout = true, + playback_only = false, + args = args + }) + else + submit = utils.subprocess({args = args}) + end + if string.match(submit.stdout, 'success') then + segment = {a = 0, b = 0, progress = 0, first = true} + mp.osd_message('[sponsorblock] segment submitted') + if options.make_chapters then + clean_chapters() + create_chapter('Submitted segment start', start_time) + create_chapter('Submitted segment end', end_time) + end + elseif string.match(submit.stdout, 'error') then + mp.osd_message( + '[sponsorblock] segment submission failed, server may be down. try again', + 5) + elseif string.match(submit.stdout, '502') then + mp.osd_message( + '[sponsorblock] segment submission failed, server is down. try again', + 5) + elseif string.match(submit.stdout, '400') then + mp.osd_message( + '[sponsorblock] segment submission failed, impossible inputs', 5) + segment = {a = 0, b = 0, progress = 0, first = true} + elseif string.match(submit.stdout, '429') then + mp.osd_message( + '[sponsorblock] segment submission failed, rate limited. try again', 5) + elseif string.match(submit.stdout, '409') then + mp.osd_message('[sponsorblock] segment already submitted', 3) + segment = {a = 0, b = 0, progress = 0, first = true} + else + mp.osd_message('[sponsorblock] segment submission failed', 5) + end + end +end + +mp.register_event('file-loaded', file_loaded) +mp.add_key_binding('g', 'set_segment', set_segment) +mp.add_key_binding('G', 'submit_segment', submit_segment) +mp.add_key_binding('h', 'upvote_segment', function() return vote('1') end) +mp.add_key_binding('H', 'downvote_segment', function() return vote('0') end) +-- Bindings below are for backwards compatibility and could be removed at any time +mp.add_key_binding(nil, 'sponsorblock_set_segment', set_segment) +mp.add_key_binding(nil, 'sponsorblock_submit_segment', submit_segment) +mp.add_key_binding(nil, 'sponsorblock_upvote', function() return vote('1') end) +mp.add_key_binding(nil, 'sponsorblock_downvote', function() return vote('0') end) diff --git a/.config/mpv/scripts/sponsorblock_shared/main.lua b/.config/mpv/scripts/sponsorblock_shared/main.lua new file mode 100644 index 0000000..2bbe7a2 --- /dev/null +++ b/.config/mpv/scripts/sponsorblock_shared/main.lua @@ -0,0 +1,3 @@ +-- This is a dummy main.lua +-- required for mpv 0.33 +-- do not delete \ No newline at end of file diff --git a/.config/mpv/scripts/sponsorblock_shared/sponsorblock.py b/.config/mpv/scripts/sponsorblock_shared/sponsorblock.py new file mode 100644 index 0000000..2fdf3d6 --- /dev/null +++ b/.config/mpv/scripts/sponsorblock_shared/sponsorblock.py @@ -0,0 +1,124 @@ +import urllib.request +import urllib.parse +import hashlib +import sqlite3 +import random +import string +import json +import sys +import os + +if sys.argv[1] in ["submit", "stats", "username"]: + if not sys.argv[8]: + if os.path.isfile(sys.argv[7]): + with open(sys.argv[7]) as f: + uid = f.read() + else: + uid = "".join(random.choices(string.ascii_letters + string.digits, k=36)) + with open(sys.argv[7], "w") as f: + f.write(uid) + else: + uid = sys.argv[8] + +opener = urllib.request.build_opener() +opener.addheaders = [("User-Agent", "mpv_sponsorblock/1.0 (https://github.com/po5/mpv_sponsorblock)")] +urllib.request.install_opener(opener) + +if sys.argv[1] == "ranges" and (not sys.argv[2] or not os.path.isfile(sys.argv[2])): + sha = None + if 3 <= int(sys.argv[6]) <= 32: + sha = hashlib.sha256(sys.argv[4].encode()).hexdigest()[:int(sys.argv[6])] + times = [] + try: + response = urllib.request.urlopen(sys.argv[3] + "/api/skipSegments" + ("/" + sha + "?" if sha else "?videoID=" + sys.argv[4] + "&") + urllib.parse.urlencode([("categories", json.dumps(sys.argv[5].split(",")))])) + segments = json.load(response) + for segment in segments: + if sha and sys.argv[4] != segment["videoID"]: + continue + if sha: + for s in segment["segments"]: + times.append(str(s["segment"][0]) + "," + str(s["segment"][1]) + "," + s["UUID"] + "," + s["category"]) + else: + times.append(str(segment["segment"][0]) + "," + str(segment["segment"][1]) + "," + segment["UUID"] + "," + segment["category"]) + print(":".join(times)) + except (TimeoutError, urllib.error.URLError) as e: + print("error") + except urllib.error.HTTPError as e: + if e.code == 404: + print("") + else: + print("error") +elif sys.argv[1] == "ranges": + conn = sqlite3.connect(sys.argv[2]) + conn.row_factory = sqlite3.Row + c = conn.cursor() + times = [] + for category in sys.argv[5].split(","): + c.execute("SELECT startTime, endTime, votes, UUID, category FROM sponsorTimes WHERE videoID = ? AND shadowHidden = 0 AND votes > -1 AND category = ?", (sys.argv[4], category)) + sponsors = c.fetchall() + best = list(sponsors) + dealtwith = [] + similar = [] + for sponsor_a in sponsors: + for sponsor_b in sponsors: + if sponsor_a is not sponsor_b and sponsor_a["startTime"] >= sponsor_b["startTime"] and sponsor_a["startTime"] <= sponsor_b["endTime"]: + similar.append([sponsor_a, sponsor_b]) + if sponsor_a in best: + best.remove(sponsor_a) + if sponsor_b in best: + best.remove(sponsor_b) + for sponsors_a in similar: + if sponsors_a in dealtwith: + continue + group = set(sponsors_a) + for sponsors_b in similar: + if sponsors_b[0] in group or sponsors_b[1] in group: + group.add(sponsors_b[0]) + group.add(sponsors_b[1]) + dealtwith.append(sponsors_b) + best.append(max(group, key=lambda x:x["votes"])) + for time in best: + times.append(str(time["startTime"]) + "," + str(time["endTime"]) + "," + time["UUID"] + "," + time["category"]) + print(":".join(times)) +elif sys.argv[1] == "update": + try: + urllib.request.urlretrieve(sys.argv[3] + "/database.db", sys.argv[2] + ".tmp") + os.replace(sys.argv[2] + ".tmp", sys.argv[2]) + except PermissionError: + print("database update failed, file currently in use", file=sys.stderr) + sys.exit(1) + except ConnectionResetError: + print("database update failed, connection reset", file=sys.stderr) + sys.exit(1) + except TimeoutError: + print("database update failed, timed out", file=sys.stderr) + sys.exit(1) + except urllib.error.URLError as e: + print("database update failed", file=sys.stderr) + print(e, file=sys.stderr) + + sys.exit(1) +elif sys.argv[1] == "submit": + try: + req = urllib.request.Request(sys.argv[3] + "/api/skipSegments", data=json.dumps({"videoID": sys.argv[4], "segments": [{"segment": [float(sys.argv[5]), float(sys.argv[6])], "category": sys.argv[9]}], "userID": uid}).encode(), headers={"Content-Type": "application/json"}) + response = urllib.request.urlopen(req) + print("success") + except urllib.error.HTTPError as e: + print(e.code) + except: + print("error") +elif sys.argv[1] == "stats": + try: + if sys.argv[6]: + urllib.request.urlopen(sys.argv[3] + "/api/viewedVideoSponsorTime?UUID=" + sys.argv[5]) + if sys.argv[9]: + urllib.request.urlopen(sys.argv[3] + "/api/voteOnSponsorTime?UUID=" + sys.argv[5] + "&userID=" + uid + "&type=" + sys.argv[9]) + except: + pass +elif sys.argv[1] == "username": + try: + data = urllib.parse.urlencode({"userID": uid, "userName": sys.argv[9]}).encode() + req = urllib.request.Request(sys.argv[3] + "/api/setUsername", data=data) + urllib.request.urlopen(req) + except: + pass diff --git a/.config/mpv/scripts/sponsorblock_shared/sponsorblock.txt b/.config/mpv/scripts/sponsorblock_shared/sponsorblock.txt new file mode 100644 index 0000000..04debc8 --- /dev/null +++ b/.config/mpv/scripts/sponsorblock_shared/sponsorblock.txt @@ -0,0 +1 @@ +VvdShPVADjWuTg9L44tkj5B1IqOS8Jfak5XX \ No newline at end of file diff --git a/.config/nvim b/.config/nvim new file mode 160000 index 0000000..b36dc41 --- /dev/null +++ b/.config/nvim @@ -0,0 +1 @@ +Subproject commit b36dc411e3a430e0c80561e60c463214351225a7 diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf new file mode 100644 index 0000000..204d8fe --- /dev/null +++ b/.config/picom/picom.conf @@ -0,0 +1,414 @@ +################################# +# Shadows # +################################# + + +# Enabled client-side shadows on windows. Note desktop windows +# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, +# unless explicitly requested using the wintypes option. +# +# shadow = false +shadow = false; + +# The blur radius for shadows, in pixels. (defaults to 12) +# shadow-radius = 12 +shadow-radius = 24; + +# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) +shadow-opacity = .86 + +# The left offset for shadows, in pixels. (defaults to -15) +shadow-offset-x = -15 +# shadow-offset-x = -7; + +# The top offset for shadows, in pixels. (defaults to -15) +shadow-offset-y = -15 +# shadow-offset-y = -7; + +# Red color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-red = 0 + +# Green color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-green = 0 + +# Blue color value of shadow (0.0 - 1.0, defaults to 0). +# shadow-blue = 0 + +# Hex string color value of shadow (#000000 - #FFFFFF, defaults to #000000). This option will override options set shadow-(red/green/blue) +# shadow-color = "#000000" + +# Specify a list of conditions of windows that should have no shadow. +# +# examples: +# shadow-exclude = "n:e:Notification"; +# +# shadow-exclude = [] +shadow-exclude = [ + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "_GTK_FRAME_EXTENTS@:c" +]; + +# Specify a list of conditions of windows that should have no shadow painted over, such as a dock window. +# clip-shadow-above = [] + +# Specify a X geometry that describes the region in which shadow should not +# be painted in, such as a dock window region. Use +# shadow-exclude-reg = "x10+0+0" +# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. +# +# shadow-exclude-reg = "" + +# Crop shadow of a window fully on a particular Xinerama screen to the screen. +# xinerama-shadow-crop = false + + +################################# +# Fading # +################################# + + +# Fade windows in/out when opening/closing and when opacity changes, +# unless no-fading-openclose is used. +# fading = false +fading = true; + +# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) +# fade-in-step = 0.028 +fade-in-step = 0.03; + +# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) +# fade-out-step = 0.03 +fade-out-step = 0.03; + +# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) +# fade-delta = 10 +fade-delta = 5 + +# Specify a list of conditions of windows that should not be faded. +# fade-exclude = [] + +# Do not fade on window open/close. +# no-fading-openclose = false + +# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. +# no-fading-destroyed-argb = false + + +################################# +# Transparency / Opacity # +################################# + + +# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) +# inactive-opacity = 1 +inactive-opacity = 0.5; + +# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) +# frame-opacity = 1.0 +# frame-opacity = 0.9; + +# Let inactive opacity set by -i override the '_NET_WM_WINDOW_OPACITY' values of windows. +# inactive-opacity-override = true +inactive-opacity-override = true; + +# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) +# active-opacity = 1.0 + +# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) +# inactive-dim = 0.0 + +# Specify a list of conditions of windows that should never be considered focused. +# focus-exclude = [] +focus-exclude = [ "class_g = 'Cairo-clock'" ]; + +# Use fixed inactive dim value, instead of adjusting according to window opacity. +# inactive-dim-fixed = 1.0 + +# Specify a list of opacity rules, in the format `PERCENT:PATTERN`, +# like `50:name *= "Firefox"`. picom-trans is recommended over this. +# Note we don't make any guarantee about possible conflicts with other +# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. +# example: +# opacity-rule = [ "80:class_g = 'URxvt'" ]; +# +# opacity-rule = [] + + +################################# +# Corners # +################################# + +# Sets the radius of rounded window corners. When > 0, the compositor will +# round the corners of windows. Does not interact well with +# `transparent-clipping`. +# corner-radius = 13 + +# Exclude conditions for rounded corners. +rounded-corners-exclude = [ +"window_type = 'dock'", + "window_type = 'desktop'" +]; + + +################################# +# Background-Blurring # +################################# + + +# Parameters for background blurring, see the *BLUR* section for more information. +blur-method = "dual_kawase" +blur-size = 12 +# +# blur-deviation = false +# +blur-strength = 5 + +# Blur background of semi-transparent / ARGB windows. +# Bad in performance, with driver-dependent behavior. +# The name of the switch may change without prior notifications. +# +blur-background = false + +# Blur background of windows when the window frame is not opaque. +# Implies: +# blur-background +# Bad in performance, with driver-dependent behavior. The name may change. +# +# blur-background-frame = false + + +# Use fixed blur strength rather than adjusting according to window opacity. +# blur-background-fixed = false + + +# Specify the blur convolution kernel, with the following format: +# example: +# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; +# +# blur-kern = "" +blur-kern = "3x3box"; + + +# Exclude conditions for background blur. +# blur-background-exclude = [] +blur-background-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" +]; + +################################# +# General Settings # +################################# + +# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. +# daemon = false + +# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. +# `xrender` is the default one. +# +backend = "glx" +# backend = "xrender"; + +# Enable/disable VSync. +# vsync = false +vsync = false; + +# Enable remote control via D-Bus. See the *D-BUS API* section below for more details. +# dbus = false + +# Try to detect WM windows (a non-override-redirect window with no +# child that has 'WM_STATE') and mark them as active. +# +# mark-wmwin-focused = false +mark-wmwin-focused = true; + +# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. +# mark-ovredir-focused = false +mark-ovredir-focused = true; + +# Try to detect windows with rounded corners and don't consider them +# shaped windows. The accuracy is not very high, unfortunately. +# +# detect-rounded-corners = false +detect-rounded-corners = true; + +# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers +# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows. +# +# detect-client-opacity = false +detect-client-opacity = true; + +# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, +# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, +# provided that the WM supports it. +# +# use-ewmh-active-win = false + +# Unredirect all windows if a full-screen opaque window is detected, +# to maximize performance for full-screen windows. Known to cause flickering +# when redirecting/unredirecting windows. +# +# unredir-if-possible = false + +# Delay before unredirecting the window, in milliseconds. Defaults to 0. +# unredir-if-possible-delay = 0 + +# Conditions of windows that shouldn't be considered full-screen for unredirecting screen. +# unredir-if-possible-exclude = [] + +# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows +# in the same group focused at the same time. +# +# detect-transient = false +detect-transient = true; + +# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same +# group focused at the same time. This usually means windows from the same application +# will be considered focused or unfocused at the same time. +# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too. +# +# detect-client-leader = false + +# Resize damaged region by a specific number of pixels. +# A positive value enlarges it while a negative one shrinks it. +# If the value is positive, those additional pixels will not be actually painted +# to screen, only used in blur calculation, and such. (Due to technical limitations, +# with use-damage, those pixels will still be incorrectly painted to screen.) +# Primarily used to fix the line corruption issues of blur, +# in which case you should use the blur radius value here +# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, +# with a 5x5 one you use `--resize-damage 2`, and so on). +# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. +# +# resize-damage = 1 + +# Specify a list of conditions of windows that should be painted with inverted color. +# Resource-hogging, and is not well tested. +# +# invert-color-include = [] + +# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. +# Might cause incorrect opacity when rendering transparent content (but never +# practically happened) and may not work with blur-background. +# My tests show a 15% performance boost. Recommended. +# +glx-no-stencil = true; + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, +# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). +# Recommended if it works. +# +# glx-no-rebind-pixmap = false + +# Disable the use of damage information. +# This cause the whole screen to be redrawn everytime, instead of the part of the screen +# has actually changed. Potentially degrades the performance, but might fix some artifacts. +# The opposing option is use-damage +# +# no-use-damage = false +use-damage = true; + +# Use X Sync fence to sync clients' draw calls, to make sure all draw +# calls are finished before picom starts drawing. Needed on nvidia-drivers +# with GLX backend for some users. +# +# xrender-sync-fence = false + +# GLX backend: Use specified GLSL fragment shader for rendering window contents. +# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` +# in the source tree for examples. +# +# glx-fshader-win = "" + +# Force all windows to be painted with blending. Useful if you +# have a glx-fshader-win that could turn opaque pixels transparent. +# +# force-win-blend = false + +# Do not use EWMH to detect fullscreen windows. +# Reverts to checking if a window is fullscreen based only on its size and coordinates. +# +# no-ewmh-fullscreen = false + +# Dimming bright windows so their brightness doesn't exceed this set value. +# Brightness of a window is estimated by averaging all pixels in the window, +# so this could comes with a performance hit. +# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0) +# +# max-brightness = 1.0 + +# Make transparent windows clip other windows like non-transparent windows do, +# instead of blending on top of them. +# +# transparent-clipping = false + +# Set the log level. Possible values are: +# "trace", "debug", "info", "warn", "error" +# in increasing level of importance. Case doesn't matter. +# If using the "TRACE" log level, it's better to log into a file +# using *--log-file*, since it can generate a huge stream of logs. +# +# log-level = "debug" +log-level = "warn"; + +# Set the log file. +# If *--log-file* is never specified, logs will be written to stderr. +# Otherwise, logs will to written to the given file, though some of the early +# logs might still be written to the stderr. +# When setting this option from the config file, it is recommended to use an absolute path. +# +# log-file = "/path/to/your/log/file" + +# Show all X errors (for debugging) +# show-all-xerrors = false + +# Write process ID to a file. +# write-pid-path = "/path/to/your/log/file" + +# Window type settings +# +# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: +# "unknown", "desktop", "dock", "toolbar", "menu", "utility", +# "splash", "dialog", "normal", "dropdown_menu", "popup_menu", +# "tooltip", "notification", "combo", and "dnd". +# +# Following per window-type options are available: :: +# +# fade, shadow::: +# Controls window-type-specific shadow and fade settings. +# +# opacity::: +# Controls default opacity of the window type. +# +# focus::: +# Controls whether the window of this type is to be always considered focused. +# (By default, all window types except "normal" and "dialog" has this on.) +# +# full-shadow::: +# Controls whether shadow is drawn under the parts of the window that you +# normally won't be able to see. Useful when the window has parts of it +# transparent, and you want shadows in those areas. +# +# clip-shadow-above::: +# Controls wether shadows that would have been drawn above the window should +# be clipped. Useful for dock windows that should have no shadow painted on top. +# +# redir-ignore::: +# Controls whether this type of windows should cause screen to become +# redirected again after been unredirected. If you have unredir-if-possible +# set, and doesn't want certain window to cause unnecessary screen redirection, +# you can set this to `true`. +# +wintypes: +{ + tooltip = { fade = true; shadow = true; opacity = 0.90; focus = true; full-shadow = false; }; + dock = { shadow = false; clip-shadow-above = true; } + dnd = { shadow = false; } + popup_menu = { opacity = 1.0; shadow=false } + dropdown_menu = { opacity = 1.0; shadow=false } +}; diff --git a/.config/qtile/config.py b/.config/qtile/config.py new file mode 100644 index 0000000..533a084 --- /dev/null +++ b/.config/qtile/config.py @@ -0,0 +1,19 @@ +from modules.groups import groups +from modules.keys import keys, mod +from modules.layouts import floating_layout, layouts +from modules.mouse import mouse +from modules.hooks import * +from modules.screens import screens + +dgroups_key_binder = None +dgroups_app_rules = [] # type: List +main = None # WARNING: this is deprecated and will be removed soon +follow_mouse_focus = True +bring_front_click = False +cursor_warp = False +auto_fullscreen = True +focus_on_window_activation = "urgent" +wmname = "LG3D" +widget_defaults = dict( + font="Cascadia Code", fontsize=16, padding=12, foreground="CEC8C6" +) diff --git a/.config/qtile/modules/groups.py b/.config/qtile/modules/groups.py new file mode 100644 index 0000000..e638bbe --- /dev/null +++ b/.config/qtile/modules/groups.py @@ -0,0 +1,52 @@ +from libqtile.config import Group, Key, Match, ScratchPad, DropDown +from libqtile.lazy import lazy + +from .keys import keys, mod + +groups = [Group(i) for i in "1234567890"] + +browsers = [Match(wm_class=["firefox", "Google-chrome"])] +file_managers = [Match(wm_class="Thunar")] +video_players = [Match(wm_class=["streamlink-twitch-gui", "mpv"])] +groups = [ + Group("1"), + Group("2", matches=[Match(wm_class="VirtualBox Manager")]), + Group("3", matches=[Match(wm_class="Thunderbird")]), + Group("4", matches=[Match(wm_class="st-256color")]), + Group("5", matches=file_managers), + Group("6", matches=[Match(wm_class="ModernDeck")]), + Group("7", matches=browsers), + Group("8", matches=video_players), + Group("9"), + Group("0", matches=[Match(wm_class="TelegramDesktop")]), +] +groups.append( + ScratchPad( + "scratchpad", + [ + # define a drop down terminal. + # it is placed in the upper third of screen by default. + DropDown("term", "st", opacity=1.0) + ], + ) +) + +symbols = "arstgmneio" + +for i, j in zip(groups, symbols): + keys.extend( + [ + Key( + [mod], + j, + lazy.group[i.name].toscreen(), + desc="Switch to group {}".format(i.name), + ), + Key( + [mod, "shift"], + j, + lazy.window.togroup(i.name, switch_group=True), + desc="Switch to & move focused window to group {}".format(i.name), + ), + ] + ) diff --git a/.config/qtile/modules/hooks.py b/.config/qtile/modules/hooks.py new file mode 100644 index 0000000..bbd9657 --- /dev/null +++ b/.config/qtile/modules/hooks.py @@ -0,0 +1,35 @@ +import subprocess +import os + +from libqtile import hook + + +@hook.subscribe.startup +def autostart(): + subprocess.call(["autostart.sh"]) + + +@hook.subscribe.client_managed +def show_window(window): + window.group.cmd_toscreen() + + +@hook.subscribe.client_killed +def toggle_previous_group_if_last_window_killed(window): + group = window.group + if len(group.info()['windows']) == 1: + group.screen.toggle_group() + + +@hook.subscribe.client_managed +@hook.subscribe.client_urgent_hint_changed +@hook.subscribe.client_killed +@hook.subscribe.setgroup +@hook.subscribe.group_window_add +@hook.subscribe.current_screen_change +@hook.subscribe.changegroup +def hook_response(*args, **kwargs): + file = os.path.expanduser('~/.cache/workspaces') + with open(file, 'a') as f: + print('workspace changed', file=f) + diff --git a/.config/qtile/modules/keys.py b/.config/qtile/modules/keys.py new file mode 100644 index 0000000..6daae8e --- /dev/null +++ b/.config/qtile/modules/keys.py @@ -0,0 +1,168 @@ +import os + +from libqtile.config import Key, KeyChord +from libqtile.lazy import lazy + +mod = "mod4" +terminal = "st" +# terminal = "xfce4-terminal" +home = os.path.expanduser + + +@lazy.function +def explore(qtile): + """ open the app attached to current workspace""" + + preffered_apps = { + "1": "default", + "2": "virtualbox", + "3": "thunderbird", + "4": "st", + "5": "thunar", + "6": "ModernDeck", + "7": "firefox", + "8": "streamlink-twitch-gui", + "9": "default", + "0": "telegram-desktop", + } + group = qtile.current_group.info()['name'] + command = preffered_apps[group] + if command == "default": + command = "rofi -show drun" + + qtile.cmd_spawn(f'notify-send -t 1000 "Launching {command}"') + qtile.cmd_spawn(command) + + + +keys = [ + # '`': 'grave', + # '-': 'minus', + # '=': 'equal', + # '[': 'bracketleft', + # ']': 'bracketright', + # '\\': 'backslash', + # ';': 'semicolon', + # '\'': 'quote', + # ',': 'comma', + # '.': 'dot', + Key([mod], "h", lazy.layout.left(), desc="Move focus to left"), + Key([mod], "l", lazy.layout.right(), desc="Move focus to right"), + Key([mod], "j", lazy.layout.down(), desc="Move focus down"), + Key([mod], "k", lazy.layout.up(), desc="Move focus up"), + Key([mod], "u", explore, desc="Open app related with current group"), + Key( + [mod], + "Tab", + lazy.screen.toggle_group(), + desc="Toggle back and forth between latest groups", + ), + Key([mod], "d", lazy.spawn("rofi -show combi"), desc="spawn rofi"), + # Move windows between left/right columns or move up/down in current + # stack. Moving out of range in Columns layout will create new column. + Key( + [mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left" + ), + Key( + [mod, "shift"], + "l", + lazy.layout.shuffle_right(), + desc="Move window to the right", + ), + Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"), + Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), + # Grow windows. If current window is on the edge of screen and direction + # will be to screen edge - window would shrink. + Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"), + Key( + [mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right" + ), + Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"), + Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), + # KeyChord([mod], "w", [ + # Key([mod], "g", lazy.layout.grow()), + # Key([mod], "s", lazy.layout.shrink()), + # Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"), + # Key([mod], "m", lazy.layout.maximize())], + # mode="Windows" + # ), + Key([mod], "f", lazy.window.toggle_fullscreen(), desc="Toggle fullscreen"), + Key([mod, "shift"], "f", lazy.window.toggle_floating(), desc="Toggle floating"), + # Toggle between split and unsplit sides of stack. + # Split = all windows displayed + # Unsplit = 1 window displayed, like Max layout, but still with + # multiple stack panes + Key( + [mod, "shift"], + "Return", + lazy.layout.toggle_split(), + desc="Toggle between split and unsplit sides of stack", + ), + Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"), + # Toggle between different layouts as defined below + Key([mod], "space", lazy.next_layout(), desc="Toggle between layouts"), + Key([mod, "shift"], "space", lazy.spawn("chlayout"), desc="Next keyboard layout."), + Key([mod], "comma", lazy.screen.prev_group(), desc="Move to the group on the left"), + Key( + [mod], "period", lazy.screen.next_group(), desc="Move to the group on the right" + ), + Key([mod], "q", lazy.window.kill(), desc="Kill focused window"), + Key([mod, "shift", "control"], "h", lazy.layout.swap_column_left()), + Key([mod, "shift", "control"], "l", lazy.layout.swap_column_right()), + # Key([mod, "shift"], "space", lazy.layout.flip()), + Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"), + Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), + Key([mod, "control"], "n", lazy.spawn("lock-screen"), desc="Lock screen"), + Key( + [mod, "control"], + "s", + lazy.spawn("toggle-screenkey"), + desc="Show keys on screen", + ), + Key( + [mod, "shift"], + "d", + lazy.spawncmd(), + desc="Spawn a command using a prompt widget", + ), + Key([mod], "p", lazy.spawn("passmenu"), desc="Spawn passmenu"), + # Key([mod, "shift"], "e", lazy.spawn("menu_powermenu"), desc="Spawn powermenu using rofi"), + # Key([mod], "n", lazy.spawn(home("~/Desktop/GitRepositories/networkmanager-dmenu/networkmanager_dmenu")), desc="Launch network manager"), + # Key([mod], "i", lazy.spawn("sxiv " + home("~/Pictures/keyboard-layout.jpg")), desc="Show current keyboard layout"), + Key([mod], "b", lazy.spawn("rofi-bluetooth"), desc="Manage bluetooth devices"), + Key( + [mod], + "v", + lazy.spawn("rofi-wireguard --toggle"), + desc="Manage VPN connections", + ), + # Key([mod], "x", lazy.spawn(home("~/scripts/kill-process.sh")), + # desc="Kill processes using rofi"), + # == audio + Key( + [], + "XF86AudioRaiseVolume", + lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%"), + ), + Key( + [], + "XF86AudioLowerVolume", + lazy.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%"), + ), + Key([], "XF86AudioMute", lazy.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")), + Key( + [], + "XF86AudioMicMute", + lazy.spawn("pactl set-source-mute @DEFAULT_SOURCE@ toggle"), + ), + # == backlight + Key([], "XF86MonBrightnessUp", lazy.spawn("light -A 5")), + Key([], "XF86MonBrightnessDown", lazy.spawn("light -U 5")), + Key([], "Print", lazy.spawn("flameshot gui")), + Key(["shift"], "Print", lazy.spawn("flameshot full")), + Key(["control"], "Print", lazy.spawn("flameshot full")), + Key([], "F12", lazy.group["scratchpad"].dropdown_toggle("term")), + Key([], "XF86KbdBrightnessUp", lazy.spawn("keyboard_backlight.sh inc")), + Key([], "XF86KbdBrightnessDown", lazy.spawn("keyboard_backlight.sh dec")), + Key([], "XF86TouchpadToggle", lazy.spawn("toggle-touchpad.sh")), +] diff --git a/.config/qtile/modules/layouts.py b/.config/qtile/modules/layouts.py new file mode 100644 index 0000000..f9efdd0 --- /dev/null +++ b/.config/qtile/modules/layouts.py @@ -0,0 +1,42 @@ +from libqtile import layout +from libqtile.config import Match + +# default = { +# "border_width": 2, +# "margin": 8, +# "border_focus": "#5294e2", +# "border_normal": "#2c5380"} +layouts = [ + # layout.MonadTall(margin=8, border_focus='#5294e2', + # border_normal='#2c5380'), + layout.Columns(margin=8, border_focus_stack="#d75f5f"), + layout.Max(), + # Try more layouts by unleashing below layouts. + # layout.Stack(num_stacks=2), + # layout.Bsp(), + # layout.Matrix(), + # layout.MonadTall(), + # layout.MonadWide(), + # layout.RatioTile(), + # layout.Tile(), + # layout.TreeTab(), + # layout.VerticalTile(), + # layout.Zoomy(), +] + +floating_layout = layout.Floating( + float_rules=[ + # Run the utility of `xprop` to see the wm class and name of an X client. + *layout.Floating.default_float_rules, + Match(wm_class="confirmreset"), # gitk + Match(wm_class="makebranch"), # gitk + Match(wm_class="maketag"), # gitk + Match(wm_class="ssh-askpass"), # ssh-askpass + Match(wm_class="sxiv"), + Match(wm_class="telegram-desktop"), + Match(wm_class="streamlink-twitch-gui"), + Match(wm_class="pinentry-gtk-2"), + Match(title="branchdialog"), # gitk + Match(title="pinentry"), # GPG key password entry + ] +) diff --git a/.config/qtile/modules/mouse.py b/.config/qtile/modules/mouse.py new file mode 100644 index 0000000..b3360b3 --- /dev/null +++ b/.config/qtile/modules/mouse.py @@ -0,0 +1,17 @@ +from libqtile.config import Click, Drag +from libqtile.lazy import lazy +from .keys import mod + +# Drag floating layouts. +mouse = [ + Drag( + [mod], + "Button1", + lazy.window.set_position_floating(), + start=lazy.window.get_position(), + ), + Drag( + [mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size() + ), + Click([mod], "Button2", lazy.window.bring_to_front()), +] diff --git a/.config/qtile/modules/screens.py b/.config/qtile/modules/screens.py new file mode 100644 index 0000000..cd3b860 --- /dev/null +++ b/.config/qtile/modules/screens.py @@ -0,0 +1,3 @@ +from libqtile.config import Screen + +screens = [Screen()] diff --git a/.config/qtile/scripts/Default.sh b/.config/qtile/scripts/Default.sh new file mode 100755 index 0000000..152cb7a --- /dev/null +++ b/.config/qtile/scripts/Default.sh @@ -0,0 +1,308 @@ +#!/usr/bin/env bash + +## Copyright (C) 2020-2021 Aditya Shakya +## Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 + +## Dirs ############################################# +qtile_path="$HOME/.config/qtile" +polybar_path="$HOME/.config/qtile/polybar" +rofi_path="$HOME/.config/qtile/rofi" +terminal_path="$HOME/.config/alacritty" +xfce_term_path="$HOME/.config/xfce4/terminal" +geany_path="$HOME/.config/geany" +dunst_path="$HOME/.config/dunst" + +# wallpaper --------------------------------- +set_wallpaper() { + nitrogen --save --set-zoom-fill /usr/share/backgrounds/"$1" +} + +# polybar ----------------------------------- +change_polybar() { + sed -i -e "s/STYLE=.*/STYLE=\"$1\"/g" ${polybar_path}/launch.sh + sed -i -e "s/font-0 = .*/font-0 = \"$2\"/g" ${polybar_path}/"$1"/config.ini +} + +# rofi -------------------------------------- +change_rofi() { + sed -i -e "s/STYLE=.*/STYLE=\"$1\"/g" ${rofi_path}/bin/music ${rofi_path}/bin/network ${rofi_path}/bin/screenshot ${rofi_path}/bin/runner + sed -i -e "s/DIR=.*/DIR=\"$1\"/g" ${rofi_path}/bin/launcher ${rofi_path}/bin/powermenu + sed -i -e 's/STYLE=.*/STYLE="launcher"/g' ${rofi_path}/bin/launcher + sed -i -e 's/STYLE=.*/STYLE="powermenu"/g' ${rofi_path}/bin/powermenu + sed -i -e "s/font:.*/font: \"$2\";/g" ${rofi_path}/"$1"/font.rasi + + sed -i -e "s/font:.*/font: \"$2\";/g" ${rofi_path}/dialogs/askpass.rasi ${rofi_path}/dialogs/confirm.rasi + sed -i -e "s/border:.*/border: $3;/g" ${rofi_path}/dialogs/askpass.rasi ${rofi_path}/dialogs/confirm.rasi + sed -i -e "s/border-radius:.*/border-radius: $4;/g" ${rofi_path}/dialogs/askpass.rasi ${rofi_path}/dialogs/confirm.rasi + + if [[ -f "$HOME"/.config/rofi/config.rasi ]]; then + sed -i -e "s/icon-theme:.*/icon-theme: \"$5\";/g" "$HOME"/.config/rofi/config.rasi + fi + + cat > ${rofi_path}/dialogs/colors.rasi <<- _EOF_ + /* Color-Scheme */ + + * { + BG: #282C33ff; + FG: #D8D8D8ff; + BDR: #62AEEFff; + } + _EOF_ +} + +# network manager --------------------------- +change_nm() { + sed -i -e "s#dmenu_command = .*#dmenu_command = rofi -dmenu -theme ~/.config/qtile/rofi/$1/networkmenu.rasi#g" "$HOME"/.config/networkmanager-dmenu/config.ini +} + +# terminal ---------------------------------- +change_terminal() { + sed -i -e "s/family: .*/family: \"$1\"/g" ${terminal_path}/fonts.yml + sed -i -e "s/size: .*/size: $2/g" ${terminal_path}/fonts.yml + + cat > ${terminal_path}/colors.yml <<- _EOF_ + ## Colors configuration + colors: + # Default colors + primary: + background: '#1E2128' + foreground: '#ABB2BF' + + # Normal colors + normal: + black: '#32363D' + red: '#E06B74' + green: '#98C379' + yellow: '#E5C07A' + blue: '#62AEEF' + magenta: '#C778DD' + cyan: '#55B6C2' + white: '#ABB2BF' + + # Bright colors + bright: + black: '#50545B' + red: '#EA757E' + green: '#A2CD83' + yellow: '#EFCA84' + blue: '#6CB8F9' + magenta: '#D282E7' + cyan: '#5FC0CC' + white: '#B5BCC9' + _EOF_ +} + +# xfce terminal ----------------------------- +change_xfce_terminal() { + sed -i -e "s/FontName=.*/FontName=$1/g" ${xfce_term_path}/terminalrc + sed -i -e 's/ColorForeground=.*/ColorForeground=#ababb2b2bfbf/g' ${xfce_term_path}/terminalrc + sed -i -e 's/ColorBackground=.*/ColorBackground=#1e1e21212828/g' ${xfce_term_path}/terminalrc + sed -i -e 's/ColorCursor=.*/ColorCursor=#ababb2b2bfbf/g' ${xfce_term_path}/terminalrc + sed -i -e 's/ColorPalette=.*/ColorPalette=#323236363d3d;#e0e06b6b7474;#9898c3c37979;#e5e5c0c07a7a;#6262aeaeefef;#c7c77878dddd;#5555b6b6c2c2;#ababb2b2bfbf;#505054545b5b;#eaea75757e7e;#a2a2cdcd8383;#efefcaca8484;#6c6cb8b8f9f9;#d2d28282e7e7;#5f5fc0c0cccc;#b5b5bcbcc9c9/g' ${xfce_term_path}/terminalrc +} + +# geany ------------------------------------- +change_geany() { + sed -i -e "s/color_scheme=.*/color_scheme=$1.conf/g" ${geany_path}/geany.conf + sed -i -e "s/editor_font=.*/editor_font=$2/g" ${geany_path}/geany.conf +} + +# gtk theme, icons and fonts ---------------- +change_appearance() { + xfconf-query -c xsettings -p /Net/ThemeName -s "$1" + xfconf-query -c xsettings -p /Net/IconThemeName -s "$2" + xfconf-query -c xsettings -p /Gtk/CursorThemeName -s "$3" + xfconf-query -c xsettings -p /Gtk/FontName -s "$4" + + if [[ -f "$HOME"/.icons/default/index.theme ]]; then + sed -i -e "s/Inherits=.*/Inherits=$3/g" "$HOME"/.icons/default/index.theme + fi +} + +# qtile ----------------------------------- +obconfig () { + namespace="http://qtile.org/3.4/rc" + config="$qtile_path/rc.xml" + theme="$1" + layout="$2" + font="$3" + fontsize="$4" + + # Theme + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:name' -v "$theme" "$config" + + # Title + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:titleLayout' -v "$layout" "$config" + + # Fonts + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveWindow"]/a:name' -v "$font" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveWindow"]/a:size' -v "$fontsize" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveWindow"]/a:weight' -v Bold "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' -v Normal "$config" + + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveWindow"]/a:name' -v "$font" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveWindow"]/a:size' -v "$fontsize" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveWindow"]/a:weight' -v Normal "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveWindow"]/a:slant' -v Normal "$config" + + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuHeader"]/a:name' -v "$font" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuHeader"]/a:size' -v "$fontsize" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuHeader"]/a:weight' -v Bold "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuHeader"]/a:slant' -v Normal "$config" + + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuItem"]/a:name' -v "$font" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuItem"]/a:size' -v "$fontsize" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuItem"]/a:weight' -v Normal "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="MenuItem"]/a:slant' -v Normal "$config" + + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveOnScreenDisplay"]/a:name' -v "$font" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveOnScreenDisplay"]/a:size' -v "$fontsize" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveOnScreenDisplay"]/a:weight' -v Bold "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="ActiveOnScreenDisplay"]/a:slant' -v Normal "$config" + + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveOnScreenDisplay"]/a:name' -v "$font" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveOnScreenDisplay"]/a:size' -v "$fontsize" "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveOnScreenDisplay"]/a:weight' -v Normal "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:theme/a:font[@place="InactiveOnScreenDisplay"]/a:slant' -v Normal "$config" + + # qtile Menu Style + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:menu/a:file' -v "$5" "$config" + + # Margins + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:margins/a:top' -v 0 "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:margins/a:bottom' -v 10 "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:margins/a:left' -v 10 "$config" + xmlstarlet ed -L -N a="$namespace" -u '/a:qtile_config/a:margins/a:right' -v 10 "$config" +} + +# dunst ------------------------------------- +change_dunst() { + sed -i -e "s/geometry = .*/geometry = \"$1\"/g" ${dunst_path}/dunstrc + sed -i -e "s/font = .*/font = $2/g" ${dunst_path}/dunstrc + sed -i -e "s/frame_width = .*/frame_width = $3/g" ${dunst_path}/dunstrc + + sed -i '/urgency_low/Q' ${dunst_path}/dunstrc + cat >> ${dunst_path}/dunstrc <<- _EOF_ + [urgency_low] + timeout = 2 + background = "#282C33" + foreground = "#D8D8D8" + frame_color = "#30343B" + + [urgency_normal] + timeout = 5 + background = "#282C33" + foreground = "#D8D8D8" + frame_color = "#30343B" + + [urgency_critical] + timeout = 0 + background = "#282C33" + foreground = "#E06B74" + frame_color = "#30343B" + _EOF_ + + pkill dunst && dunst & +} + +# Plank ------------------------------------- +change_dock() { + cat > "$HOME"/.cache/plank.conf <<- _EOF_ + [dock1] + alignment='center' + auto-pinning=true + current-workspace-only=false + dock-items=['xfce-settings-manager.dockitem', 'Alacritty.dockitem', 'thunar.dockitem', 'firefox.dockitem', 'geany.dockitem'] + hide-delay=0 + hide-mode='intelligent' + icon-size=32 + items-alignment='center' + lock-items=false + monitor='' + offset=0 + pinned-only=false + position='bottom' + pressure-reveal=false + show-dock-item=false + theme='Transparent' + tooltips-enabled=true + unhide-delay=0 + zoom-enabled=true + zoom-percent=120 + _EOF_ +} + +# compositor -------------------------------- +compositor() { + comp_file="$HOME/.config/picom.conf" + + backend="$1" + cradius="$2" + shadow_r="$(echo $3 | cut -d' ' -f1)" + shadow_o="$(echo $3 | cut -d' ' -f2)" + shadow_x="$(echo $3 | cut -d' ' -f3)" + shadow_y="$(echo $3 | cut -d' ' -f4)" + method="$(echo $4 | cut -d' ' -f1)" + strength="$(echo $4 | cut -d' ' -f2)" + + # Rounded Corners + sed -i -e "s/backend = .*/backend = \"$backend\";/g" ${comp_file} + sed -i -e "s/corner-radius = .*/corner-radius = $cradius;/g" ${comp_file} + + # Shadows + sed -i -e "s/shadow-radius = .*/shadow-radius = $shadow_r;/g" ${comp_file} + sed -i -e "s/shadow-opacity = .*/shadow-opacity = $shadow_o;/g" ${comp_file} + sed -i -e "s/shadow-offset-x = .*/shadow-offset-x = $shadow_x;/g" ${comp_file} + sed -i -e "s/shadow-offset-y = .*/shadow-offset-y = $shadow_y;/g" ${comp_file} + + # Blur + sed -i -e "s/backend = .*/backend = \"$backend\";/g" ${comp_file} + sed -i -e "s/method = .*/method = \"$method\";/g" ${comp_file} + sed -i -e "s/strength = .*/strength = $strength;/g" ${comp_file} +} + +# notify ------------------------------------ +notify_user() { + local style=`basename $0` + dunstify -u normal --replace=699 -i /usr/share/archcraft/icons/dunst/themes.png "Applying Style : ${style%.*}" +} + +## Execute Script --------------------------- +notify_user + +# funct WALLPAPER +set_wallpaper 'default.jpg' + +# funct STYLE FONT +change_polybar 'default' 'JetBrains Mono:size=10;3' && "$polybar_path"/launch.sh +"$polybar_path"/launch.sh + +# funct STYLE FONT BORDER BORDER-RADIUS ICON (Change colors in funct) +change_rofi 'default' 'Iosevka 10' '0px 0px 2px 0px' '8px' 'Zafiro' + +# funct STYLE (network manager applet) +change_nm 'default' + +# funct FONT SIZE (Change colors in funct) +change_terminal 'JetBrainsMono Nerd Font' '10' + +# funct FONT (Change colors in funct) +change_xfce_terminal 'JetBrainsMono Nerd Font 10' + +# funct SCHEME FONT +change_geany 'arc' 'JetBrains Mono 10' + +# funct THEME ICON CURSOR FONT +change_appearance 'Arc-Dark' 'Zafiro' 'Qogirr' 'Noto Sans 9' + +# funct THEME LAYOUT FONT SIZE (Change margin in funct) +# obconfig 'Arc-Dark' 'DLIMC' 'JetBrains Mono' '9' 'menu-icons.xml' && qtile --reconfigure + +# funct GEOMETRY FONT BORDER (Change colors in funct) +change_dunst '280x50-10+48' 'JetBrains Mono 10' '6' + +# Paste settings in funct (PLANK) +change_dock && cat "$HOME"/.cache/plank.conf | dconf load /net/launchpad/plank/docks/ + +# Change compositor settings +#compositor 'glx' '6' '14 0.30 -12 -12' 'none 0' diff --git a/.config/tmux/plugins/tpm b/.config/tmux/plugins/tpm new file mode 160000 index 0000000..b699a7e --- /dev/null +++ b/.config/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit b699a7e01c253ffb7818b02d62bce24190ec1019 diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..b839d89 --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,188 @@ +# remap prefix to Control + Space +set -g prefix C-Space +bind C-Space send-prefix +unbind C-b + + +# Smart pane switching with awareness of Vim splits. +# See: https://github.com/christoomey/vim-tmux-navigator +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" +bind-key -n 'C-h' if-shell "$is_vim" { send-keys C-h } { if -F '#{pane_at_left}' { select-pane -L } { select-pane -L } +} +bind-key -n 'C-j' if-shell "$is_vim" { send-keys C-j } { if -F '#{pane_at_bottom}' { select-pane -D } { select-pane -D } +} +bind-key -n 'C-k' if-shell "$is_vim" { send-keys C-k } { if -F '#{pane_at_top}' { select-pane -U } { select-pane -U } +} +bind-key -n 'C-l' if-shell "$is_vim" { send-keys C-l } { if -F '#{pane_at_right}' { select-pane -R } { select-pane -R } } +tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' +if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'" +if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \ + "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'" + +bind-key -n C-] copy-mode +bind-key -n 'C-M-c' copy-mode +bind-key C-] copy-mode + +bind-key -n C-_ run-shell '/bin/bash ~/scripts/search-notes.sh' + +bind-key -T copy-mode-vi 'C-h' select-pane -L +bind-key -T copy-mode-vi 'C-j' select-pane -D +bind-key -T copy-mode-vi 'C-k' select-pane -U +bind-key -T copy-mode-vi 'C-l' select-pane -R + +# vim like copy mode +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi r send-keys -X rectangle-toggle + +setw -g mode-keys vi + +# Mouse support - set to on if you want to use the mouse +setw -g mouse on + + +# source the .tmux.conf file with prefix + r +bind r source-file ~/.config/tmux/tmux.conf \; display "Configuration Reloaded!" + +bind-key - split-window -v +bind-key '\' split-window -h +bind-key _ split-window -fv +bind-key | split-window -fh + +bind -r h resize-pane -L 5 +bind -r j resize-pane -D 5 +bind -r k resize-pane -U 5 +bind -r l resize-pane -R 5 + + +# set -g lock-after-time 300 +# set -g lock-command "asciiquarium" + +# bind-key "'" choose-window +# bind-key '"' choose-session +# kill current pane/window +# bind-key -n q confirm-before kill-pane +# bind-key Q confirm-before kill-window +bind-key -n C-q confirm-before kill-pane +# bind-key -n C-w confirm-before kill-window + +# no prefix, just c-x +bind C-x setw synchronize-panes + +# reorder windows +bind-key -n C-S-Left swap-window -t -1\; select-window -t -1 +bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 +bind-key -n C-Up swap-pane -s '{up-of}' +bind-key -n C-Down swap-pane -s '{down-of}' +bind-key -n C-Left swap-pane -s '{left-of}' +bind-key -n C-Right swap-pane -s '{right-of}' + +set -g default-terminal "tmux-256color" +# tell Tmux that outside terminal supports true color +set -ga terminal-overrides ",xterm-256color*:Tc" + +# start session number from 1 rather than 0 +# set -g base-index 1 + +# start pane number from 1 similar to windows +# setw -g pane-base-index 1 + + +# highlight active pane +# set -g window-style 'fg=colour247,bg=colour236' +# set -g window-active-style 'fg=colour250,bg=black' +# set-option -g pane-active-border-style fg=red + +# use C-l to clear screen +bind C-l send-keys 'C-l' + +# use Enter for zooming the current pane +bind-key Enter if-shell "$is_vim" { + resize-pane -Z + send-keys C-w = +} { + resize-pane -Z + } + +bind-key i run-shell "tmux neww ~/scripts/cheat.sh" + + + +# use C-j for join pane +bind-key C-j join-pane + + +# status bar theme +set -g status 'on' +# set -g status-bg 'colour235' +set -g status-justify 'centre' +set -g status-style 'none' +set -g status-left-style 'none' +set -g status-left-length '20' +set -g status-right-style 'none' +set -g status-right-length '100' +set -g message-command-style fg='colour222',bg='colour238' +set -g message-style bg='colour238',fg='colour222' +set -g pane-active-border-style fg='colour154' +set -g pane-border-style fg='colour238' +setw -g window-status-style fg='colour121',bg='colour235','none' +setw -g window-status-activity-style bg='colour235',fg='colour154','none' +setw -g window-status-separator '' +set-option -g status-style bg=default +set -g status-left '#[fg=colour232,bg=colour37] #S #[fg=colour37,bg=colour73,nobold,nounderscore,noitalics]#[fg=colour232,bg=colour73] #W #[fg=colour73,bg=default,nobold,nounderscore,noitalics] ' +# above status + whoami and uptime +# set -g status-left '#[fg=colour232,bg=colour154] #S #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #W #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] #(whoami)  #(uptime | cut -d " " -f 1,2,3) #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]' +setw -g window-status-current-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=default,bg=colour235,bold,underscore]#I  #W  #F#[fg=colour235,bg=default,nobold,nounderscore,noitalics]' +setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour150,bg=default]#I  #W#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]' +set -g status-right '#[fg=colour235,bg=default,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235]%R  %a  %h-%d #[fg=colour37,bg=colour235,nobold,nounderscore,noitalics] #{prefix_highlight}' + + +set -g status-interval 1 + +set-option -g automatic-rename on +set-option -g automatic-rename-format '#{b:pane_current_path}' + +# Plugin Customizations + +set -g @prefix_highlight_fg 'colour0' +set -g @prefix_highlight_bg 'colour37' +set -g @prefix_highlight_sync_mode_attr 'fg=colour0,bg=colour36' +set -g @prefix_highlight_copy_mode_attr 'fg=colour0,bg=colour33' +set -g @prefix_highlight_show_copy_mode 'on' +set -g @prefix_highlight_show_sync_mode 'on' +set -g @prefix_highlight_sync_prompt 'SYNC' + +set -g @resurrect-strategy-vim 'session' +set -g @batt_icon_status_charging '⚡' +set -g @yank_selection_mouse 'clipboard' # or 'primary' or 'secondary' +set -g @yank_action 'copy-pipe' # or 'copy-pipe-and-cancel' for the default +set -g @copycat_hash_search 'C-h' +set -g @copycat_ip_search 'M-i' +set -g @copytk-copy-command "xsel --clipboard" +set -g @menus_trigger 't' + +# set -g @pomodoro_start 'a' # Start a Pomodoro with tmux-prefix + p +# set -g @pomodoro_cancel 'A' # Cancel a Pomodoro with tmux-prefix key + P +# set -g @pomodoro_on " #[fg=$text_red]🍅 " # The formatted output when the pomodoro is running +# set -g @pomodoro_complete " #[fg=$text_green]🍅 " # The formatted output when the break is running + +# set -g @continuum-boot 'on' +# set -g @continuum-restore 'on' + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @plugin 'tmux-plugins/tmux-open' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-copycat' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tmux-cowboy' +set -g @plugin 'jaclu/tmux-menus' +set -g @plugin 'laktak/extrakto' +set -g @plugin 'CrispyConductor/tmux-copy-toolkit' +# set -g @plugin 'olimorris/tmux-pomodoro-plus' +run '~/.config/tmux/plugins/tpm/tpm' + diff --git a/.config/tridactyl/tridactylrc b/.config/tridactyl/tridactylrc new file mode 100644 index 0000000..f7038e9 --- /dev/null +++ b/.config/tridactyl/tridactylrc @@ -0,0 +1,47 @@ +" General Settings +set update.lastchecktime 1648676458956 +set configversion 2.0 +set smoothscroll true + +" Binds +bind j scrollline 5 +bind h back +bind l forward +bind H tabprev +bind L tabnext +bind J scrollpx -50 +bind K scrollpx 50 +bind q back +bind Q forward +bindurl github.com gp open github.com/Asocia +bindurl github.com gc composite git_clone | clipboard yank +bindurl github.com gC composite git_clone_ssh | clipboard yank +bindurl github.com yr composite js "\"" + document.location.href.split('#')[0].split('/').slice(3, 5).join('/') + "\"" | clipboard yank +bindurl gitlab.com gp open gitlab.com/Asocia +bindurl gitlab.com gc composite git_clone | clipboard yank +bindurl gitlab.com gC composite git_clone_ssh | clipboard yank +bindurl gitlab.com yr composite js "\"" + document.location.href.split('#')[0].split('/').slice(3, 5).join('/') + "\"" | clipboard yank +bindurl reddit.com gp open reddit.com/user/Asocia +bindurl stackoverflow.com gp open stackoverflow.com/users/9608759/asocia +bindurl youtube.com p composite get_current_url | mpvsafe +bindurl youtube.com P hint -W mpvsafe + +" Subconfig Settings +seturl monkeytype.com allowautofocus true +seturl www.google.com followpagepatterns.next Next +seturl overleaf.com allowautofocus true +seturl .*/.*\.ipynb allowautofocus true +seturl nitrotype.com allowautofocus true + +" Aliases +alias git_clone js "git clone " + document.location.href.split('#')[0].split('/').slice(0, 5).join('/') + " ;cd " + document.location.href.split('#')[0].split('/').at(4) +alias git_clone_ssh js "git clone " + document.location.href.split('#')[0].split('/').slice(0, 5).join('/').replace(/https?:\/\//,"git@").replace("/",":").replace(/$/,".git") + " ;cd " + document.location.href.split('#')[0].split('/').at(4) + +" Autocmds +autocmd DocStart monkeytype.com mode ignore +autocmd DocStart overleaf.com mode ignore +autocmd DocStart undefined mode ignore +autocmd DocStart .*/.*\.ipynb mode ignore + +" For syntax highlighting see https://github.com/tridactyl/vim-tridactyl +" vim: set filetype=tridactyl \ No newline at end of file diff --git a/.config/zsh/.aliases b/.config/zsh/.aliases new file mode 100644 index 0000000..b446e40 --- /dev/null +++ b/.config/zsh/.aliases @@ -0,0 +1,56 @@ +# alias af=alias-finder +alias menu="menu | lolcat" +alias nomnom="menu | lolcat" +alias so="shrout" +alias sf="shrfile" +alias co="cpyout" +alias cf="cpyfile" +alias ls=lsd +alias lsl="clear; ls" +alias lll="clear; ll" +alias rake='noglob bundled_rake' +alias weather='curl wttr.in/?0' +alias gdm='gd master' +alias s='gst .' +alias d='gd .' +alias intel="sudo prime-select intel" +alias nvidia="sudo prime-select nvidia" +alias pls="sudo" +alias p="pyenv" +alias cat="bat" +alias bd="batdiff" +alias man="batman" +alias cd.="cd .." +alias cd..="cd .." +alias xd="xdg-open &>/dev/null" +alias xd.="xdg-open &>/dev/null ." +alias suod="sudo" +alias sduo="sudo" +alias zz='z -c' # restrict matches to subdirs of $PWD +alias zi='z -I' # use fzf to select in multiple matches +alias n=z +alias ni='z -I' +alias nn='z -c' +alias nb='z -b' +alias t="todo.sh" +alias ta="todo.sh add" +alias tl="todo.sh list" +alias td="todo.sh do" +alias tp="todo.sh pri" +alias vim="nvim" +alias v="vim" +alias viz="vim ${ZDOTDIR:-$HOME}/.zshrc" +alias vizp="vim ${ZDOTDIR:-$HOME}/.zpreztorc" +alias vit="vim ~/.config/tmux/tmux.conf" +alias vip="vim ~/.config/polybar/config.ini" +alias viv="vim ~/.vimrc" +alias viw="vim ~/.which-key.vim" +alias via="vim ${ZDOTDIR:-$HOME}/.aliases" +alias vi3="vim ~/.config/i3/config" +alias viq="vim ~/.config/qtile/config.py" +alias top='htop' +alias cp='cp -ri' +alias mv='mv -i' +alias mkdir='mkdir -p' +alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' +alias dots='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' diff --git a/.config/zsh/.p10k.zsh b/.config/zsh/.p10k.zsh new file mode 100644 index 0000000..0d6b44b --- /dev/null +++ b/.config/zsh/.p10k.zsh @@ -0,0 +1,1619 @@ +# Generated by Powerlevel10k configuration wizard on 2022-01-24 at 17:54 +03. +# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 59558. +# Wizard options: nerdfont-complete + powerline, large icons, unicode, lean, 24h time, +# 2 lines, dotted, no frame, light-ornaments, sparse, many icons, concise, +# transient_prompt, instant_prompt=verbose. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate +# your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + autoload -Uz is-at-least && is-at-least 5.1 || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + os_icon # os identifier + dir # current directory + vcs # git status + # =========================[ Line #2 ]========================= + newline # \n + background_jobs # presence of background jobs + prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + # =========================[ Line #1 ]========================= + status # exit code of the last command + command_execution_time # duration of the last command + direnv # direnv status (https://direnv.net/) + asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + anaconda # conda environment (https://conda.io/) + pyenv # python environment (https://github.com/pyenv/pyenv) + goenv # go environment (https://github.com/syndbg/goenv) + nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + # rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + # php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + rvm # ruby version from rvm (https://rvm.io) + fvm # flutter version management (https://github.com/leoafarias/fvm) + luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + jenv # java version from jenv (https://github.com/jenv/jenv) + plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + haskell_stack # haskell version from stack (https://haskellstack.org/) + kubecontext # current kubernetes context (https://kubernetes.io/) + terraform # terraform workspace (https://www.terraform.io) + # terraform_version # terraform version (https://www.terraform.io) + aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + gcloud # google cloud cli account and project (https://cloud.google.com/) + google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) + context # user@hostname + nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + ranger # ranger shell (https://github.com/ranger/ranger) + nnn # nnn shell (https://github.com/jarun/nnn) + xplr # xplr shell (https://github.com/sayanarijit/xplr) + vim_shell # vim shell indicator (:sh) + midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + # vpn_ip # virtual private network indicator + # load # CPU load + # disk_usage # disk usage + # ram # free RAM + # swap # used swap + todo # todo items (https://github.com/todotxt/todo.txt-cli) + timewarrior # timewarrior tracking status (https://timewarrior.net/) + taskwarrior # taskwarrior task count (https://taskwarrior.org/) + time # current time + # =========================[ Line #2 ]========================= + newline + # ip # ip address and bandwidth usage for a specified network interface + # public_ip # public IP address + # proxy # system-wide http/https/ftp proxy + # battery # internal battery + # wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=nerdfont-complete + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=moderate + + # Basic style options that define the overall look of your prompt. You probably don't want to + # change them. + typeset -g POWERLEVEL9K_BACKGROUND= # transparent background + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + + # Connect left prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= + + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll + # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and + # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. + typeset -g POWERLEVEL9K_SHOW_RULER=false + typeset -g POWERLEVEL9K_RULER_CHAR='─' # reasonable alternative: '·' + typeset -g POWERLEVEL9K_RULER_FOREGROUND=242 + + # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─' + # to make it easier to see the alignment between left and right prompt and to separate prompt + # from command output. It serves the same purpose as ruler (see above) without increasing + # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false + # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact + # prompt. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR='·' + if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then + # The color of the filler. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 + # Add a space between the end of left prompt and the filler. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' + # Add a space between the filler and the start of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' + # Start filler from the edge of the screen if there are no left segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + # End filler on the edge of the screen if there are no right segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + + ##################################[ dir: current directory ]################################## + # Default current directory color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=31 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39 + # Display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-version + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=31 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=103 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=39 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=31 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=103 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=39 + # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=31 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=103 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=39 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' + + #####################################[ vcs: git status ]###################################### + # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + if (( $1 )); then + # Styling for up-to-date Git status. + local meta='%f' # default foreground + local clean='%76F' # green foreground + local modified='%178F' # yellow foreground + local untracked='%39F' # blue foreground + local conflicted='%196F' # red foreground + else + # Styling for incomplete and stale Git status. + local meta='%244F' # grey foreground + local clean='%244F' # grey foreground + local modified='%244F' # grey foreground + local untracked='%244F' # grey foreground + local conflicted='%244F' # grey foreground + fi + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + # ⇠42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "─" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' + typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Icon color. + typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 + typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244 + # Custom icon. + # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg reposotiry. + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + # These settings are used for repositories other than Git or when gitstatusd fails and + # Powerlevel10k has to fall back to using vcs_info. + typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 + typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178 + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=false + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70 + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + + # Status when some part of a pipe command fails but the overall exit status is zero. It may look + # like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + + # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as + # it will signify error by turning red. + typeset -g POWERLEVEL9K_STATUS_ERROR=false + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160 + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160 + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + + ###################[ command_execution_time: duration of the last command ]################### + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Execution time color. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=true + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70 + # Custom icon. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='' + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ direnv: direnv status (https://direnv.net/) ]######################## + # Direnv color. + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=70 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=72 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=220 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=160 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=66 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=96 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=110 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=110 + # If the tracked task is longer than 24 characters, truncate and append "…". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180 + + # Context format when running with privileges: bold user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' + + ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### + # Python virtual environment color. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37 + # Don't show Python version next to the virtual environment name. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117 + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=168 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=38 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=32 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide php version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=160 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### + # Haskell color. + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172 + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=32 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=178 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=81 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_FOREGROUND=38 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=70 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -f 208 -i '⭐' -t 'hello, %n' + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/.config/zsh/.zlogin b/.config/zsh/.zlogin new file mode 100644 index 0000000..ac4d342 --- /dev/null +++ b/.config/zsh/.zlogin @@ -0,0 +1,26 @@ +# +# Executes commands at login post-zshrc. +# +# Authors: +# Sorin Ionescu +# + +# Execute code that does not affect the current session in the background. +{ + # Compile the completion dump to increase startup speed. + zcompdump="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump" + if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then + zcompile "$zcompdump" + fi +} &! + +# Execute code only if STDERR is bound to a TTY. +if [[ -o INTERACTIVE && -t 2 ]]; then + + # Print a random, hopefully interesting, adage. + if (( $+commands[fortune] )); then + fortune -s + print + fi + +fi >&2 diff --git a/.config/zsh/.zlogout b/.config/zsh/.zlogout new file mode 100644 index 0000000..b5d9858 --- /dev/null +++ b/.config/zsh/.zlogout @@ -0,0 +1,19 @@ +# +# Executes commands at logout. +# +# Authors: +# Sorin Ionescu +# + +# Execute code only if STDERR is bound to a TTY. +[[ -o INTERACTIVE && -t 2 ]] && { + +SAYINGS=( + "So long and thanks for all the fish.\n -- Douglas Adams" + "Good morning! And in case I don't see ya, good afternoon, good evening and goodnight.\n --Truman Burbank" +) + +# Print a randomly-chosen message: +echo $SAYINGS[$(($RANDOM % ${#SAYINGS} + 1))] + +} >&2 diff --git a/.config/zsh/.zpreztorc b/.config/zsh/.zpreztorc new file mode 100644 index 0000000..8d2bbb8 --- /dev/null +++ b/.config/zsh/.zpreztorc @@ -0,0 +1,237 @@ +# +# Sets Prezto options. +# +# Authors: +# Sorin Ionescu +# + +# +# General +# + +# Set case-sensitivity for completion, history lookup, etc. +# zstyle ':prezto:*:*' case-sensitive 'yes' + +# Color output (auto set to 'no' on dumb terminals). +zstyle ':prezto:*:*' color 'yes' + +# Add additional directories to load prezto modules from +# zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib + +# Allow module overrides when pmodule-dirs causes module name collisions +# zstyle ':prezto:load' pmodule-allow-overrides 'yes' + +# Set the Zsh modules to load (man zshmodules). +# zstyle ':prezto:load' zmodule 'attr' 'stat' + +# Set the Zsh functions to load (man zshcontrib). +# zstyle ':prezto:load' zfunction 'zargs' 'zmv' + +# Set the Prezto modules to load (browse modules). +# The order matters. +zstyle ':prezto:load' pmodule \ + 'environment' \ + 'terminal' \ + 'editor' \ + 'history' \ + 'directory' \ + 'spectrum' \ + 'utility' \ + 'rsync' \ + 'tmux' \ + 'archive' \ + 'completion' \ + 'syntax-highlighting' \ + 'history-substring-search' \ + 'autosuggestions' \ + 'prompt' + + # 'rsync' \ rsync-copy rsync-move + # 'git' \ use oh my zsh git + # https://github.com/Asocia/prezto/tree/master/modules/spectrum +# +# Autosuggestions +# + +# Set the query found color. +zstyle ':prezto:module:autosuggestions:color' found 'fg=32,bold' + +# +# Completions +# + +# Set the entries to ignore in static '/etc/hosts' for host completion. +# zstyle ':prezto:module:completion:*:hosts' etc-host-ignores \ +# '0.0.0.0' '127.0.0.1' + +# +# Editor +# + +# Set the key mapping style to 'emacs' or 'vi'. +zstyle ':prezto:module:editor' key-bindings 'vi' + +# Auto convert .... to ../.. +zstyle ':prezto:module:editor' dot-expansion 'yes' + +# Allow the zsh prompt context to be shown. +zstyle ':prezto:module:editor' ps-context 'yes' + +# +# Git +# + +# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'. +# zstyle ':prezto:module:git:status:ignore' submodules 'all' + +# +# GNU Utility +# + +# Set the command prefix on non-GNU systems. +# zstyle ':prezto:module:gnu-utility' prefix 'g' + +# +# History Substring Search +# + +# Set the query found color. +# zstyle ':prezto:module:history-substring-search:color' found '' + +# Set the query not found color. +# zstyle ':prezto:module:history-substring-search:color' not-found '' + +# Set the search globbing flags. +# zstyle ':prezto:module:history-substring-search' globbing-flags '' + +# +# macOS +# + +# Set the keyword used by `mand` to open man pages in Dash.app +# zstyle ':prezto:module:osx:man' dash-keyword 'manpages' + +# +# Pacman +# + +# Set the Pacman frontend. +# zstyle ':prezto:module:pacman' frontend 'yaourt' + +# +# Prompt +# + +# Set the prompt theme to load. +# Setting it to 'random' loads a random theme. +# Auto set to 'off' on dumb terminals. +zstyle ':prezto:module:prompt' theme 'powerlevel10k' + +# Set the working directory prompt display length. +# By default, it is set to 'short'. Set it to 'long' (without '~' expansion) +# for longer or 'full' (with '~' expansion) for even longer prompt display. +# zstyle ':prezto:module:prompt' pwd-length 'short' + +# Set the prompt to display the return code along with an indicator for non-zero +# return codes. This is not supported by all prompts. +# zstyle ':prezto:module:prompt' show-return-val 'yes' + +# +# Python +# + +# Auto switch the Python virtualenv on directory change. +# zstyle ':prezto:module:python:virtualenv' auto-switch 'yes' + +# Automatically initialize virtualenvwrapper if pre-requisites are met. +# zstyle ':prezto:module:python:virtualenv' initialize 'yes' + +# +# Ruby +# + +# Auto switch the Ruby version on directory change. +# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' + +# +# Screen +# + +# Auto start a session when Zsh is launched in a local terminal. +# zstyle ':prezto:module:screen:auto-start' local 'yes' + +# Auto start a session when Zsh is launched in a SSH connection. +# zstyle ':prezto:module:screen:auto-start' remote 'yes' + +# +# SSH +# + +# Set the SSH identities to load into the agent. +# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github' + +# +# Syntax Highlighting +# + +# Set syntax highlighters. +# By default, only the main highlighter is enabled. +zstyle ':prezto:module:syntax-highlighting' highlighters \ + 'main' \ + 'brackets' \ + 'pattern' \ + 'line' \ + 'cursor' \ + 'root' +# +# Set syntax highlighting styles. +# zstyle ':prezto:module:syntax-highlighting' styles \ +# 'builtin' 'bg=blue' \ +# 'command' 'bg=blue' \ +# 'function' 'bg=blue' +# +# Set syntax pattern styles. +# zstyle ':prezto:module:syntax-highlighting' pattern \ +# 'rm*-rf*' 'fg=white,bold,bg=red' + +# +# Terminal +# + +# Auto set the tab and window titles. +# zstyle ':prezto:module:terminal' auto-title 'yes' + +# Set the window title format. +# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' + +# Set the tab title format. +# zstyle ':prezto:module:terminal:tab-title' format '%m: %s' + +# Set the terminal multiplexer title format. +# zstyle ':prezto:module:terminal:multiplexer-title' format '%s' + +# +# Tmux +# + +# Auto start a session when Zsh is launched in a local terminal. +zstyle ':prezto:module:tmux:auto-start' local 'no' + +# Auto start a session when Zsh is launched in a SSH connection. +# zstyle ':prezto:module:tmux:auto-start' remote 'yes' + +# Integrate with iTerm2. +# zstyle ':prezto:module:tmux:iterm' integrate 'yes' + +# Set the default session name: +session_name=$(echo $TERM | cut -d"-" -f1) +zstyle ':prezto:module:tmux:session' name $session_name + +# +# Utility +# + +# Enabled safe options. This aliases cp, ln, mv and rm so that they prompt +# before deleting or overwriting files. Set to 'no' to disable this safer +# behavior. +# zstyle ':prezto:module:utility' safe-ops 'yes' diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile new file mode 100644 index 0000000..d693344 --- /dev/null +++ b/.config/zsh/.zprofile @@ -0,0 +1,65 @@ +# +# Executes commands at login pre-zshrc. +# +# Authors: +# Sorin Ionescu +# + +export npm_config_prefix="$HOME/.local" + +# +# Browser +# + +if [[ "$OSTYPE" == darwin* ]]; then + export BROWSER='open' +fi + +# +# Editors +# + +export EDITOR='nvim' +export VISUAL="$EDITOR" +export PAGER='less' + +# +# Language +# + +if [[ -z "$LANG" ]]; then + export LANG='en_US.UTF-8' +fi + +# +# Paths +# + +# Ensure path arrays do not contain duplicates. +typeset -gU cdpath fpath mailpath path + +# Set the list of directories that cd searches. +# cdpath=( +# $cdpath +# ) + +# Set the list of directories that Zsh searches for programs. +path=( + /usr/local/{bin,sbin} + $path +) + +# +# Less +# + +# Set the default Less options. +# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). +# Remove -X to enable it. +export LESS='-g -i -M -R -S -w -z-4' + +# Set the Less input preprocessor. +# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. +if (( $#commands[(i)lesspipe(|.sh)] )); then + export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" +fi diff --git a/.config/zsh/.zsh/_git b/.config/zsh/.zsh/_git new file mode 100644 index 0000000..6c56296 --- /dev/null +++ b/.config/zsh/.zsh/_git @@ -0,0 +1,294 @@ +#compdef git gitk + +# zsh completion wrapper for git +# +# Copyright (c) 2012-2020 Felipe Contreras +# +# The recommended way to install this script is to make a copy of it as a +# file named '_git' inside any directory in your fpath. +# +# For example, create a directory '~/.zsh/', copy this file to '~/.zsh/_git', +# and then add the following to your ~/.zshrc file: +# +# fpath=(~/.zsh $fpath) +# +# You need git's bash completion script installed. By default bash-completion's +# location will be used (e.g. pkg-config --variable=completionsdir bash-completion). +# +# If your bash completion script is somewhere else, you can specify the +# location in your ~/.zshrc: +# +# zstyle ':completion:*:*:git:*' script ~/.git-completion.bash +# + +zstyle -T ':completion:*:*:git:*' tag-order && \ + zstyle ':completion:*:*:git:*' tag-order 'common-commands' + +zstyle -s ":completion:*:*:git:*" script script +if [ -z "$script" ]; then + local -a locations + local e bash_completion + + bash_completion=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null) || + bash_completion='/usr/share/bash-completion/completions/' + + locations=( + "$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash + "$HOME/.local/share/bash-completion/completions/git" + "$bash_completion/git" + '/etc/bash_completion.d/git' # old debian + ) + for e in $locations; do + test -f $e && script="$e" && break + done +fi + +local old_complete="$functions[complete]" +functions[complete]=: +GIT_SOURCING_ZSH_COMPLETION=y . "$script" +functions[complete]="$old_complete" + +__gitcomp () +{ + emulate -L zsh + + local cur_="${3-$cur}" + + case "$cur_" in + --*=) + ;; + --no-*) + local c IFS=$' \t\n' + local -a array + for c in ${=1}; do + if [[ $c == "--" ]]; then + continue + fi + c="$c${4-}" + case $c in + --*=|*.) ;; + *) c="$c " ;; + esac + array+=("$c") + done + compset -P '*[=:]' + compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 + ;; + *) + local c IFS=$' \t\n' + local -a array + for c in ${=1}; do + if [[ $c == "--" ]]; then + c="--no-...${4-}" + array+=("$c ") + break + fi + c="$c${4-}" + case $c in + --*=|*.) ;; + *) c="$c " ;; + esac + array+=("$c") + done + compset -P '*[=:]' + compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 + ;; + esac +} + +__gitcomp_direct () +{ + emulate -L zsh + + compset -P '*[=:]' + compadd -Q -S '' -- ${(f)1} && _ret=0 +} + +__gitcomp_nl () +{ + emulate -L zsh + + compset -P '*[=:]' + compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0 +} + +__gitcomp_file () +{ + emulate -L zsh + + compset -P '*[=:]' + compadd -f -p "${2-}" -- ${(f)1} && _ret=0 +} + +__gitcomp_direct_append () +{ + __gitcomp_direct "$@" +} + +__gitcomp_nl_append () +{ + __gitcomp_nl "$@" +} + +__gitcomp_file_direct () +{ + __gitcomp_file "$1" "" +} + +_git_zsh () +{ + __gitcomp "v1.1" +} + +__git_complete_command () +{ + emulate -L zsh + + local command="$1" + local completion_func="_git_${command//-/_}" + if (( $+functions[$completion_func] )); then + emulate ksh -c $completion_func + return 0 + else + return 1 + fi +} + +__git_zsh_bash_func () +{ + emulate -L ksh + + local command=$1 + + __git_complete_command "$command" && return + + local expansion=$(__git_aliased_command "$command") + if [ -n "$expansion" ]; then + words[1]=$expansion + __git_complete_command "$expansion" + fi +} + +__git_zsh_cmd_common () +{ + local -a list + list=( + add:'add file contents to the index' + bisect:'find by binary search the change that introduced a bug' + branch:'list, create, or delete branches' + checkout:'checkout a branch or paths to the working tree' + clone:'clone a repository into a new directory' + commit:'record changes to the repository' + diff:'show changes between commits, commit and working tree, etc' + fetch:'download objects and refs from another repository' + grep:'print lines matching a pattern' + init:'create an empty Git repository or reinitialize an existing one' + log:'show commit logs' + merge:'join two or more development histories together' + mv:'move or rename a file, a directory, or a symlink' + pull:'fetch from and merge with another repository or a local branch' + push:'update remote refs along with associated objects' + rebase:'forward-port local commits to the updated upstream head' + reset:'reset current HEAD to the specified state' + restore:'restore working tree files' + rm:'remove files from the working tree and from the index' + show:'show various types of objects' + status:'show the working tree status' + switch:'switch branches' + tag:'create, list, delete or verify a tag object signed with GPG') + _describe -t common-commands 'common commands' list && _ret=0 +} + +__git_zsh_cmd_alias () +{ + local -a list + list=(${${(0)"$(git config -z --get-regexp '^alias\.*')"}#alias.}) + list=(${(f)"$(printf "%s:alias for '%s'\n" ${(f@)list})"}) + _describe -t alias-commands 'aliases' list && _ret=0 +} + +__git_zsh_cmd_all () +{ + local -a list + emulate ksh -c __git_compute_all_commands + list=( ${=__git_all_commands} ) + _describe -t all-commands 'all commands' list && _ret=0 +} + +__git_zsh_main () +{ + local curcontext="$curcontext" state state_descr line + typeset -A opt_args + local -a orig_words + + orig_words=( ${words[@]} ) + + _arguments -C \ + '(-p --paginate --no-pager)'{-p,--paginate}'[pipe all output into ''less'']' \ + '(-p --paginate)--no-pager[do not pipe git output into a pager]' \ + '--git-dir=-[set the path to the repository]: :_directories' \ + '--bare[treat the repository as a bare repository]' \ + '(- :)--version[prints the git suite version]' \ + '--exec-path=-[path to where your core git programs are installed]:: :_directories' \ + '--html-path[print the path where git''s HTML documentation is installed]' \ + '--info-path[print the path where the Info files are installed]' \ + '--man-path[print the manpath (see `man(1)`) for the man pages]' \ + '--work-tree=-[set the path to the working tree]: :_directories' \ + '--namespace=-[set the git namespace]' \ + '--no-replace-objects[do not use replacement refs to replace git objects]' \ + '(- :)--help[prints the synopsis and a list of the most commonly used commands]: :->arg' \ + '(-): :->command' \ + '(-)*:: :->arg' && return + + case $state in + (command) + _tags common-commands alias-commands all-commands + while _tags; do + _requested common-commands && __git_zsh_cmd_common + _requested alias-commands && __git_zsh_cmd_alias + _requested all-commands && __git_zsh_cmd_all + let _ret || break + done + ;; + (arg) + local command="${words[1]}" __git_dir + + if (( $+opt_args[--bare] )); then + __git_dir='.' + else + __git_dir=${opt_args[--git-dir]} + fi + + (( $+opt_args[--help] )) && command='help' + + words=( ${orig_words[@]} ) + + __git_zsh_bash_func $command + ;; + esac +} + +_git () +{ + local _ret=1 + local cur cword prev + + cur=${words[CURRENT]} + prev=${words[CURRENT-1]} + let cword=CURRENT-1 + + if (( $+functions[__${service}_zsh_main] )); then + __${service}_zsh_main + elif (( $+functions[__${service}_main] )); then + emulate ksh -c __${service}_main + elif (( $+functions[_${service}] )); then + emulate ksh -c _${service} + elif (( $+functions[_${service//-/_}] )); then + emulate ksh -c _${service//-/_} + fi + + let _ret && _default && _ret=0 + return _ret +} + +_git diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv new file mode 100644 index 0000000..4922792 --- /dev/null +++ b/.config/zsh/.zshenv @@ -0,0 +1,12 @@ +# +# Defines environment variables. +# +# Authors: +# Sorin Ionescu +# Şahin Akkaya + +# Ensure that a non-login, non-interactive shell has a defined environment. +if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then + source "${ZDOTDIR:-$HOME}/.zprofile" +fi +. "$HOME/.cargo/env" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc new file mode 100644 index 0000000..0dd9483 --- /dev/null +++ b/.config/zsh/.zshrc @@ -0,0 +1,147 @@ + +d="$HOME/scripts/colorscripts" +bash "$d/`ls $d | shuf -n 1`" +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# +# Executes commands at the start of an interactive session. +# +# Authors: +# Sorin Ionescu +# + + +# Source Prezto. +if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then + source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" +fi + + +fpath=("${ZDOTDIR:-$HOME}/.zsh" $fpath) + +# Customize to your needs... +source "${ZDOTDIR:-$HOME}/.aliases" + +ZSH_AUTOSUGGEST_STRATEGY=(history) +ZSH_AUTOSUGGEST_MANUAL_REBIND=true + + +# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. +[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh + +### Added by Zinit's installer +if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" +fi + +source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +# Load a few important annexes, without Turbo +# (this is currently required for annexes) +zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust + +### End of Zinit's installer chunk + +zinit snippet OMZ::plugins/git/git.plugin.zsh +zinit snippet OMZ::plugins/last-working-dir/last-working-dir.plugin.zsh +zinit snippet OMZ::plugins/dirhistory/dirhistory.plugin.zsh +zinit light skywind3000/z.lua + +# ZVM +function zvm_config() { + ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT + ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM + ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BLOCK + ZVM_LAZY_KEYBINDINGS=true + ZVM_VI_INSERT_ESCAPE_BINDKEY=kj +} + +zinit ice depth=1 +zinit light jeffreytse/zsh-vi-mode + +# The plugin will auto execute this zvm_after_init function +function zvm_after_init() { + [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + + bindkey '^b' backward-word + bindkey '^f' forward-word + bindkey '^g' autosuggest-accept + # allow ctrl-r and ctrl-s to search the history + # bindkey '^r' history-incremental-search-backward + # bindkey '^s' history-incremental-search-forward + bindkey '^h' backward-kill-word + bindkey '^[[M' kill-word + bindkey -s '^@' "" + bindkey -s '' "fg\n" + + + # allow ctrl-a and ctrl-e to move to beginning/end of line + bindkey '^a' beginning-of-line + bindkey '^e' end-of-line + + + # allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour) + # bindkey '^h' backward-delete-char + bindkey '^w' backward-kill-word + + + bindkey '^x' fzf-cd-widget + bindkey "\e[1;3D" dirhistory_zle_dirhistory_back + bindkey "\e[1;3C" dirhistory_zle_dirhistory_future + bindkey "\e[1;3A" dirhistory_zle_dirhistory_up + bindkey "\e[1;3B" dirhistory_zle_dirhistory_down +} + +doit () +{ + # this function is created for forcing the deletion of the file or directory. + # + # ❯ rm somedir + # rm: cannot remove 'somedir': Is a directory + # ❯ rmdir somedir/ + # rmdir: failed to remove 'somedir/': Directory not empty + # ❯ rm -rf somedir/ + # rm: cannot remove 'somedir/': Permission denied + # + # Just remove the f**king directory!! + + + lastCommand=$(history | tail -n 1 | cut -d' ' -f3-) + firstWord=$(echo $lastCommand | cut -d' ' -f1) + RED="\033[1;31m" + GREEN="\033[1;32m" + NOCOLOR="\033[0m" + + lastWord=$(echo $lastCommand | awk '{print $NF}') + case "$firstWord" in + "rm"|"rmdir") + echo -en "Execute ${RED}\"sudo rm -rf $lastWord\"${NOCOLOR}?" + read -k "? " ans + echo + if [ "$ans" = "y" ]; then + sudo rm -rf $lastWord + fi + ;; + "cd") + mkdir $lastWord && cd $lastWord + ;; + *) echo "Don't know what to do with \"$lastCommand\"." + ;; + esac +} + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e71a4f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.cfg diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1091366 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,26 @@ +[submodule "GitRepositories/st"] + path = GitRepositories/st + url = https://github.com/Asocia/st.git +[submodule ".config/nvim"] + path = .config/nvim + url = https://github.com/Asocia/nvim-config.git +[submodule "GitRepositories/polybar-wireguard"] + path = GitRepositories/polybar-wireguard + url = https://github.com/mil-ad/polybar-wireguard.git + ignore = dirty +[submodule "GitRepositories/rofi-bluetooth"] + path = GitRepositories/rofi-bluetooth + url = https://github.com/nickclyde/rofi-bluetooth.git + ignore = dirty +[submodule "GitRepositories/binary-wallpaper"] + path = GitRepositories/binary-wallpaper + url = https://github.com/Asocia/binary-clock-wallpaper.git +[submodule "GitRepositories/bat-extras"] + path = GitRepositories/bat-extras + url = https://github.com/eth-p/bat-extras.git +[submodule "GitRepositories/fzf"] + path = GitRepositories/fzf + url = https://github.com/junegunn/fzf +[submodule ".config/tmux/plugins/tpm"] + path = .config/tmux/plugins/tpm + url = https://github.com/tmux-plugins/tpm diff --git a/.local/bin/passmenu b/.local/bin/passmenu new file mode 100755 index 0000000..76d92ab --- /dev/null +++ b/.local/bin/passmenu @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +typeit=0 +if [[ $1 == "--type" ]]; then + typeit=1 + shift +fi + +if [[ -n $WAYLAND_DISPLAY ]]; then + dmenu=dmenu-wl + xdotool="ydotool type --file -" +elif [[ -n $DISPLAY ]]; then + dmenu=dmenu + xdotool="xdotool type --clearmodifiers --file -" +else + echo "Error: No Wayland or X11 display detected" >&2 + exit 1 +fi + +prefix=${PASSWORD_STORE_DIR-~/.password-store} +password_files=( "$prefix"/**/*.gpg ) +password_files=( "${password_files[@]#"$prefix"/}" ) +password_files=( "${password_files[@]%.gpg}" ) + +password=$(printf '%s\n' "${password_files[@]}" | "$dmenu" "$@") + +[[ -n $password ]] || exit + +if [[ $typeit -eq 0 ]]; then + pass show -c "$password" 2>/dev/null +else + pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | $xdotool +fi diff --git a/.profile b/.profile new file mode 100644 index 0000000..20685af --- /dev/null +++ b/.profile @@ -0,0 +1,8 @@ +export ZDOTDIR="/home/sahin/.config/zsh" +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" + +export PATH="$PATH:$HOME/scripts:" +export PATH="$PATH:$HOME/.config/rofi/bin/:" +export PATH="$PATH:$HOME/.local/bin/" + +[ ! -s ~/.config/mpd/pid ] && mpd diff --git a/GitRepositories/bat-extras b/GitRepositories/bat-extras new file mode 160000 index 0000000..8ad00bd --- /dev/null +++ b/GitRepositories/bat-extras @@ -0,0 +1 @@ +Subproject commit 8ad00bd978678b67d61176e8397369e1e6afa4fc diff --git a/GitRepositories/binary-wallpaper b/GitRepositories/binary-wallpaper new file mode 160000 index 0000000..356f3bb --- /dev/null +++ b/GitRepositories/binary-wallpaper @@ -0,0 +1 @@ +Subproject commit 356f3bb253ecc14997e1abaf7406b914f69f06dc diff --git a/GitRepositories/fzf b/GitRepositories/fzf new file mode 160000 index 0000000..5f385d8 --- /dev/null +++ b/GitRepositories/fzf @@ -0,0 +1 @@ +Subproject commit 5f385d88e0a786f20c4231b82f250945a6583a17 diff --git a/GitRepositories/patches/polybar-wireguard/wireguard.patch b/GitRepositories/patches/polybar-wireguard/wireguard.patch new file mode 100644 index 0000000..186a0f9 --- /dev/null +++ b/GitRepositories/patches/polybar-wireguard/wireguard.patch @@ -0,0 +1,33 @@ +diff --git a/polybar-wireguard b/rofi-wireguard +similarity index 88% +rename from polybar-wireguard +rename to rofi-wireguard +index 6712185..03e7dcb 100755 +--- a/polybar-wireguard ++++ b/rofi-wireguard +@@ -6,11 +6,11 @@ + # https://github.com/polybar/polybar/wiki/Formatting#format-tags-inside-polybar-config + green=#55aa55 + +-configs_path="/PATH/TO/CONF/FILES" ++configs_path="$HOME/.config/wireguard" + connected_interface=$(sudo wg | grep interface | cut -d " " -f2) + + connect() { +- selected_config=$(ls $configs_path/*.conf | xargs basename -a -s .conf | dmenu) ++ selected_config=$(ls $configs_path/*.conf | xargs basename -a -s .conf | rofi -i -dmenu -p "Select a VPN server to connect: ") + [[ $selected_config ]] && sudo wg-quick up "$configs_path"/"$selected_config".conf + } + +@@ -36,9 +36,9 @@ toggle() { + print() { + if [[ $connected_interface ]] + then +- echo %{u"$green"}%{+u}%{T4}%{F"$green"}%{T-}%{F-} "$connected_interface" ++ echo $connected_interface + else +- echo %{T4}%{T-} ++ echo + fi + } + diff --git a/GitRepositories/patches/rofi-bluetooth/dontshowmenu.patch b/GitRepositories/patches/rofi-bluetooth/dontshowmenu.patch new file mode 100644 index 0000000..1d8e91b --- /dev/null +++ b/GitRepositories/patches/rofi-bluetooth/dontshowmenu.patch @@ -0,0 +1,71 @@ +diff --git a/rofi-bluetooth b/rofi-bluetooth +index 5c52fd8..012e612 100755 +--- a/rofi-bluetooth ++++ b/rofi-bluetooth +@@ -33,7 +33,6 @@ power_on() { + toggle_power() { + if power_on; then + bluetoothctl power off +- show_menu + else + if rfkill list bluetooth | grep -q 'blocked: yes'; then + rfkill unblock bluetooth && sleep 3 +@@ -59,7 +58,6 @@ toggle_scan() { + if scan_on; then + kill $(pgrep -f "bluetoothctl scan on") + bluetoothctl scan off +- show_menu + else + bluetoothctl scan on & + echo "Scanning..." +@@ -83,10 +81,8 @@ pairable_on() { + toggle_pairable() { + if pairable_on; then + bluetoothctl pairable off +- show_menu + else + bluetoothctl pairable on +- show_menu + fi + } + +@@ -105,10 +101,8 @@ discoverable_on() { + toggle_discoverable() { + if discoverable_on; then + bluetoothctl discoverable off +- show_menu + else + bluetoothctl discoverable on +- show_menu + fi + } + +@@ -126,10 +120,8 @@ device_connected() { + toggle_connection() { + if device_connected $1; then + bluetoothctl disconnect $1 +- device_menu "$device" + else + bluetoothctl connect $1 +- device_menu "$device" + fi + } + +@@ -183,8 +175,6 @@ toggle_trust() { + # Useful for status bars like polybar, etc. + print_status() { + if power_on; then +- printf '' +- + mapfile -t paired_devices < <(bluetoothctl paired-devices | grep Device | cut -d ' ' -f 2) + counter=0 + +@@ -202,8 +192,6 @@ print_status() { + fi + done + printf "\n" +- else +- echo "" + fi + } + diff --git a/GitRepositories/polybar-wireguard b/GitRepositories/polybar-wireguard new file mode 160000 index 0000000..838ec1c --- /dev/null +++ b/GitRepositories/polybar-wireguard @@ -0,0 +1 @@ +Subproject commit 838ec1c59f9b9686bece53f9d6e470ff51e35d06 diff --git a/GitRepositories/rofi-bluetooth b/GitRepositories/rofi-bluetooth new file mode 160000 index 0000000..893db1f --- /dev/null +++ b/GitRepositories/rofi-bluetooth @@ -0,0 +1 @@ +Subproject commit 893db1f2b549e7bc0e9c62e7670314349a29cdf2 diff --git a/GitRepositories/st b/GitRepositories/st new file mode 160000 index 0000000..137175b --- /dev/null +++ b/GitRepositories/st @@ -0,0 +1 @@ +Subproject commit 137175be7526764a3b00600dd9ff4c65393718b0 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Pictures/Screenshots/ricing/Desktop.png b/Pictures/Screenshots/ricing/Desktop.png new file mode 100644 index 0000000..708d993 Binary files /dev/null and b/Pictures/Screenshots/ricing/Desktop.png differ diff --git a/Pictures/Screenshots/ricing/terms.png b/Pictures/Screenshots/ricing/terms.png new file mode 100644 index 0000000..03a0843 Binary files /dev/null and b/Pictures/Screenshots/ricing/terms.png differ diff --git a/Pictures/Wallpapers/default.jpg b/Pictures/Wallpapers/default.jpg new file mode 100644 index 0000000..521a7fd Binary files /dev/null and b/Pictures/Wallpapers/default.jpg differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..03cf1e0 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# sahinakkaya's dotfiles + +**Note: These are my old dotfiles. You can find up-to-date version at [sahinakkaya/dotfiles](https://github.com/sahinakkaya/dotfiles/).** + +### Showcase +![showcase](https://user-images.githubusercontent.com/32161460/160180461-efc75d21-ccd4-45f5-8a14-5ea47efc51eb.gif) +![Desktop](https://raw.github.com/sahinakkaya/old-dotfiles/master/Pictures/Screenshots/ricing/Desktop.png) +![Some terminals](https://raw.github.com/sahinakkaya/old-dotfiles/master/Pictures/Screenshots/ricing/terms.png) + + +### My dotfiles + +- Window manager: [Qtile](https://qtile.org) +- Compositor: [Picom](https://github.com/yshui/picom) +- Status bar: [Eww - Elkowars Wacky Widgets](https://github.com/elkowar/eww) +- Terminal: [My own st build](https://github.com/sahinakkaya/st) +- Shell: [zsh](https://www.zsh.org/) configured with [Prezto](https://github.com/sorin-ionescu/prezto) +- Shell theme: [powerlevel10k](https://github.com/romkatv/powerlevel10k/) +- Editor: [neovim](https://github.com/neovim/neovim) +- Notifications: [dunst](https://github.com/dunst-project/dunst) + +### Todo +- Create an installation script + diff --git a/scripts/autostart.sh b/scripts/autostart.sh new file mode 100755 index 0000000..fd2b635 --- /dev/null +++ b/scripts/autostart.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +function run { + if ! pgrep $1 > /dev/null ; + then + $@& + fi +} + +#feh --bg-scale /usr/share/endeavouros/backgrounds/endeavouros-wallpaper.png + +rm ~/.cache/workspaces +nitrogen --save --set-zoom-fill ~/Pictures/Wallpapers/default.jpg +# run picom --experimental-backends -b # --vsync should prevent screen tearing on most setups if needed +run picom -b # --vsync should prevent screen tearing on most setups if needed + +eww -c ~/.config/eww/bar/ close-all +eww -c ~/.config/eww/bar/ open bar + +keynav daemonize + +/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & disown # start polkit agent from GNOME diff --git a/scripts/check-battery.sh b/scripts/check-battery.sh new file mode 100755 index 0000000..e579b32 --- /dev/null +++ b/scripts/check-battery.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Set limit to shell argument +batteryLimit=$1 +fullAt=92 + +# Get the current battery level with acpi +batteryLevel=$(acpi | cut -d ' ' -f 4 | tr -d '%|,| ') +charging=$(acpi | cut -d ' ' -f 3 | tr -d ',| ') + +echo $batteryLevel + +if [[ "$batteryLevel" -le "$batteryLimit" ]] && [[ "$charging" == "Discharging" ]]; then + /usr/bin/notify-send -a "Battery Warning" --urgency critical "Battery level at ${batteryLevel}%" -i abrt -t 10000 + /usr/bin/paplay /usr/share/sounds/freedesktop/stereo/dialog-warning.oga +#elif [[ "$batteryLevel" -gt "$fullAt" ]] && [[ ! "$charging" == "Discharging" ]]; then +# /usr/bin/notify-send -a "Battery Warning" "Battery is full: ${batteryLevel}" -i abrt -t 10000 +# /usr/bin/paplay /usr/share/sounds/freedesktop/stereo/dialog-warning.oga +fi diff --git a/scripts/chlayout b/scripts/chlayout new file mode 100755 index 0000000..428b2b7 --- /dev/null +++ b/scripts/chlayout @@ -0,0 +1,11 @@ +#!/bin/bash + + +variant=$(setxkbmap -query | grep variant | cut -d" " -f5) + +if [[ $variant == "cdhisopt" ]] + then + setxkbmap us cdhpt -option '' +else + setxkbmap us cdhisopt 'caps:ctrl_modifier' +fi diff --git a/scripts/colorscripts/animals b/scripts/colorscripts/animals new file mode 100755 index 0000000..29366a8 --- /dev/null +++ b/scripts/colorscripts/animals @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +# ============ +# ASCII ANIMAL +# ============ + +# ANSI COLOUR CODES +RD='\x1B[0;31m' +GR='\x1B[0;32m' +YL='\x1B[1;33m' +OR='\x1B[0;33m' +BL='\x1B[0;34m' +LBL='\x1B[1;34m' +CY='\x1B[1;36m' +NC='\x1B[0m' # No Color + +echo "" + +# LIZARD #################################################################### +# Adapted from: http://chris.com/ascii/index.php?art=animals/reptiles/lizards - Glo Pearl +liz1="${GR} ${YL}O${GR}--${YL}O${GR}^^^^^^^^^^^^\________${NC}\n" +liz2="${GR} \__/||-------||---------~${NC}\n" +liz="$liz1$liz2" + +# DINOSAUR ################################################################## +# Adapted from: http://chris.com/ascii/index.php?art=animals/reptiles/dinosaurs +din1="${OR} __ ${NC}\n" +din2="${OR} / ${LBL}°${OR}_)${NC}\n" +din3="${OR} _.----. _ / / ${NC}\n" +din4="${OR} / ../ ${NC}\n" +din5="${OR} ___/ ( | ( ..| ${NC}\n" +din6="${OR} -------|_|--|_| ${NC}\n" +din="$din1$din2$din3$din4$din5$din6" + +# DUCK ##################################################################### +# Adapted from: http://textart.io/art/tag/duck +duc1=" __ \n" +duc2=" ___( o)${OR}>${NC} \n" +duc3=" \ <_. ) ${GR}V${NC} \n" +duc4=" ${BL}~~~~~${NC}\`---'${BL}~~~~~${GR}|${BL}~~~${NC}\n" +duc="$duc1$duc2$duc3$duc4" + +# PEACOCK ################################################################# +# Adapted from: http://www.chris.com/ascii/joan/www.geocities.com/SoHo/7373/birds.html#peacockk +pea1=" ${CY}_ _ ${NC}\n" +pea2=" ${GR}__${CY}/o'V'o\\\\${GR}__ ${NC}\n" +pea3=" ${CY}__${GR}/o ${CY}\\ : / ${GR}o\\\\${CY}__ ${NC}\n" +pea4=" ${CY}/o ${GR}\`. ${CY}\ : / ${GR}.' ${CY}o\\ ${NC}\n" +pea5=" ${GR}_${CY}\\ ${GR}'. ${NC}/\"\\ ${GR}.' ${CY}/${GR}_ ${NC}\n" +pea6=" ${GR}/o${CY} \`-._ ${GR}'${NC}\\\v/${GR}' ${CY}_.-\` ${GR}o\\\ ${NC}\n" +pea7=" ${GR}\\_${CY} \`-.${NC}/ \\\\${CY}.-\` ${GR}_/ ${NC}\n" +pea8=" ${CY}/o${NC} ${GR}\`\`---._${NC}/ \\\\${GR}_.---'' ${CY}o\\\\${NC}\n" +pea9=" ${CY}\_________${NC}\ /${CY}_________/${NC}\n" +pea10=" '\_/' \n" +pea11=" ${OR}_|_|_${NC} \n" +pea="$pea1$pea2$pea3$pea4$pea5$pea6$pea7$pea8$pea9$pea10$pea11" + +# SQUIRREL ################################################################ +# Adapted from: http://www.heartnsoul.com/ascii_art/squirrels.txt +squ1="${OR} ,;;:;, ${NC}\n" +squ2="${OR} ;;;;; ${NC}\n" +squ3="${OR} ,:;;:; ,'=. ${NC}\n" +squ4="${OR} ;:;:;' .=\" ,'_\\\\${NC}\n" +squ5="${OR} ':;:;,/ ,__:=${RD}@${NC}\n" +squ6="${OR} ';;:; =./)_ ${NC}\n" +squ7="${OR} \`\"=\_ )_\"\` ${NC}\n" +squ8="${OR} \`\`'\"\` ${NC}\n" +squ="$squ1$squ2$squ3$squ4$squ5$squ6$squ7$squ8" + +# Generate random number +RAND=$((((RANDOM + RANDOM) % 5) + 1)) + +case "$RAND" in + 1) echo -e "$liz" + ;; + 2) echo -e "$din" + ;; + 3) echo -e "$duc" + ;; + 4) echo -e "$pea" + ;; + 5) echo -e "$squ" + ;; + *) + ;; +esac diff --git a/scripts/colorscripts/bonsai b/scripts/colorscripts/bonsai new file mode 100755 index 0000000..0fd4d3b --- /dev/null +++ b/scripts/colorscripts/bonsai @@ -0,0 +1,48 @@ +#!/bin/sh + +# && +# &&&&& +# &&&\/& &&& +# &&|,/ |/& && +# &&/ / /_& && +# \ { |_____/_& +# { / / &&& +# .`. \{___\________\/_\} +# \} \}\{ \ +# }\{\{ \____& +# \{\}\{ `&&& +# {{} && +# , -=-~{ .-^- _ +# `. + +# File: bonsai-tree.textart +# Description: Bonsai tree +# Author: Hazel Levine +# └─ https://git.knightsofthelambdacalcul.us/hazel +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: bonsai-tree +# └─ https://git.knightsofthelambdacalcul.us/hazel/etc/src/branch/canon/bin/bonsai-tree +# This file from NNB's text art collections +# └─ https://github.com/NNBnh/nnbs-text-art/blob/main/other/bonsai-tree.textart + + +# Start +echo -e "\n \033[32m&& + \033[32m&&&&& + \033[32m&&&\033[33m\/\033[32m& &&& + \033[32m&&\033[33m|,/ |/\033[32m& && + \033[32m&&\033[33m/ / /_\033[32m& && + \033[33m\ { |_____/_\033[32m& + \033[33m{ / / \033[32m&&& + \033[33m.\`. \\{___\________\/_\} + \033[33m\} \}\{ \\ + \033[33m}\{\{ \\____\033[32m& + \033[33m\{\}\{ \`\033[32m&\033[33m\\033[32m&& + \033[33m{{} \033[32m&& +\033[33m, -=-~{ .-^- _ + \`.\n" + + + +exit 0 diff --git a/scripts/colorscripts/colorblocks b/scripts/colorscripts/colorblocks new file mode 100755 index 0000000..bacac10 --- /dev/null +++ b/scripts/colorscripts/colorblocks @@ -0,0 +1,22 @@ +#!/bin/sh + +# ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ +# ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ +# ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ ░░░░░░▒▒ +# ▓▓▓▓▓▓██ ▓▓▓▓▓▓██ ▓▓▓▓▓▓██ ▓▓▓▓▓▓██ ▓▓▓▓▓▓██ ▓▓▓▓▓▓██ + +# File: colorblocks.textart +# Description: Show the terminal colourscheme as blocks +# Author: Adhi Pambudi +# └─ https://github.com/addy-dclxvi +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/colorblocks.textart + +# Start +echo -e "\n\033[41m \033[101m \033[0m \033[42m \033[102m \033[0m \033[43m \033[103m \033[0m \033[44m \033[104m \033[0m \033[45m \033[105m \033[0m \033[46m \033[106m \033[0m +\033[41m \033[101m \033[0m \033[42m \033[102m \033[0m \033[43m \033[103m \033[0m \033[44m \033[104m \033[0m \033[45m \033[105m \033[0m \033[46m \033[106m \033[0m +\033[41m \033[101m \033[0m \033[42m \033[102m \033[0m \033[43m \033[103m \033[0m \033[44m \033[104m \033[0m \033[45m \033[105m \033[0m \033[46m \033[106m \033[0m +\033[47m \033[107m \033[0m \033[47m \033[107m \033[0m \033[47m \033[107m \033[0m \033[47m \033[107m \033[0m \033[47m \033[107m \033[0m \033[47m \033[107m \033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/colorwheel b/scripts/colorscripts/colorwheel new file mode 100755 index 0000000..eb6af1e --- /dev/null +++ b/scripts/colorscripts/colorwheel @@ -0,0 +1,25 @@ +#!/bin/sh + +# |||||| +# |||||||||| +# |||||||||| +# |||||||||| +# |||||| + +# File: colorwheel.textart +# Description: {{des}} +# Author: Bastien Dejean +# └─ https://github.com/baskerville +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/stark/colorwheel.textart + + +# Start +echo -e "\n \033[49;35m|\033[49;31m|\033[101;31m|\033[41;97m|\033[49;91m|\033[49;93m|\033[0m +\033[105;35m|\033[45;97m|\033[49;97m||\033[100;97m||\033[49;37m||\033[103;33m|\033[43;97m|\033[0m +\033[49;95m|\033[49;94m|\033[100;37m||\033[40;97m||\033[40;37m||\033[49;33m|\033[49;32m|\033[0m +\033[104;34m|\033[44;97m|\033[49;90m||\033[40;39m||\033[49;39m||\033[102;32m|\033[42;97m|\033[0m + \033[49;34m|\033[49;36m|\033[106;36m|\033[46;97m|\033[49;96m|\033[49;92m|\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/crunch b/scripts/colorscripts/crunch new file mode 100755 index 0000000..9c062f3 --- /dev/null +++ b/scripts/colorscripts/crunch @@ -0,0 +1,18 @@ +#!/bin/sh + +# File: crunch.textart +# Description: {{des}} +# Author: Gutterslob +# └─ https://crunchbang.org/forums/profile.php?id=3763 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/crunch.textart + +# Start +echo -e "\n \033[41m \033[0m \033[41m \033[0m \033[42m \033[0m \033[42m \033[0m \033[43m \033[0m \033[43m \033[0m \033[44m \033[0m \033[44m \033[0m \033[45m \033[0m \033[45m \033[0m \033[46m \033[0m \033[46m \033[0m +\033[41m \033[0m \033[42m \033[0m \033[43m \033[0m \033[44m \033[0m \033[45m \033[0m \033[46m \033[0m + \033[41m \033[101m \033[41m \033[0m \033[42m \033[102m \033[42m \033[0m \033[43m \033[103m \033[43m \033[0m \033[44m \033[104m \033[44m \033[0m \033[45m \033[105m \033[45m \033[0m \033[46m \033[106m \033[46m \033[0m +\033[41m \033[0m \033[42m \033[0m \033[43m \033[0m \033[44m \033[0m \033[45m \033[0m \033[46m \033[0m + \033[41m \033[0m \033[41m \033[0m \033[42m \033[0m \033[42m \033[0m \033[43m \033[0m \033[43m \033[0m \033[44m \033[0m \033[44m \033[0m \033[45m \033[0m \033[45m \033[0m \033[46m \033[0m \033[46m \033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/crunchbang b/scripts/colorscripts/crunchbang new file mode 100755 index 0000000..0ee029b --- /dev/null +++ b/scripts/colorscripts/crunchbang @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# ANSI Color -- use these variables to easily have different color +# and format output. Make sure to output the reset sequence after +# colors (f = foreground, b = background), and use the 'off' +# feature for anything you turn on. + +initializeANSI() +{ + esc="" + + blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m" + yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m" + cyanf="${esc}[36m"; whitef="${esc}[37m" + + blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m" + yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m" + cyanb="${esc}[46m"; whiteb="${esc}[47m" + + boldon="${esc}[1m"; boldoff="${esc}[22m" + italicson="${esc}[3m"; italicsoff="${esc}[23m" + ulon="${esc}[4m"; uloff="${esc}[24m" + invon="${esc}[7m"; invoff="${esc}[27m" + + reset="${esc}[0m" +} + +# note in this first use that switching colors doesn't require a reset +# first - the new color overrides the old one. + +initializeANSI + +cat << EOF + + ${reset}${redf}▄█▄█▄ ${reset}${boldon}${redf}█ ${reset}${greenf}▄█▄█▄ ${reset}${boldon}${greenf}█ ${reset}${yellowf}▄█▄█▄ ${reset}${boldon}${yellowf}█ ${reset}${bluef}▄█▄█▄ ${reset}${boldon}${bluef}█ ${reset}${purplef}▄█▄█▄ ${reset}${boldon}${purplef}█ ${reset}${cyanf}▄█▄█▄ ${reset}${boldon}${cyanf}█${reset} + ${reset}${redf}▄█▄█▄ ${reset}${boldon}${redf}▀ ${reset}${greenf}▄█▄█▄ ${reset}${boldon}${greenf}▀ ${reset}${yellowf}▄█▄█▄ ${reset}${boldon}${yellowf}▀ ${reset}${bluef}▄█▄█▄ ${reset}${boldon}${bluef}▀ ${reset}${purplef}▄█▄█▄ ${reset}${boldon}${purplef}▀ ${reset}${cyanf}▄█▄█▄ ${reset}${boldon}${cyanf}▀${reset} + ${reset}${redf} ▀ ▀ ${reset}${boldon}${redf}▀ ${reset}${greenf} ▀ ▀ ${reset}${boldon}${greenf}▀ ${reset}${yellowf} ▀ ▀ ${reset}${boldon}${yellowf}▀ ${reset}${bluef} ▀ ▀ ${reset}${boldon}${bluef}▀ ${reset}${purplef} ▀ ▀ ${reset}${boldon}${purplef}▀ ${reset}${cyanf} ▀ ▀ ${reset}${boldon}${cyanf}▀${reset} + +EOF + diff --git a/scripts/colorscripts/dna b/scripts/colorscripts/dna new file mode 100755 index 0000000..6793c10 --- /dev/null +++ b/scripts/colorscripts/dna @@ -0,0 +1,31 @@ +#!/bin/sh + +# File: dna.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/dna.textart + +# Start +echo -e "\n \033[31m\\---\033[91m/\033[0m \033[32m\\---\033[92m/\033[0m \033[33m\\---\033[93m/\033[0m \033[34m\\---\033[94m/\033[0m \033[35m\\---\033[95m/\033[0m \033[36m\\---\033[96m/\033[0m + \033[31m\\-\033[91m/\033[0m \033[32m\\-\033[92m/\033[0m \033[33m\\-\033[93m/\033[0m \033[34m\\-\033[94m/\033[0m \033[35m\\-\033[95m/\033[0m \033[36m\\-\033[96m/\033[0m + \033[31m\\\\\033[0m \033[32m\\\\\033[0m \033[33m\\\\\033[0m \033[34m\\\\\033[0m \033[35m\\\\\033[0m \033[36m\\\\\033[0m + \033[91m/-\033[31m\\\\\033[0m \033[92m/-\033[32m\\\\\033[0m \033[93m/-\033[33m\\\\\033[0m \033[94m/-\033[34m\\\\\033[0m \033[95m/-\033[35m\\\\\033[0m \033[96m/-\033[36m\\\\\033[0m + \033[91m/---\033[31m\\\\\033[0m \033[92m/---\033[32m\\\\\033[0m \033[93m/---\033[33m\\\\\033[0m \033[94m/---\033[34m\\\\\033[0m \033[95m/---\033[35m\\\\\033[0m \033[96m/---\033[36m\\\\\033[0m +\033[91m(-----\033[31m)\033[0m \033[92m(-----\033[32m)\033[0m \033[93m(-----\033[33m)\033[0m \033[94m(-----\033[34m)\033[0m \033[95m(-----\033[35m)\033[0m \033[96m(-----\033[36m)\033[0m + \033[91m\\---\033[31m/\033[0m \033[92m\\---\033[32m/\033[0m \033[93m\\---\033[33m/\033[0m \033[94m\\---\033[34m/\033[0m \033[95m\\---\033[35m/\033[0m \033[96m\\---\033[36m/\033[0m + \033[91m\\-\033[31m/\033[0m \033[92m\\-\033[32m/\033[0m \033[93m\\-\033[33m/\033[0m \033[94m\\-\033[34m/\033[0m \033[95m\\-\033[35m/\033[0m \033[96m\\-\033[36m/\033[0m + \033[91m/\033[0m \033[92m/\033[0m \033[93m/\033[0m \033[94m/\033[0m \033[95m/\033[0m \033[96m/\033[0m + \033[31m/-\033[91m\\\\\033[0m \033[32m/-\033[92m\\\\\033[0m \033[33m/-\033[93m\\\\\033[0m \033[34m/-\033[94m\\\\\033[0m \033[35m/-\033[95m\\\\\033[0m \033[36m/-\033[96m\\\\\033[0m + \033[31m/---\033[91m\\\\\033[0m \033[32m/---\033[92m\\\\\033[0m \033[33m/---\033[93m\\\\\033[0m \033[34m/---\033[94m\\\\\033[0m \033[35m/---\033[95m\\\\\033[0m \033[36m/---\033[96m\\\\\033[0m +\033[31m(-----\033[91m)\033[0m \033[32m(-----\033[92m)\033[0m \033[33m(-----\033[93m)\033[0m \033[34m(-----\033[94m)\033[0m \033[35m(-----\033[95m)\033[0m \033[36m(-----\033[96m)\033[0m + \033[31m\\---\033[91m/\033[0m \033[32m\\---\033[92m/\033[0m \033[33m\\---\033[93m/\033[0m \033[34m\\---\033[94m/\033[0m \033[35m\\---\033[95m/\033[0m \033[36m\\---\033[96m/\033[0m + \033[31m\\-\033[91m/\033[0m \033[32m\\-\033[92m/\033[0m \033[33m\\-\033[93m/\033[0m \033[34m\\-\033[94m/\033[0m \033[35m\\-\033[95m/\033[0m \033[36m\\-\033[96m/\033[0m + \033[31m\\\\\033[0m \033[32m\\\\\033[0m \033[33m\\\\\033[0m \033[34m\\\\\033[0m \033[35m\\\\\033[0m \033[36m\\\\\033[0m + \033[91m/\033[0m \033[92m/\033[0m \033[93m/\033[0m \033[94m/\033[0m \033[95m/\033[0m \033[96m/\033[0m + \033[31m/-\033[91m\\\\\033[0m \033[32m/-\033[92m\\\\\033[0m \033[33m/-\033[93m\\\\\033[0m \033[34m/-\033[94m\\\\\033[0m \033[35m/-\033[95m\\\\\033[0m \033[36m/-\033[96m\\\\\033[0m + \033[31m/---\033[91m\\\\\033[0m \033[32m/---\033[92m\\\\\033[0m \033[33m/---\033[93m\\\\\033[0m \033[34m/---\033[94m\\\\\033[0m \033[35m/---\033[95m\\\\\033[0m \033[36m/---\033[96m\\\\\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/emwave b/scripts/colorscripts/emwave new file mode 100755 index 0000000..a4e0339 --- /dev/null +++ b/scripts/colorscripts/emwave @@ -0,0 +1,66 @@ +#!/bin/sh + +# /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ + +# File: emwave.textart +# Description: {{des}} +# Author: Ilya144 +# └─ https://github.com/ilya144 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/emwave.textart + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# Values +TEXT="${1:-/\\}" + +while [ "${#TEXTS}" -le '75' ]; do + TEXTS="$TEXTS$TEXT" +done + +TEXTS=$(printf '%s' "$TEXTS" | sed -e 's/^\(.\{75\}\).*/\1/') + + +# Start +i='0' + +while [ -n "$TEXTS" ]; do + charater=$(echo "$TEXTS" | sed -e 's/^\(.\{1\}\).*/\1/') + TEXTS="${TEXTS#?}" + + case "$charater" in + '\') charater='\\' ;; + '%') charater='%%' ;; + esac + + r=$(( 255 - ( i * ( 255 / 76 ) ) )) + g=$(( i * ( 512 / 76 ) )) + b=$(( i * ( 255 / 76 ) )) + + [ "$g" -gt 255 ] && g=$(( 510 - g )) + + rr=$(( 255 - r )) + gg=$(( 255 - g )) + bb=$(( 255 - b )) + + print="$print\033[48;2;${r};${g};${b}m\033[38;2;${rr};${gg};${bb}m$charater\033[0m" + + i=$(( i + 1 )) +done + +echo -e "$print" + +exit 0 diff --git a/scripts/colorscripts/faces b/scripts/colorscripts/faces new file mode 100755 index 0000000..9ce790d --- /dev/null +++ b/scripts/colorscripts/faces @@ -0,0 +1,19 @@ +#!/bin/sh + +# File: faces.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/faces.textart + +# Start +echo -e "\n╔══════════════════════════════════════════════════════════════════╗ +║ \033[31m▄█ █▄ \033[32m▄█ █▄ \033[33m▄█ █▄ \033[34m▄█ █▄ \033[35m▄█ █▄ \033[36m▄█ █▄ \033[0m║ +║ \033[91m▄█◄► ◄►█▄ \033[92m▄█◄► ◄►█▄ \033[93m▄█◄► ◄►█▄ \033[94m▄█◄► ◄►█▄ \033[95m▄█◄► ◄►█▄ \033[96m▄█◄► ◄►█▄ \033[0m║ +║ \033[91m▀█  █▀ \033[92m▀█  █▀ \033[93m▀█  █▀ \033[94m▀█  █▀ \033[95m▀█  █▀ \033[96m▀█  █▀ \033[0m║ +║ \033[31m▀█ █▀ \033[32m▀█ █▀ \033[33m▀█ █▀ \033[34m▀█ █▀ \033[35m▀█ █▀ \033[36m▀█ █▀ \033[0m║ +╚══════════════════════════════════════════════════════════════════╝\n" + +exit 0 diff --git a/scripts/colorscripts/fade b/scripts/colorscripts/fade new file mode 100755 index 0000000..20178f0 --- /dev/null +++ b/scripts/colorscripts/fade @@ -0,0 +1,16 @@ +#!/bin/sh + +# File: fade.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/fade.textart + +# Start +echo -e "\n\033[31m▒▒▒▒ \033[91m▒▒ \033[32m▒▒▒▒ \033[92m▒▒ \033[33m▒▒▒▒ \033[93m▒▒ \033[34m▒▒▒▒ \033[94m▒▒ \033[35m▒▒▒▒ \033[95m▒▒ \033[36m▒▒▒▒ \033[96m▒▒\033[0m +\033[31m▒▒ ■ \033[91m▒▒ \033[32m▒▒ ■ \033[92m▒▒ \033[33m▒▒ ■ \033[93m▒▒ \033[34m▒▒ ■ \033[94m▒▒ \033[35m▒▒ ■ \033[95m▒▒ \033[36m▒▒ ■ \033[96m▒▒\033[0m +\033[31m▒▒ \033[91m▒▒▒▒ \033[32m▒▒ \033[92m▒▒▒▒ \033[33m▒▒ \033[93m▒▒▒▒ \033[34m▒▒ \033[94m▒▒▒▒ \033[35m▒▒ \033[95m▒▒▒▒ \033[36m▒▒ \033[96m▒▒▒▒\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/ghosts b/scripts/colorscripts/ghosts new file mode 100755 index 0000000..d6ca312 --- /dev/null +++ b/scripts/colorscripts/ghosts @@ -0,0 +1,24 @@ +#!/bin/sh + +# File: ghosts.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/ghosts.textart + +# Start +echo -e "\n \033[31m▄▄▄ \033[32m▄▄▄ \033[33m▄▄▄ \033[34m▄▄▄ \033[35m▄▄▄ \033[36m▄▄▄\033[0m + \033[31m▀█▀██ ▄ \033[32m▀█▀██ ▄ \033[33m▀█▀██ ▄ \033[34m▀█▀██ ▄ \033[35m▀█▀██ ▄ \033[36m▀█▀██ ▄\033[0m +\033[31m▀▄██████▀ \033[32m▀▄██████▀ \033[33m▀▄██████▀ \033[34m▀▄██████▀ \033[35m▀▄██████▀ \033[36m▀▄██████▀\033[0m + \033[31m▀█████ \033[32m▀█████ \033[33m▀█████ \033[34m▀█████ \033[35m▀█████ \033[36m▀█████\033[0m + \033[31m▀▀▀▀▄ \033[32m▀▀▀▀▄ \033[33m▀▀▀▀▄ \033[34m▀▀▀▀▄ \033[35m▀▀▀▀▄ \033[36m▀▀▀▀▄\033[0m + + \033[91m▄▄▄ \033[92m▄▄▄ \033[93m▄▄▄ \033[94m▄▄▄ \033[95m▄▄▄ \033[96m▄▄▄\033[0m + \033[91m▀█▀██ ▄ \033[92m▀█▀██ ▄ \033[93m▀█▀██ ▄ \033[94m▀█▀██ ▄ \033[95m▀█▀██ ▄ \033[96m▀█▀██ ▄\033[0m +\033[91m▀▄██████▀ \033[92m▀▄██████▀ \033[93m▀▄██████▀ \033[94m▀▄██████▀ \033[95m▀▄██████▀ \033[96m▀▄██████▀\033[0m + \033[91m▀█████ \033[92m▀█████ \033[93m▀█████ \033[94m▀█████ \033[95m▀█████ \033[96m▀█████\033[0m + \033[91m▀▀▀▀▄ \033[92m▀▀▀▀▄ \033[93m▀▀▀▀▄ \033[94m▀▀▀▀▄ \033[95m▀▀▀▀▄ \033[96m▀▀▀▀▄\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/hedgehogs b/scripts/colorscripts/hedgehogs new file mode 100755 index 0000000..7ca4059 --- /dev/null +++ b/scripts/colorscripts/hedgehogs @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# ANSI color scheme script by github.com/joshdk + +red=$(printf '\e[31m') +grn=$(printf '\e[32m') +ylw=$(printf '\e[33m') +blu=$(printf '\e[34m') +mag=$(printf '\e[35m') +cya=$(printf '\e[36m') + +bld=$(printf '\e[1m') +rst=$(printf '\e[0m') + +cat << ART + +$red ╷╽╽╽╽╽╽╽╽╽╷ $grn ╷╽╽╽╽╽╽╽╽╽╷ $ylw ╷╽╽╽╽╽╽╽╽╽╷ $blu ╷╽╽╽╽╽╽╽╽╽╷ $mag ╷╽╽╽╽╽╽╽╽╽╷ $cya ╷╽╽╽╽╽╽╽╽╽╷ +$red ╽┃┃┃┃┃┃┃┃┃┃┃╽ $grn ╽┃┃┃┃┃┃┃┃┃┃┃╽ $ylw ╽┃┃┃┃┃┃┃┃┃┃┃╽ $blu ╽┃┃┃┃┃┃┃┃┃┃┃╽ $mag ╽┃┃┃┃┃┃┃┃┃┃┃╽ $cya ╽┃┃┃┃┃┃┃┃┃┃┃╽ +$red ┪┃┃┃┃┃┃┃┃┃┃' .\ $grn /. '✿┃┃┃┃┃┃┃┃┃┢ $ylw ┪┃┃┃┃┃┃┃┃┃┃' .\ $blu /. '✿┃┃┃┃┃┃┃┃┃┢ $mag ┪┃┃┃┃┃┃┃┃┃┃' .\ $cya /. '✿┃┃┃┃┃┃┃┃┃┢ +$red ╹┃┃┃┃┃┃┃┃⧓ ___• $grn •___ ┃┃┃┃┃┃┃┃┃╹ $ylw ╹┃┃┃┃┃┃┃┃⧓ ___• $blu •___ ┃┃┃┃┃┃┃┃┃╹ $mag ╹┃┃┃┃┃┃┃┃⧓ ___• $cya •___ ┃┃┃┃┃┃┃┃┃╹ +$bld +$red ╷╽╽╽╽╽╽╽╽╽╷ $grn ╷╽╽╽╽╽╽╽╽╽╷ $ylw ╷╽╽╽╽╽╽╽╽╽╷ $blu ╷╽╽╽╽╽╽╽╽╽╷ $mag ╷╽╽╽╽╽╽╽╽╽╷ $cya ╷╽╽╽╽╽╽╽╽╽╷ +$red ╽┃┃┃┃┃┃┃┃┃┃┃╽ $grn ╽┃┃┃┃┃┃┃┃┃┃┃╽ $ylw ╽┃┃┃┃┃┃┃┃┃┃┃╽ $blu ╽┃┃┃┃┃┃┃┃┃┃┃╽ $mag ╽┃┃┃┃┃┃┃┃┃┃┃╽ $cya ╽┃┃┃┃┃┃┃┃┃┃┃╽ +$red ┪┃┃┃┃┃┃┃┃┃✿' .\ $grn /. '┃┃┃┃┃┃┃┃┃┃┢ $ylw ┪┃┃┃┃┃┃┃┃┃✿' .\ $blu /. '┃┃┃┃┃┃┃┃┃┃┢ $mag ┪┃┃┃┃┃┃┃┃┃✿' .\ $cya /. '┃┃┃┃┃┃┃┃┃┃┢ +$red ╹┃┃┃┃┃┃┃┃┃ ___• $grn •___ ⧓┃┃┃┃┃┃┃┃╹ $ylw ╹┃┃┃┃┃┃┃┃┃ ___• $blu •___ ⧓┃┃┃┃┃┃┃┃╹ $mag ╹┃┃┃┃┃┃┃┃┃ ___• $cya •___ ⧓┃┃┃┃┃┃┃┃╹ +$rst +ART diff --git a/scripts/colorscripts/illumina b/scripts/colorscripts/illumina new file mode 100755 index 0000000..533a3a5 --- /dev/null +++ b/scripts/colorscripts/illumina @@ -0,0 +1,47 @@ +#!/bin/sh + +# ._________________________________. +# |▓▓▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░▒| +# |░▒ _ ▒░| +# |▓ //\ ▒| +# |▓ //-- // \ ========, ▒| +# |▒ // // \ / ▒| +# |▒ // // \ / ▒| +# |▒ __________ ___▒█__ _________▒| +# |▒ / \ █▒ // // ▓| +# |▒ / \ // // ▓| +# |▒ /__________________// ▓| +# |▓ \ // ▓| +# |▓ \// ▓| +# | ▒ " ▓█| +# |▓░ ░░░░░░░▓▓▓▓▓▓▓████████▓| +# '---------------------------------' + +# File: illumina.textart +# Description: {{des}} +# Author: Venam +# └─ https://venam.nixers.net/blog +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/stark/illumina.textart + + +# Start +echo -e "\n\033[1;33m._________________________________.\033[0m +\033[1;33m|\033[0;104;94m##\033[0m\033[46;36m########\033[106;96m#######\033[45;35m#######\033[105;95m#######\033[45;35m#\033[41;31m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;106;96m#\033[0m\033[44;34m#\033[0m \033[34m_ \033[101;91m#\033[105;95m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;104;94m#\033[0m \033[34m//\ \033[41;31m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;104;94m#\033[0m \033[32m/\033[1;32m/-- \033[0;34m/\033[1;34m/ \033[0;36m\ \033[32m========, \033[41;31m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;44;34m#\033[0m \033[32m/\033[1;32m/ \033[0;34m/\033[1;34m/ \033[0;36m\ \033[32m/ \033[101;91m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;44;34m#\033[0m \033[32m/\033[1;32m/ \033[0;34m/\033[1;34m/ \033[0;36m\ \033[32m/ \033[101;91m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;44;34m#\033[0m \033[1;31m__________ ___\033[41;31m#\033[107;97m#\033[0;31m__ _________\033[101;91m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;42;32m#\033[0m \033[32m/ \033[34m\ \033[47;37m#\033[101;91m#\033[0m \033[1;34m/\033[0;34m/ \033[1;32m/\033[0;32m/ \033[43;33m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;42;32m#\033[0m \033[32m/ \033[34m\ \033[1;34m/\033[0;34m/ \033[1;32m/\033[0;32m/ \033[43;33m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;42;32m#\033[0m \033[32m/__________________\033[1;32m/\033[0;32m/ \033[43;33m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;102;92m#\033[0m \033[34m\ \033[1;34m/\033[0;34m/ \033[103;93m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;102;92m#\033[0m \033[34m\\\\\033[1;34m/\033[0;34m/ \033[103;93m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;40;30m#\033[42;32m#\033[0m \033[1;34m\" \033[0;43;33m#\033[107;97m#\033[0;1;33m|\033[0m +\033[1;33m|\033[0;102;92m#\033[100;90m#\033[40;30m########\033[100;90m#######\033[47;37m#######\033[107;97m#######\033[47;37m#\033[103;93m#\033[0;1;33m|\033[0m +\033[1;33m'---------------------------------'\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/invaders b/scripts/colorscripts/invaders new file mode 100755 index 0000000..0ac5912 --- /dev/null +++ b/scripts/colorscripts/invaders @@ -0,0 +1,30 @@ +#!/bin/sh + +# File: space-invaders.textart +# Description: Space Invaders +# Author: Lolilolicon +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/space-invaders.textart + +# Start +echo -e "\n \033[31m▀▄ ▄▀ \033[32m▄▄▄████▄▄▄ \033[33m▄██▄ \033[34m▀▄ ▄▀ \033[35m▄▄▄████▄▄▄ \033[36m▄██▄\033[0m + \033[31m▄█▀███▀█▄ \033[32m███▀▀██▀▀███ \033[33m▄█▀██▀█▄ \033[34m▄█▀███▀█▄ \033[35m███▀▀██▀▀███ \033[36m▄█▀██▀█▄\033[0m +\033[31m█▀███████▀█ \033[32m▀▀███▀▀███▀▀ \033[33m▀█▀██▀█▀ \033[34m█▀███████▀█ \033[35m▀▀███▀▀███▀▀ \033[36m▀█▀██▀█▀\033[0m +\033[31m▀ ▀▄▄ ▄▄▀ ▀ \033[32m▀█▄ ▀▀ ▄█▀ \033[33m▀▄ ▄▀ \033[34m▀ ▀▄▄ ▄▄▀ ▀ \033[35m▀█▄ ▀▀ ▄█▀ \033[36m▀▄ ▄▀\033[0m + +\033[91m▄ ▀▄ ▄▀ ▄ \033[92m▄▄▄████▄▄▄ \033[93m▄██▄ \033[94m▄ ▀▄ ▄▀ ▄ \033[95m▄▄▄████▄▄▄ \033[96m▄██▄\033[0m +\033[91m█▄█▀███▀█▄█ \033[92m███▀▀██▀▀███ \033[93m▄█▀██▀█▄ \033[94m█▄█▀███▀█▄█ \033[95m███▀▀██▀▀███ \033[96m▄█▀██▀█▄\033[0m +\033[91m▀█████████▀ \033[92m▀▀▀██▀▀██▀▀▀ \033[93m▀▀█▀▀█▀▀ \033[94m▀█████████▀ \033[95m▀▀▀██▀▀██▀▀▀ \033[96m▀▀█▀▀█▀▀\033[0m + \033[91m▄▀ ▀▄ \033[92m▄▄▀▀ ▀▀ ▀▀▄▄ \033[93m▄▀▄▀▀▄▀▄ \033[94m▄▀ ▀▄ \033[95m▄▄▀▀ ▀▀ ▀▀▄▄ \033[96m▄▀▄▀▀▄▀▄\033[0m + + + \033[37m▌\033[0m + + \033[37m▌\033[0m + + \033[37m▄█▄\033[0m + \033[37m▄█████████▄\033[0m + \033[37m▀▀▀▀▀▀▀▀▀▀▀\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/mouseface b/scripts/colorscripts/mouseface new file mode 100755 index 0000000..4433fc7 --- /dev/null +++ b/scripts/colorscripts/mouseface @@ -0,0 +1,18 @@ +#!/bin/sh + +# File: mouseface2.textart +# Description: {{des}} +# Author: Ivo +# └─ https://crunchbang.org/forums/profile.php?id=10160 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/mouseface2.textart + +# Start +echo -e "\n \033[91m██ ██ \033[92m██ ██ \033[93m██ ██ \033[94m██ ██ \033[95m██ ██ \033[96m██ ██\033[0m +\033[91m█ \033[37m■\033[91m█ █\033[37m■ \033[91m█ \033[92m█ \033[37m■\033[92m█ █\033[37m■ \033[92m█ \033[93m█ \033[37m■\033[93m█ █\033[37m■ \033[93m█ \033[94m█ \033[37m■\033[94m█ █\033[37m■ \033[94m█ \033[95m█ \033[37m■\033[95m█ █\033[37m■ \033[95m█ \033[96m█ \033[37m■\033[96m█ █\033[37m■ \033[96m█\033[0m + \033[31m█ █ █ █ \033[32m█ █ █ █ \033[33m█ █ █ █ \033[34m█ █ █ █ \033[35m█ █ █ █ \033[36m█ █ █ █\033[0m + \033[31m█ █ █ \033[32m█ █ █ \033[33m█ █ █ \033[34m█ █ █ \033[35m█ █ █ \033[36m█ █ █\033[0m + \033[31m=■= \033[32m=■= \033[33m=■= \033[34m=■= \033[35m=■= \033[36m=■=\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/panes b/scripts/colorscripts/panes new file mode 100755 index 0000000..ad7c561 --- /dev/null +++ b/scripts/colorscripts/panes @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Author: GekkoP +# Source: http://linuxbbq.org/bbs/viewtopic.php?f=4&t=1656#p33189 + +f=3 b=4 +for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done +done +d=$'\e[1m' +t=$'\e[0m' +v=$'\e[7m' + +cat << EOF + + $f0████$d▄$t $f1████$d▄$t $f2████$d▄$t $f3████$d▄$t $f4████$d▄$t $f5████$d▄$t $f6████$d▄$t $f7████$d▄$t + $f0████$d█$t $f1████$d█$t $f2████$d█$t $f3████$d█$t $f4████$d█$t $f5████$d█$t $f6████$d█$t $f7████$d█$t + $f0████$d█$t $f1████$d█$t $f2████$d█$t $f3████$d█$t $f4████$d█$t $f5████$d█$t $f6████$d█$t $f7████$d█$t + $d$f0 ▀▀▀▀ $d$f1 ▀▀▀▀ $f2▀▀▀▀ $f3▀▀▀▀ $f4▀▀▀▀ $f5▀▀▀▀ $f6▀▀▀▀ $f7▀▀▀▀$t +EOF diff --git a/scripts/colorscripts/pipes b/scripts/colorscripts/pipes new file mode 100755 index 0000000..47c33ec --- /dev/null +++ b/scripts/colorscripts/pipes @@ -0,0 +1,142 @@ +#!/usr/bin/env bash +# pipes.sh: Animated pipes terminal screensaver. +# Copyleft (ↄ) 2015 - Acidhub +# 2015 - Pipeseroni - http://github.com/pipeseroni +# 2014 - Yu-Jie Lin +# ???? - Mathew Simpson +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +VERSION=1.2 + +M=32768 +p=3 +f=75 s=13 r=2000 t=0 +w=$(tput cols) h=$(tput lines) +# ab -> idx = a*4 + b +# 0: up, 1: right, 2: down, 3: left +# 00 means going up , then going up -> ┃ +# 12 means going right, then going down -> ┓ +sets=( + "┃┏ ┓┛━┓ ┗┃┛┗ ┏━" # -t 0 "default" + "│╭ ╮╯─╮ ╰│╯╰ ╭─" # -t 1 "round" + "│┌ ┐┘─┐ └│┘└ ┌─" # -t 2 "weak" + "║╔ ╗╝═╗ ╚║╝╚ ╔═" # -t 3 "double" + "|+ ++-+ +|++ +-" # -t 4 "add/sub" + "|/ \/-\ \|/\ /-" # -t 5 "It' something" + ".. .... .... .." # -t 6 "dots" + ".o oo.o o.oo o." # -t 7 "dot-O" + "-\ /\|/ /-\/ \|" # -t 8 "railway" + "▓≡▓≡≡▓≡ ≡▓≡≡▓≡▓" # -t 9 "blocks" +) +v=() +RNDSTART=0 +BOLD=1 +NOCOLOR=0 + +OPTIND=1 +while getopts "p:t:f:s:r:RBChv" arg; do +case $arg in + p) ((p=(OPTARG>0)?OPTARG:p));; + t) + if [[ "$OPTARG" = c???????????????? ]]; then + V+=(${#sets[@]}) + sets+=("${OPTARG:1}") + else + ((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG) + fi + ;; + f) ((f=(OPTARG>19 && OPTARG<101)?OPTARG:f));; + s) ((s=(OPTARG>4 && OPTARG<16 )?OPTARG:s));; + r) ((r=(OPTARG>=0)?OPTARG:r));; + R) RNDSTART=1;; + B) BOLD=0;; + C) NOCOLOR=1;; + h) echo -e "Usage: $(basename $0) [OPTION]..." + echo -e "Animated pipes terminal screensaver.\n" + echo -e " -p [1-?]\tnumber of pipes (D=3)." + echo -e " -t [0-$((${#sets[@]} - 1))]\ttype of pipes, can be used more than once (D=0)." + echo -e " -t c[16 chars]\tcustom type of pipes." + echo -e " -f [20-100]\tframerate (D=75)." + echo -e " -s [5-15]\tprobability of a straight fitting (D=13)." + echo -e " -r LIMIT\treset after x characters, 0 if no limit (D=2000)." + echo -e " -R \t\trandom starting point." + echo -e " -B \t\tno bold effect." + echo -e " -C \t\tno color." + echo -e " -h\t\thelp (this screen)." + echo -e " -v\t\tprint version number.\n" + exit 0;; + v) echo "$(basename -- "$0") $VERSION" + exit 0 + esac +done + +# set default values if not by options +((${#V[@]})) || V=(0) + +cleanup() { + # clear up standard input + read -t 0.001 && cat /dev/null + + # terminal has no smcup and rmcup capabilities + ((FORCE_RESET)) && reset && exit 0 + + tput rmcup + tput cnorm + stty echo + ((NOCOLOR)) && echo -ne '\e[0m' + exit 0 +} +trap cleanup HUP TERM +trap 'break 2' INT + +for (( i=1; i<=p; i++ )); do + c[i]=$((i%8)) n[i]=0 l[i]=0 + ((x[i]=RNDSTART==1?RANDOM*w/32768:w/2)) + ((y[i]=RNDSTART==1?RANDOM*h/32768:h/2)) + v[i]=${V[${#V[@]} * RANDOM / M]} +done + +stty -echo +tput smcup || FORCE_RESET=1 +tput civis +tput clear +# any key press exits the loop and this script +while REPLY=; read -t 0.0$((1000/f)) -n 1; [[ -z $REPLY ]] ; do + for (( i=1; i<=p; i++ )); do + # New position: + ((${l[i]}%2)) && ((x[i]+=-${l[i]}+2,1)) || ((y[i]+=${l[i]}-1)) + + # Loop on edges (change color on loop): + ((${x[i]}>w||${x[i]}<0||${y[i]}>h||${y[i]}<0)) && ((c[i]=RANDOM%8, v[i]=V[${#V[@]}*RANDOM/M])) + ((x[i]=(x[i]+w)%w)) + ((y[i]=(y[i]+h)%h)) + + # New random direction: + ((n[i]=RANDOM%s-1)) + ((n[i]=(${n[i]}>1||${n[i]}==0)?${l[i]}:${l[i]}+${n[i]})) + ((n[i]=(${n[i]}<0)?3:${n[i]}%4)) + + # Print: + tput cup ${y[i]} ${x[i]} + echo -ne "\e[${BOLD}m" + [[ $NOCOLOR == 0 ]] && echo -ne "\e[3${c[i]}m" + echo -n "${sets[v[i]]:l[i]*4+n[i]:1}" + l[i]=${n[i]} + done + ((r>0 && t*p>=r)) && tput reset && tput civis && t=0 || ((t++)) +done + +cleanup diff --git a/scripts/colorscripts/pipes3d b/scripts/colorscripts/pipes3d new file mode 100755 index 0000000..1423db9 --- /dev/null +++ b/scripts/colorscripts/pipes3d @@ -0,0 +1,187 @@ +#!/usr/bin/env bash +# Animated pipes.sh terminal screensaver at an angle. +# Copyright (C) 2013 by Yu-Jie Lin +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# Blog: http://blog.yjl.im/2013/07/pipesxsh-animated-pipessh-terminal.html +# Gist: https://gist.github.com/livibetter/5974905 +# Screenshot: https://lh3.googleusercontent.com/-UaCta_DtgrQ/Ud6dqIgcfmI/AAAAAAAAE_8/VXPac0OpULU/s800/pipesX.sh.gif +# Screenshot: https://lh6.googleusercontent.com/-yBety-A8J_c/Ud6dk10sjBI/AAAAAAAAE_0/S98aRRV8t0s/s800/pipesX.sh%25202013-07-11--19%253A51%253A05.png +# Screencast: http://youtu.be/dITTlFPYVPA + +W=$(tput cols) H=$(tput lines) +# maximal random value + 1 +M=32768 + +SETS=('╱╲' '/\') +COLORS=(31 32 33 34 35 36 37) + +# default values +N=1 +T=0 +I=0.05 +P=25 +R=$((W * H / 4)) + +HELP="Usage: $(basename $0) [OPTIONS] +Animated pipes.sh terminal screensaver at an angle. + +Options: + + -n [1-] number of pipes. (Default: $N) + -t [0-$((${#SETS[@]} - 1))] type of pipes. (Default: $T) + -i [float] piping interval or maze generation interval. (Default: $I) + -P [0-100] probability of a turning pipe or of \\ in maze generation. (Default: $P) + -r [LIMIT] reset after x characters, 0 if no limit. (Default: $R) + -R random starting point. + -C no color. + -X maze generation. + -h this help message. +" + +while getopts "n:t:i:P:r:RCXh" arg; do + case $arg in + n) + ((N = OPTARG > 0 ? OPTARG : N)) + ;; + t) + ((T = (OPTARG >= 0 && OPTARG < ${#SETS[@]}) ? OPTARG : T)) + ;; + i) + I=$OPTARG + ;; + P) + ((P = (OPTARG >= 0 && OPTARG <= 100) ? OPTARG : P)) + ;; + r) + ((R = OPTARG >= 0 ? OPTARG : R)) + ;; + R) + RNDSTART=1 + ;; + C) + NOCOLOR=1 + ;; + X) + MAZE=1 + ;; + h) + echo -e "$HELP" + exit 0 + ;; + esac +done + +do_exit() { + # Show cursor and echo stdin + echo -ne "\e[?25h" + stty echo + clear + exit 0 + } +trap do_exit INT TERM + +# No echo stdin and hide the cursor +stty -echo +echo -ne "\e[?25l" + +# maze geneartion +while [[ $MAZE ]] && clear; do + [[ $NOCOLOR ]] || echo -ne "\e[1;${COLORS[${#COLORS[@]} * RANDOM / M]}m" + for ((i = 0; i < W * H; i++ )); do + echo -ne ${SETS[T]:100 * RANDOM / M < P:1} + done + read -t $I -n 1 && [[ $REPLY =~ q|Q ]] && do_exit +done + +# initialze values +for ((n = 0; n < N; n++)); do + ((X[n] = RNDSTART ? (W + 2) * RANDOM / M : W / 2)) + ((Y[n] = RNDSTART ? (H + 2) * RANDOM / M : H / 2)) + D[n]=$((4 * RANDOM / M)) + C[n]=${COLORS[${#COLORS[@]} * RANDOM / M]} +done + +clear +while :; do + for ((n = 0; n < N; n++, CC = 0)); do + x=${X[n]} y=${Y[n]} + d=${D[n]} c=${C[n]} + + # calculate new direction `d` + # 1 0 + # \/ 4 directions 0 to 3 + # /\ + # 2 3 + # valid directions: d: dd', d' is the new direction + # d + # 0: / 00 \ 01 03 + # / / /\ + # 1: / 10 \ 11 12 + # \ \ /\ + # 2: \/ 21 / 22 / 23 + # / \ + # 3: \/ 30 \ 32 \ 33 + # / \ + ((d = (100 * RANDOM / M) < P ? ((d + 1) + 2 * (RANDOM % 2)) % 4 : d)) + ((e = (d + 1) % 4)) + + # calculate new position + # d' x' y' + # 0: x+1 y-1 + # 1: x-1 y-1 + # 2: x-1 y+1 + # 3: x+1 y+1 + ((xn = e < 2 ? x + 1 : x - 1)) + ((yn = d < 2 ? y - 1 : y + 1)) + + # adjust position and change color? + ((d < 2 && y == 0)) && ((yn--, CC=1)) + ((e > 1 && x == 0)) && ((xn--, CC=1)) + ((d > 1 && y == H)) && ((yn++, CC=1)) + ((e < 2 && x == W)) && ((xn++, CC=1)) + ((CC)) && c=${COLORS[${#COLORS[@]} * RANDOM / M]} + + # warp pipe + ((xn = (xn + W + 1) % (W + 1))) + ((yn = (yn + H + 1) % (H + 1))) + + # calculate position in terminal + # d' xt yt + # 0: x' y'+1 + # 1: x'+1 y'+1 + # 2: x'+1 y' + # 3: x' y' + ((xt = e < 2 ? xn : xn + 1)) + ((yt = d < 2 ? yn + 1 : yn)) + + echo -ne "\e[${yt};${xt}H" + [[ $NOCOLOR ]] || echo -ne "\e[1;${c}m" + echo -n "${SETS[T]:d%2:1}" + + X[n]=$xn Y[n]=$yn + D[n]=$d C[n]=$c + done + read -t $I -n 1 && [[ $REPLY =~ q|Q ]] && do_exit + ((R)) && ((r += N, r >= R)) && r=0 && clear +done + +do_exit + diff --git a/scripts/colorscripts/railcars b/scripts/colorscripts/railcars new file mode 100755 index 0000000..fc67a6f --- /dev/null +++ b/scripts/colorscripts/railcars @@ -0,0 +1,18 @@ +#!/bin/sh + +# File: rails.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/rails.textart + +# Start +echo -e "\n\033[31m╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ \033[32m╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ \033[33m╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗\033[0m +\033[1;31m╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ \033[32m╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ \033[33m╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝\033[0m + ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ +\033[34m╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ \033[35m╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗ \033[36m╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗\033[0m +\033[1;34m╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ \033[35m╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝ \033[36m╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/rally-x b/scripts/colorscripts/rally-x new file mode 100755 index 0000000..d4b821a --- /dev/null +++ b/scripts/colorscripts/rally-x @@ -0,0 +1,28 @@ +#!/bin/sh + +# File: rally-x.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/rally-x.textart + +# Start +echo -e "\n \033[33m▄ \033[31m▄▄ \033[32m▄▄ \033[34m▄▄ \033[35m▄▄ \033[36m▄▄\033[0m + \033[33m███▄▄ \033[31m██▬██▬██ \033[32m██▬██▬██ \033[34m██▬██▬██ \033[35m██▬██▬██ \033[36m██▬██▬██\033[0m + \033[33m█████▀▀ \033[31m████ \033[32m████ \033[34m████ \033[35m████ \033[36m████ \033[0m + \033[33m█▀▀ \033[31m▄██ ██▄ \033[32m▄██ ██▄ \033[34m▄██ ██▄ \033[35m▄██ ██▄ \033[36m▄██ ██▄\033[0m + \033[33m█ \033[31m▄▄▄▀█ █▀▄▄▄ \033[32m▄▄▄▀█ █▀▄▄▄ \033[34m▄▄▄▀█ █▀▄▄▄ \033[35m▄▄▄▀█ █▀▄▄▄ \033[36m▄▄▄▀█ █▀▄▄▄\033[0m +\033[33m▄█▄ \033[31m███▀████▀███ \033[32m███▀████▀███ \033[34m███▀████▀███ \033[35m███▀████▀███ \033[36m███▀████▀███\033[0m + \033[31m▀ ▀ \033[32m▀ ▀ \033[34m▀ ▀ \033[35m▀ ▀ \033[36m▀ ▀\033[0m + + \033[93m▄ \033[91m▄▄ \033[92m▄▄ \033[94m▄▄ \033[95m▄▄ \033[96m▄▄\033[0m + \033[93m███▄▄ \033[91m██▬██▬██ \033[92m██▬██▬██ \033[94m██▬██▬██ \033[95m██▬██▬██ \033[96m██▬██▬██\033[0m + \033[93m█████▀▀ \033[91m████ \033[92m████ \033[94m████ \033[95m████ \033[96m████ \033[0m + \033[93m█▀▀ \033[91m▄██ ██▄ \033[92m▄██ ██▄ \033[94m▄██ ██▄ \033[95m▄██ ██▄ \033[96m▄██ ██▄\033[0m + \033[93m█ \033[91m▄▄▄▀█ █▀▄▄▄ \033[92m▄▄▄▀█ █▀▄▄▄ \033[94m▄▄▄▀█ █▀▄▄▄ \033[95m▄▄▄▀█ █▀▄▄▄ \033[96m▄▄▄▀█ █▀▄▄▄\033[0m +\033[93m▄█▄ \033[91m███▀████▀███ \033[92m███▀████▀███ \033[94m███▀████▀███ \033[95m███▀████▀███ \033[96m███▀████▀███\033[0m + \033[91m▀ ▀ \033[92m▀ ▀ \033[94m▀ ▀ \033[95m▀ ▀ \033[96m▀ ▀\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/square b/scripts/colorscripts/square new file mode 100755 index 0000000..ba04e79 --- /dev/null +++ b/scripts/colorscripts/square @@ -0,0 +1,16 @@ +#!/bin/sh + +# File: square.textart +# Description: {{des}} +# Author: Muzieca +# └─ https://crunchbang.org/forums/profile.php?id=6838 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/square.textart + +# Start +echo -e "\n\033[31m▀ █ \033[91m█ ▀ \033[32m▀ █ \033[92m█ ▀ \033[33m▀ █ \033[93m█ ▀ \033[34m▀ █ \033[94m█ ▀ \033[35m▀ █ \033[95m█ ▀ \033[36m▀ █ \033[96m█ ▀\033[0m +\033[31m██ \033[91m██ \033[32m██ \033[92m██ \033[33m██ \033[93m██ \033[34m██ \033[94m██ \033[35m██ \033[95m██ \033[36m██ \033[96m██\033[0m +\033[31m▄ █ \033[91m█ ▄ \033[32m▄ █ \033[92m█ ▄ \033[33m▄ █ \033[93m█ ▄ \033[34m▄ █ \033[94m█ ▄ \033[35m▄ █ \033[95m█ ▄ \033[36m▄ █ \033[96m█ ▄\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/tanks b/scripts/colorscripts/tanks new file mode 100755 index 0000000..0876b2f --- /dev/null +++ b/scripts/colorscripts/tanks @@ -0,0 +1,24 @@ +#!/bin/sh + +# File: tanks.textart +# Description: {{des}} +# Author: Muzieca +# └─ https://crunchbang.org/forums/profile.php?id=6838 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/tanks.textart + +# Start +echo -e "\n \033[31m█ \033[32m█ \033[33m█ \033[34m█ \033[35m█ \033[36m█\033[0m +\033[31m▄▄ █ ▄▄ \033[32m▄▄ █ ▄▄ \033[33m▄▄ █ ▄▄ \033[34m▄▄ █ ▄▄ \033[35m▄▄ █ ▄▄ \033[36m▄▄ █ ▄▄\033[0m +\033[31m███▀▀▀███ \033[32m███▀▀▀███ \033[33m███▀▀▀███ \033[34m███▀▀▀███ \033[35m███▀▀▀███ \033[36m███▀▀▀███\033[0m +\033[31m███ █ ███ \033[32m███ █ ███ \033[33m███ █ ███ \033[34m███ █ ███ \033[35m███ █ ███ \033[36m███ █ ███\033[0m +\033[31m██ ▀▀▀ ██ \033[32m██ ▀▀▀ ██ \033[33m██ ▀▀▀ ██ \033[34m██ ▀▀▀ ██ \033[35m██ ▀▀▀ ██ \033[36m██ ▀▀▀ ██\033[0m + + \033[91m█ \033[92m█ \033[93m█ \033[94m█ \033[95m█ \033[96m█\033[0m +\033[91m▄▄ █ ▄▄ \033[92m▄▄ █ ▄▄ \033[93m▄▄ █ ▄▄ \033[94m▄▄ █ ▄▄ \033[95m▄▄ █ ▄▄ \033[96m▄▄ █ ▄▄\033[0m +\033[91m███▀▀▀███ \033[92m███▀▀▀███ \033[93m███▀▀▀███ \033[94m███▀▀▀███ \033[95m███▀▀▀███ \033[96m███▀▀▀███\033[0m +\033[91m███ █ ███ \033[92m███ █ ███ \033[93m███ █ ███ \033[94m███ █ ███ \033[95m███ █ ███ \033[96m███ █ ███\033[0m +\033[91m██ ▀▀▀ ██ \033[92m██ ▀▀▀ ██ \033[93m██ ▀▀▀ ██ \033[94m██ ▀▀▀ ██ \033[95m██ ▀▀▀ ██ \033[96m██ ▀▀▀ ██\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/tiefighter b/scripts/colorscripts/tiefighter new file mode 100755 index 0000000..5e70ed4 --- /dev/null +++ b/scripts/colorscripts/tiefighter @@ -0,0 +1,26 @@ +#!/bin/sh + +# File: tiefighter2.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/tiefighter2.textart + +# Start +echo -e "\n\033[31m█ █ \033[32m█ █ \033[33m█ █ \033[34m█ █ \033[35m█ █ \033[36m█ █\033[0m +\033[31m█ ▄▄▄ █ \033[32m█ ▄▄▄ █ \033[33m█ ▄▄▄ █ \033[34m█ ▄▄▄ █ \033[35m█ ▄▄▄ █ \033[36m█ ▄▄▄ █\033[0m +\033[31m█▄▄██▀██▄▄█ \033[32m█▄▄██▀██▄▄█ \033[33m█▄▄██▀██▄▄█ \033[34m█▄▄██▀██▄▄█ \033[35m█▄▄██▀██▄▄█ \033[36m█▄▄██▀██▄▄█\033[0m +\033[31m█▀▀█████▀▀█ \033[32m█▀▀█████▀▀█ \033[33m█▀▀█████▀▀█ \033[34m█▀▀█████▀▀█ \033[35m█▀▀█████▀▀█ \033[36m█▀▀█████▀▀█\033[0m +\033[31m█ ▀▀▀ █ \033[32m█ ▀▀▀ █ \033[33m█ ▀▀▀ █ \033[34m█ ▀▀▀ █ \033[35m█ ▀▀▀ █ \033[36m█ ▀▀▀ █\033[0m +\033[31m█ █ \033[32m█ █ \033[33m█ █ \033[34m█ █ \033[35m█ █ \033[36m█ █\033[0m + +\033[91m█ █ \033[92m█ █ \033[93m█ █ \033[94m█ █ \033[95m█ █ \033[96m█ █\033[0m +\033[91m█ ▄▄▄ █ \033[92m█ ▄▄▄ █ \033[93m█ ▄▄▄ █ \033[94m█ ▄▄▄ █ \033[95m█ ▄▄▄ █ \033[96m█ ▄▄▄ █\033[0m +\033[91m█▄▄██▀██▄▄█ \033[92m█▄▄██▀██▄▄█ \033[93m█▄▄██▀██▄▄█ \033[94m█▄▄██▀██▄▄█ \033[95m█▄▄██▀██▄▄█ \033[96m█▄▄██▀██▄▄█\033[0m +\033[91m█▀▀█████▀▀█ \033[92m█▀▀█████▀▀█ \033[93m█▀▀█████▀▀█ \033[94m█▀▀█████▀▀█ \033[95m█▀▀█████▀▀█ \033[96m█▀▀█████▀▀█\033[0m +\033[91m█ ▀▀▀ █ \033[92m█ ▀▀▀ █ \033[93m█ ▀▀▀ █ \033[94m█ ▀▀▀ █ \033[95m█ ▀▀▀ █ \033[96m█ ▀▀▀ █\033[0m +\033[91m█ █ \033[92m█ █ \033[93m█ █ \033[94m█ █ \033[95m█ █ \033[96m█ █\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/unix b/scripts/colorscripts/unix new file mode 100755 index 0000000..e2665b8 --- /dev/null +++ b/scripts/colorscripts/unix @@ -0,0 +1,58 @@ +#!/bin/sh + +# ,_ ,_==▄▂ +# , ▂▃▄▄▅▅▅▂▅¾. / / +# ▄▆<´ "»▓▓▓%\ / / / / +# ,▅7" ´>▓▓▓% / / > / >/% +# ▐¶▓ ,»▓▓¾´ /> %/%// / / +# ▓▃▅▅▅▃,,▄▅▅▅Æ// ///>// />/ / +# V║«¼.;→ ║<«.,`=// />//%/% / / +# //╠<´ -²,)(▓~"-╝/¾/ %/>/ /> +# / / / ▐% -./▄▃▄▅▐, /7//;//% / / +# / ////`▌▐ %zWv xX▓▇▌//&;% / / +# / / / %//%/¾½´▌▃▄▄▄▄▃▃▐¶/& / +# )VY>7; _ UNIX IS VERY SIMPLE IT JUST NEEDS A +# / /\033[38;5;255m\033[48;5;39m▓▓\033[38;5;199m\033[48;5;255m▓\033[0m\033[38;5;255m%% \033[38;5;20m/ \033[38;5;118m/ \033[38;5;199m> \033[38;5;118m/ \033[38;5;199m>\033[38;5;255m/\033[38;5;45m%%\033[0m + \033[38;5;255m▐\033[48;5;240m\033[38;5;255m¶\033[48;5;240m\033[38;5;255m▓\033[48;5;255m \033[38;5;196m,\033[38;5;34m»\033[48;5;201m\033[38;5;255m▓▓\033[0m\033[38;5;255m¾´\033[0m \033[38;5;199m/\033[38;5;255m> %%\033[38;5;199m/\033[38;5;118m%%\033[38;5;255m/\033[38;5;199m/ \033[38;5;45m/ \033[38;5;199m/\033[0m + \033[38;5;255m\033[48;5;240m▓\033[48;5;255m\033[38;5;16m▃\033[48;5;16m\033[38;5;255m▅▅\033[38;5;16m\033[48;5;255m▅▃,,\033[38;5;32m▄\033[38;5;16m▅\033[38;5;255m\033[48;5;16m▅▅\033[38;5;255m\033[48;5;20mÆ\033[0m\033[38;5;255m\\033[0m\033[38;5;20m/\033[38;5;118m/\033[38;5;255m /\033[38;5;118m/\033[38;5;199m/\033[38;5;255m>\033[38;5;45m// \033[38;5;255m/\033[38;5;118m>\033[38;5;199m/ \033[38;5;20m/\033[0m + \033[48;5;20m\033[38;5;255mV\033[48;5;255m\033[38;5;16m║\033[48;5;20m\033[38;5;255m«\033[0m\033[38;5;255m¼.;\033[48;5;240m\033[38;5;255m→\033[48;5;255m\033[38;5;16m ║\033[0m\033[38;5;255m<«.,\033[48;5;25m\033[38;5;255m\`\033[48;5;240m=\033[0m\033[38;5;20m/\033[38;5;199m/ \033[38;5;255m/>\033[38;5;45m/\033[38;5;118m/\033[38;5;255m%%/\033[38;5;199m%% / \033[38;5;20m/\033[0m + \033[38;5;20m//\033[48;5;255m\033[38;5;16m╠<´ -²,)\033[48;5;16m\033[38;5;255m(▓\033[48;5;255m\033[38;5;16m~\"-\033[38;5;199m╝/\033[0m\033[38;5;255m¾\033[0m\033[38;5;199m/ \033[38;5;118m%%\033[38;5;255m/\033[38;5;118m>\033[38;5;45m/ \033[38;5;118m/\033[38;5;199m>\033[0m + \033[38;5;20m/ / \033[38;5;118m/ \033[48;5;20m\033[38;5;255m▐\033[48;5;240m\033[38;5;16m%%\033[48;5;255m -./▄▃▄\033[48;5;16m\033[38;5;255m▅\033[48;5;255m\033[38;5;16m▐\033[48;5;255m\033[38;5;16m, \033[38;5;199m/\033[48;5;199m\033[38;5;255m7\033[0m\033[38;5;20m/\033[38;5;199m/\033[38;5;255m;/\033[38;5;199m/\033[38;5;118m%% \033[38;5;20m/ /\033[0m + \033[38;5;20m/ \033[38;5;199m/\033[38;5;255m/\033[38;5;45m/\033[38;5;118m/\033[38;5;255m\033[48;5;240m\`\033[48;5;20m\033[38;5;255m▌\033[48;5;20m\033[38;5;255m▐\033[48;5;255m\033[38;5;16m %%z\033[0m\033[38;5;255mWv xX\033[48;5;20m\033[38;5;255m▓\033[48;5;34m\033[38;5;255m▇\033[48;5;199m\033[38;255m▌\033[0m\033[38;5;20m/\033[38;5;199m/\033[38;5;255m&;\033[38;5;20m%% \033[38;5;199m/ \033[38;5;20m/\033[0m + \033[38;5;20m/ / \033[38;5;255m/ \033[38;5;118m%%\033[38;5;199m/\033[38;5;255m/%%/\033[48;5;240m\033[38;5;255m¾\033[48;5;255m\033[38;5;16m½´\033[38;5;255m\033[48;5;16m▌\033[0m\033[38;5;246m▃▄\033[38;5;255m▄▄\033[38;5;246m▄▃▃\033[0m\033[48;5;16m\033[38;5;255m▐\033[38;5;255m\033[48;5;199m¶\033[48;5;20m\033[38;5;255m\\033[0m\033[38;5;20m/\033[0m\033[48;5;255m\033[38;5;240m&\033[0m \033[38;5;20m/\033[0m + \033[38;5;199m<\033[38;5;118m/ \033[38;5;45m/\033[38;5;255m\033[38;5;255m)VY>\033[48;5;240m\033[38;5;255m7\033[0m\033[38;5;255m; \033[38;5;255m\033[48;5;240m\\033[0m\033[38;5;255m_\033[0m \033[38;5;255mUNIX IS VERY SIMPLE \033[38;5;45mIT JUST NEEDS A\033[0m + \033[38;5;20m/ \033[38;5;255m/\033[38;5;118m<\033[38;5;255m/ \033[38;5;45m/\033[38;5;255m/<\033[38;5;199m/\033[38;5;20m/\033[38;5;199m/\033[38;5;20m<\033[38;5;255m_/%%\\033[38;5;255m\033[48;5;16m▓\033[48;5;255m\033[38;5;16m V\033[0m\033[38;5;255m%%\033[48;5;255m\033[38;5;16mW\033[0m\033[38;5;255m%%£)XY\033[0m \033[38;5;240m_/%%\033[38;5;255m‾\_,\033[0m \033[38;5;45mGENIUS TO UNDERSTAND ITS SIMPLICITY\033[38;5;255m\033[0m + \033[38;5;199m/ \033[38;5;255m/ \033[38;5;199m/\033[38;5;255m/\033[38;5;118m%%\033[38;5;199m/\033[48;5;240m\033[38;5;255m_,=-\033[48;5;20m-^\033[0m\033[38;5;255m/%%/%%%%\033[48;5;255m\033[38;5;16m\¾%%\033[0m\033[38;5;255m¶\033[0m\033[48;5;255m\033[38;5;16m%%\033[0m\033[38;5;255m%%}\033[0m \033[38;5;240m/%%%%%%\033[38;5;20m%%%%\033[38;5;240m%%;\,\033[0m + \033[38;5;45m%%\033[38;5;20m/\033[38;5;199m< \033[38;5;20m/\033[48;5;20m\033[38;5;255m_/\033[48;5;240m \033[0m\033[38;5;255m%%%%%%\033[38;5;240m%%%%\033[38;5;20m;\033[38;5;255mX\033[38;5;240m%%\033[38;5;20m%%\033[38;5;255m\%%\033[38;5;240m%%;, _/%%%%%%;\033[38;5;20m,\033[38;5;240m \\033[0m + \033[38;5;118m/ \033[38;5;20m/ \033[38;5;240m%%\033[38;5;20m%%%%%%%%\033[38;5;240m%%;, \033[38;5;255m\\033[38;5;240m%%\033[38;5;20m%%\033[38;5;255ml\033[38;5;240m%%%%;// _/\033[38;5;20m%%;,\033[0m \033[38;5;234mdmr\033[0m +\033[38;5;20m/ \033[38;5;240m%%\033[38;5;20m%%%%;,\033[0m \033[38;5;255m<\033[38;5;20m;\033[38;5;240m\-=-/ /\033[0m + \033[38;5;20m;,\033[0m \033[38;5;240ml\033[0m\n" + +exit 0 diff --git a/scripts/colorscripts/zwaves b/scripts/colorscripts/zwaves new file mode 100755 index 0000000..b241140 --- /dev/null +++ b/scripts/colorscripts/zwaves @@ -0,0 +1,15 @@ +#!/bin/sh + +# File: zwaves.textart +# Description: {{des}} +# Author: Pfh +# └─ https://crunchbang.org/forums/profile.php?id=9103 +# Converted to textart: NNB +# └─ https://github.com/NNBnh +# URL: https://github.com/NNBnh/nnbs-text-art/blob/main/color/icon/zwaves.textart + +# Start +printf "\033[31m▀■▄ \033[32m▀■▄ \033[33m▀■▄ \033[34m▀■▄ \033[35m▀■▄ \033[36m▀■▄\033[0m + \033[91m▀■▄ \033[92m▀■▄ \033[93m▀■▄ \033[94m▀■▄ \033[95m▀■▄ \033[96m▀■▄\033[0m\n" + +exit 0 diff --git a/scripts/cpyfile b/scripts/cpyfile new file mode 100755 index 0000000..4842b7f --- /dev/null +++ b/scripts/cpyfile @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ -z "$1" ] + then + files=( $(find . -maxdepth 1 -type f | cut -c 3- | rofi -i -dmenu -p "Select a file to copy") ) + else + files=("$@") +fi + + +if [ -z "$files" ]; then + exit +fi + +args=() +for arg in "${files[@]}"; do + fullpath=$(readlink -f $arg) + args+=("file://$fullpath") +done + +printf '%s\n' "${args[@]}" | xclip -i -sel clipboard -t text/uri-list diff --git a/scripts/cpyout b/scripts/cpyout new file mode 100755 index 0000000..4145c00 --- /dev/null +++ b/scripts/cpyout @@ -0,0 +1,11 @@ +#!/bin/bash + +tmpfile=$(mktemp /tmp/cmd-output.XXXXXX) +trap 'rm "$tmpfile"' 0 1 15 +echo "\$ $@" | tee $tmpfile +eval "$@" |& tee -a $tmpfile + + +cat $tmpfile | xclip -sel c + + diff --git a/scripts/getlength b/scripts/getlength new file mode 100755 index 0000000..f07d6c1 --- /dev/null +++ b/scripts/getlength @@ -0,0 +1,2 @@ +date -u -d @`find . -maxdepth 1 -iname '*.mp4' -exec ffprobe -v quiet -of csv=p=0 -show_entries format=duration {} \; | paste -sd+ -| bc` +"%T" + diff --git a/scripts/git-rm-untracked b/scripts/git-rm-untracked new file mode 100755 index 0000000..a0cc80e --- /dev/null +++ b/scripts/git-rm-untracked @@ -0,0 +1,5 @@ +#!/bin/bash + + +git ls-files -o | xargs -t rm + diff --git a/scripts/keyboard_backlight.sh b/scripts/keyboard_backlight.sh new file mode 100755 index 0000000..e78553e --- /dev/null +++ b/scripts/keyboard_backlight.sh @@ -0,0 +1,25 @@ +#!/bin/bash + + + +brightness=`cat /sys/class/leds/asus::kbd_backlight/brightness` +max=3 +min=0 + + +if [ "$1" == "inc" ]; then + + brightness=`expr $brightness + 1` +else + brightness=`expr $brightness - 1` +fi + +if [ $brightness -gt 3 ]; then + brightness=3 +fi + +if [ $brightness -lt 0 ]; then + brightness=0 +fi + +echo $brightness > /sys/class/leds/asus::kbd_backlight/brightness diff --git a/scripts/lock-screen b/scripts/lock-screen new file mode 100755 index 0000000..6af9792 --- /dev/null +++ b/scripts/lock-screen @@ -0,0 +1,41 @@ +#!/bin/sh + +B='#00000000' # blank +C='#ffffff22' # clear ish +# D='#ff00ffcc' # default +# T='#ee00eeee' # text +# W='#880000bb' # wrong +# V='#bb00bbbb' # verifying + +D="$(xrdb -query | grep ".color12" | cut -d":" -f2 | xargs)cc" +T="$(xrdb -query | grep ".color13" | cut -d":" -f2 | xargs)ee" +W="$(xrdb -query | grep ".color1" | cut -d":" -f2 | xargs)bb" +V="$(xrdb -query | grep ".color6" | cut -d":" -f2 | xargs)bb" + + +i3lock \ +--insidever-color=$C \ +--ringver-color=$V \ +\ +--insidewrong-color=$C \ +--ringwrong-color=$W \ +\ +--inside-color=$B \ +--ring-color=$D \ +--line-color=$B \ +--separator-color=$D \ +\ +--verif-color=$T \ +--wrong-color=$T \ +--time-color=$T \ +--date-color=$T \ +--layout-color=$T \ +--keyhl-color=$W \ +--bshl-color=$W \ +\ +--blur 5 \ +--clock \ +--indicator \ +--time-str="%H:%M:%S" \ +--date-str="%A, %m %Y" \ +--keylayout 1 \ diff --git a/scripts/menu b/scripts/menu new file mode 100755 index 0000000..ae4c820 --- /dev/null +++ b/scripts/menu @@ -0,0 +1,9 @@ +#!/bin/bash +clear +figlet -f slant "Today's + menu" + + +cat ~/.cronresults/todaysmenu + +cowsay "Bon appetit!" diff --git a/scripts/rofi-bluetooth b/scripts/rofi-bluetooth new file mode 120000 index 0000000..8f71c5f --- /dev/null +++ b/scripts/rofi-bluetooth @@ -0,0 +1 @@ +/home/sahin/GitRepositories/rofi-bluetooth/rofi-bluetooth \ No newline at end of file diff --git a/scripts/rofi-wireguard b/scripts/rofi-wireguard new file mode 120000 index 0000000..8042369 --- /dev/null +++ b/scripts/rofi-wireguard @@ -0,0 +1 @@ +/home/sahin/GitRepositories/polybar-wireguard/rofi-wireguard \ No newline at end of file diff --git a/scripts/search-notes.sh b/scripts/search-notes.sh new file mode 100755 index 0000000..155433d --- /dev/null +++ b/scripts/search-notes.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +tmux popup \ + -w 90% \ + -h 90% \ + -x C \ + -y C \ + -E "/home/sahin/scripts/search-with-ag.sh" diff --git a/scripts/search-with-ag.sh b/scripts/search-with-ag.sh new file mode 100755 index 0000000..e19ad31 --- /dev/null +++ b/scripts/search-with-ag.sh @@ -0,0 +1,11 @@ +#!/bin/bash +result=$(ag --nobreak --nonumbers --noheading . ~/GitRepositories/til/ | fzf --ansi --preview='file=$(echo {} | cut -d':' -f1); bat --style=numbers,changes --wrap never --color always $file') + + +# do not use the following because it does not show anything if it can't find exact match inside the file. kills the point of fuzzy finding +# result=$(ag --nobreak --nonumbers --noheading . /home/sahin/PythonProjects/til/ | fzf --ansi --preview='file=$(echo {} | cut -d':' -f1); batgrep --color --context 100 {q} $file') + +if [ ! "$result" ];then + exit 0 +fi +/home/sahin/.local/bin/lvim $(echo $result | cut -d':' -f1) diff --git a/scripts/shrfile b/scripts/shrfile new file mode 100755 index 0000000..4899333 --- /dev/null +++ b/scripts/shrfile @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -z "$1" ] + then + file=$(find . -maxdepth 1 -type f | cut -c 3- | rofi -i -dmenu -p "Select file to share") + else + file=$1 +fi + +if [ -z "$file" ]; then + exit +fi +curl -F "file=@$file" https://0x0.st | xclip -selection c +notify-send "Link to $file is copied to clipboard!" +echo "$(xclip -o -sel clipboard)" diff --git a/scripts/shrout b/scripts/shrout new file mode 100755 index 0000000..ab8552f --- /dev/null +++ b/scripts/shrout @@ -0,0 +1,24 @@ +#!/bin/bash + +tmpfile=$(mktemp /tmp/cmd-output.XXXXXX) +trap 'rm "$tmpfile"' 0 1 15 +echo "\$ $@" | tee $tmpfile +eval "$@" |& tee -a $tmpfile + +read -p "Sharing output. [O]k, [e]dit, [d]iscard? " -n1 ans; + + +echo +case "$ans" in + o|O) ;; + e|E) $EDITOR $tmpfile + ;; + d|D) exit 0 + ;; + *) exit 1 + ;; +esac + +shrfile $tmpfile 2>/dev/null + + diff --git a/scripts/toggle-screenkey b/scripts/toggle-screenkey new file mode 100755 index 0000000..52de2f2 --- /dev/null +++ b/scripts/toggle-screenkey @@ -0,0 +1,11 @@ +#!/bin/bash + +num=$(ps aux | grep /usr/bin/screenkey | wc -l) + +if [[ $num -eq 1 ]]; then + screenkey & + notify-send "Screenkey enabled." +else + pkill screenkey + notify-send "Screenkey disabled." +fi diff --git a/scripts/toggle-touchpad.sh b/scripts/toggle-touchpad.sh new file mode 100755 index 0000000..a671074 --- /dev/null +++ b/scripts/toggle-touchpad.sh @@ -0,0 +1,11 @@ +export `xinput list | grep -i touchpad | awk '{ print $6 }'` +TOUCH_ENABLED=`xinput list-props $id | grep Device\ Enabled | awk '{ print $4 }'` +if [ $TOUCH_ENABLED = 0 ]; then + xinput set-prop $id "Device Enabled" 1 +elif [ $TOUCH_ENABLED = 1 ]; then + xinput set-prop $id "Device Enabled" 0 +else + echo "Could not get touchpad status from xinput" + exit 1 +fi +exit 0 diff --git a/scripts/webcam b/scripts/webcam new file mode 100755 index 0000000..aeccfd3 --- /dev/null +++ b/scripts/webcam @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ -z "$1" ] + then + res="300" + else + res=$1 +fi + +v4l2-ctl --set-fmt-video=width=$res,height=$res +mpv /dev/video0 + diff --git a/scripts/whereami b/scripts/whereami new file mode 100755 index 0000000..8db931c --- /dev/null +++ b/scripts/whereami @@ -0,0 +1,5 @@ +#!/bin/bash + +res=$(curl -s "http://ip-api.com/json/" 2>/dev/null) +# echo $res | jq '.' +echo $res | jq -r -j '.city, ", ", .country, "\n"'