From: Daniel Liu Date: Fri, 27 Nov 2020 05:24:55 +0000 (-0500) Subject: init X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=14d61ce32ff2cdca6af3accb75840abcaaf558ef;p=dotfiles.git init --- 14d61ce32ff2cdca6af3accb75840abcaaf558ef diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..ba448d0 --- /dev/null +++ b/.Xresources @@ -0,0 +1,60 @@ +*.font: Source Code Pro:size=12 + +#define nord0 #2E3440 +#define nord1 #3B4252 +#define nord2 #434C5E +#define nord3 #4C566A +#define nord4 #D8DEE9 +#define nord5 #E5E9F0 +#define nord6 #ECEFF4 +#define nord7 #8FBCBB +#define nord8 #88C0D0 +#define nord9 #81A1C1 +#define nord10 #5E81AC +#define nord11 #BF616A +#define nord12 #D08770 +#define nord13 #EBCB8B +#define nord14 #A3BE8C +#define nord15 #B48EAD + +*.foreground: nord4 +*.background: nord0 +*.cursorColor: nord4 +*.termname: st-256color + +*.borderpx: 5 +*.normbordercolor: nord0 +*.selbordercolor: nord6 + +*.normbgcolor: nord0 +*.selbgcolor: nord8 + +*.selfgcolor: nord0 + +*.color0: nord1 +*.color1: nord11 +*.color2: nord14 +*.color3: nord13 +*.color4: nord9 +*.color5: nord15 +*.color6: nord8 +*.color7: nord5 +*.color8: nord3 +*.color9: nord11 +*.color10: nord14 +*.color11: nord13 +*.color12: nord9 +*.color13: nord15 +*.color14: nord7 +*.color15: nord6 + +# dmenu +dmenu.selbackground: nord8 + +# herbe +herbe.background_color: nord0 +herbe.font_pattern: Source Code Pro:size=10 +herbe.width: 300 +herbe.pos_x: 20 +herbe.pos_y: 50 + diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..20289aa --- /dev/null +++ b/.bashrc @@ -0,0 +1,101 @@ +# _ _ +# | |__ __ _ ___| |__ _ __ ___ +# | '_ \ / _` / __| '_ \| '__/ __| +# _| |_) | (_| \__ \ | | | | | (__ +# (_)_.__/ \__,_|___/_| |_|_| \___| +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# prompt lmao +PS1=' λ_ \W > ' + +#set vi mode +set -o vi + +# ibus +export GTK_IM_MODULE=ibus +export XMODIFIERS=@im=ibus +export QT_IM_MODULE=ibus +#ibus-daemon -drx + +# Enivormentals +export PATH=$HOME/Scripts:$HOME/Scripts/dmenu:$HOME/Scripts/statusbar:$PATH + +export XDG_CONFIG_HOME=$HOME/.config +export EDITOR="vim" +export READER="zathura" +export TERMINAL="st" +export BROWSER="brave" +export WM="dwm" + +# aliaseseses +alias ls='ls --color=auto' +alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' +alias suckless-clean='make clean && rm -rf config.h && git reset --hard home/master' +alias musicdl="youtube-dl -f bestaudio -o ~/Music/%(title)s.%(ext)s" +alias mpv="mpv --no-input-default-bindings" +alias slock='slock -m "$(figlet locked xd | cowsay -f cheese -n)"' + +source fzfutil + +export LF_ICONS="\ +di=:\ +fi=:\ +ln=:\ +or=:\ +ex=:\ +*.c=:\ +*.cc=:\ +*.cpp=:\ +*.go=:\ +*.hs=:\ +*.java=:\ +*.html=:\ +*.css=:\ +*.js=:\ +*.ts=:\ +*.json=:\ +*.jsx=:\ +*.tsx=:\ +*.vue=﵂:\ +*.php=:\ +*.py=:\ +*.rkt=λ:\ +*.tex=:\ +*.md=:\ +*.vim=:\ +*.vimrc=:\ +*.viminfo=:\ +*.gitignore=:\ +*.cmd=:\ +*.sh=:\ +*.bash=:\ +*.zsh=:\ +*.fish=:\ +*.diff=繁:\ +*.bashrc= +*.tar=:\ +*.zip=:\ +*.jar=:\ +*.rar=:\ +*.7z=:\ +*.gz=:\ +*.zst=:\ +*.jpg=:\ +*.jpeg=:\ +*.gif=:\ +*.bmp=:\ +*.png=:\ +*.svg=:\ +*.mov=:\ +*.webm=:\ +*.mp4=:\ +*.mid=:\ +*.midi=:\ +*.mp3=:\ +*.ogg=:\ +*.wav=:\ +*.pdf=:\ +" diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..35ecfab --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1,60 @@ + +# unmap some stuff +map d + + + +set icons true +set hidden true +map . set hidden! + +set shell sh +set shellopts '-eu' +set ifs "\n" + +# leave some space at the top and the bottom of the screen +set scrolloff 10 + +# use enter for shell commands +map shell + +map dd delete + +# =-=-=-=-= custom 'go to' commands + +# school +map gs. cd ~/School +map gsc cd ~/School/cs145 +map gsm5 cd ~/School/math135 +map gsm7 cd ~/School/math137 +map gsp cd ~/School/phys121 +map gss cd ~/School/spcom223 + +# config +map gc. cd ~/.config + +# music +map gm. cd ~/Music +map gd. cd ~/Downloads + +# install +map gi. cd ~/installs + +# repos +map gr. cd ~/Repos + +# define a custom 'open' command +# This command is called when current file is not a directory. You may want to +# use either file extensions and/or mime types here. Below uses an editor for +# text files and a file opener for the rest. +cmd open ${{ + case $(file --mime-type $f -b) in + text/*) $EDITOR $fx;; + *) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;; + esac +}} + +cmd mkdir % echo "New directory name:"; read dirname; mkdir $dirname + +cmd touch %echo "New file name:"; read filename; touch $filename + diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf new file mode 100644 index 0000000..4223453 --- /dev/null +++ b/.config/mpd/mpd.conf @@ -0,0 +1,29 @@ +music_directory "~/Music" +playlist_directory "~/.config/mpd/playlists" + +db_file "~/.config/mpd/database" +log_file "~/.config/mpd/log" +pid_file "~/.config/mpd/pid" +state_file "~/.config/mpd/state" +sticker_file "~/.config/mpd/sticker.sql" + +bind_to_address "127.0.0.1" + +log_level "default" +restore_paused "yes" +save_absolute_paths_in_playlists "no" +metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" +auto_update "yes" + +audio_output { + type "alsa" + name "ALSA sound card" +} + +audio_output { + type "fifo" + name "togge_visualizer" + path "/tmp/mpd.fifo" + format "44100:16:2" +} + diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf new file mode 100644 index 0000000..bb96d58 --- /dev/null +++ b/.config/mpv/input.conf @@ -0,0 +1,189 @@ +# 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 on/off +#MBTN_RIGHT cycle pause # toggle pause on/off +#MBTN_BACK playlist-prev +#MBTN_FORWARD playlist-next + +# 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 +#WHEEL_DOWN seek -10 +#WHEEL_LEFT add volume -2 +#WHEEL_RIGHT add volume 2 + +## Seek units are in seconds, but note that these are limited by keyframes +l seek 5 exact +h seek -5 exact +#UP seek 60 +#DOWN seek -60 +# 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 +#Shift+LEFT no-osd seek -1 exact +#Shift+UP no-osd seek 5 exact +#Shift+DOWN no-osd seek -5 exact +# Skip to previous/next subtitle (subject to some restrictions; see manpage) +#Ctrl+LEFT no-osd sub-seek -1 +#Ctrl+RIGHT no-osd sub-seek 1 +# Adjust timing to previous/next subtitle +#Ctrl+Shift+LEFT sub-step -1 +#Ctrl+Shift+RIGHT sub-step 1 +# Move video rectangle +#Alt+left add video-pan-x 0.1 +#Alt+right add video-pan-x -0.1 +#Alt+up add video-pan-y 0.1 +#Alt+down add video-pan-y -0.1 +# Zoom/unzoom video +Alt+= add video-zoom 0.1 +Alt+- add video-zoom -0.1 +# Reset video zoom/pan settings +#Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 +#PGUP add chapter 1 # skip to next chapter +#PGDWN add chapter -1 # skip to previous chapter +#Shift+PGUP seek 600 +#Shift+PGDWN seek -600 +[ multiply speed 1/1.1 # scale playback speed +] multiply speed 1.1 +{ multiply speed 0.5 +} multiply speed 2.0 +#BS set speed 1.0 # reset speed to normal +#Shift+BS revert-seek # undo previous (or marked) seek +#Shift+Ctrl+BS revert-seek mark # mark position for revert-seek +q quit +Q quit-watch-later +#q {encode} quit 4 +#ESC set fullscreen no +#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 +#> playlist-next # skip to next file +#ENTER playlist-next # skip to next file +#< playlist-prev # skip to previous file +#O no-osd cycle-values osd-level 3 1 # cycle through OSD mode +o show-progress +#P show-progress +#i script-binding stats/display-stats +#I script-binding stats/display-stats-toggle +#` script-binding console/enable +#z add sub-delay -0.1 # subtract 100 ms delay from subs +#Z add sub-delay +0.1 # add +#x add sub-delay +0.1 # same as previous binding (discouraged) +#ctrl++ add audio-delay 0.100 # this changes audio/video sync +#ctrl+- add audio-delay -0.100 +#9 add volume -2 +#/ add volume -2 +#0 add volume 2 +#* add volume 2 +#m cycle 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 window-scale 0.5 +#Alt+1 set window-scale 1.0 +#Alt+2 set window-scale 2.0 +# toggle deinterlacer (automatically inserts or removes required filter) +#d cycle deinterlace +#r add sub-pos -1 # move subtitles up +#R add sub-pos +1 # down +#t add sub-pos +1 # same as previous binding (discouraged) +#v cycle sub-visibility +# stretch SSA/ASS subtitles with anamorphic videos to match historical +#V cycle sub-ass-vsfilter-aspect-compat +# switch between applying no style overrides to SSA/ASS subtitles, and +# overriding them almost completely with the normal subtitle style +#u cycle-values sub-ass-override "force" "no" +#j cycle sub # cycle through subtitles +#J cycle sub down # ...backwards +#SHARP cycle audio # switch audio streams +#_ cycle video +#T cycle ontop # toggle video window ontop of other windows +#f cycle fullscreen # toggle fullscreen +#s screenshot # take a screenshot +#S screenshot video # ...without subtitles +#Ctrl+s screenshot window # ...with subtitles and OSD, and scaled +#Alt+s screenshot each-frame # automatically screenshot every frame +#w add panscan -0.1 # zoom out with -panscan 0 -fs +#W add panscan +0.1 # in +#e add panscan +0.1 # same as previous binding (discouraged) +# cycle video aspect ratios; "-1" is the container aspect +#A cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1" +#POWER quit +#PLAY cycle pause +#PAUSE cycle pause +#PLAYPAUSE cycle pause +#PLAYONLY set pause no +#PAUSEONLY set pause yes +#STOP quit +#FORWARD seek 60 +#REWIND seek -60 +#NEXT playlist-next +#PREV playlist-prev +#VOLUME_UP add volume 2 +#VOLUME_DOWN add volume -2 +#MUTE cycle mute +#CLOSE_WIN quit +#CLOSE_WIN {encode} quit 4 +#E cycle edition # next 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 display +#ctrl+h cycle-values hwdec "auto" "no" # cycle hardware decoding +#F8 show_text ${playlist} # show playlist +#F9 show_text ${track-list} # show list of audio/sub streams + +# +# Legacy bindings (may or may not be removed in the future) +# +#! add chapter -1 # skip to previous chapter +#@ add chapter 1 # next + +# +# Not assigned by default +# (not an exhaustive list of unbound commands) +# + +# ? add sub-scale +0.1 # increase subtitle font size +# ? add sub-scale -0.1 # decrease subtitle font size +# ? cycle angle # switch DVD/Bluray angle +# ? cycle sub-forced-only # toggle DVD forced subs +# ? cycle program # cycle transport stream programs +# ? stop # stop playback (quit or enter idle mode) diff --git a/.config/ncmpcpp/bindings b/.config/ncmpcpp/bindings new file mode 100644 index 0000000..9a40691 --- /dev/null +++ b/.config/ncmpcpp/bindings @@ -0,0 +1,544 @@ +############################################################## +## This is the example bindings file. Copy it to ## +## ~/.ncmpcpp/bindings or $XDG_CONFIG_HOME/ncmpcpp/bindings ## +## and set up your preferences ## +############################################################## +## +##### General rules ##### +## +## 1) Because each action has runtime checks whether it's +## ok to run it, a few actions can be bound to one key. +## Actions will be bound in order given in configuration +## file. When a key is pressed, first action in order +## will test itself whether it's possible to run it. If +## test succeeds, action is executed and other actions +## bound to this key are ignored. If it doesn't, next +## action in order tests itself etc. +## +## 2) It's possible to bind more that one action at once +## to a key. It can be done using the following syntax: +## +## def_key "key" +## action1 +## action2 +## ... +## +## This creates a chain of actions. When such chain is +## executed, each action in chain is run until the end of +## chain is reached or one of its actions fails to execute +## due to its requirements not being met. If multiple actions +## and/or chains are bound to the same key, they will be +## consecutively run until one of them gets fully executed. +## +## 3) When ncmpcpp starts, bindings configuration file is +## parsed and then ncmpcpp provides "missing pieces" +## of default keybindings. If you want to disable some +## bindings, there is a special action called 'dummy' +## for that purpose. Eg. if you want to disable ability +## to crop playlists, you need to put the following +## into configuration file: +## +## def_key "C" +## dummy +## +## After that ncmpcpp will not bind any default action +## to this key. +## +## 4) To let you write simple macros, the following special +## actions are provided: +## +## - push_character "character" - pushes given special +## character into input queue, so it will be immediately +## picked by ncmpcpp upon next call to readKey function. +## Accepted values: mouse, up, down, page_up, page_down, +## home, end, space, enter, insert, delete, left, right, +## tab, ctrl-a, ctrl-b, ..., ctrl-z, ctrl-[, ctrl-\\, +## ctrl-], ctrl-^, ctrl-_, f1, f2, ..., f12, backspace. +## In addition, most of these names can be prefixed with +## alt-/ctrl-/shift- to be recognized with the appropriate +## modifier key(s). +## +## - push_characters "string" - pushes given string into +## input queue. +## +## - require_runnable "action" - checks whether given action +## is runnable and fails if it isn't. This is especially +## useful when mixed with previous two functions. Consider +## the following macro definition: +## +## def_key "key" +## push_characters "custom_filter" +## apply_filter +## +## If apply_filter can't be currently run, we end up with +## sequence of characters in input queue which will be +## treated just as we typed them. This may lead to unexpected +## results (in this case 'c' will most likely clear current +## playlist, 'u' will trigger database update, 's' will stop +## playback etc.). To prevent such thing from happening, we +## need to change above definition to this one: +## +## def_key "key" +## require_runnable "apply_filter" +## push_characters "custom_filter" +## apply_filter +## +## Here, first we test whether apply_filter can be actually run +## before we stuff characters into input queue, so if condition +## is not met, whole chain is aborted and we're fine. +## +## - require_screen "screen" - checks whether given screen is +## currently active. accepted values: browser, clock, help, +## media_library, outputs, playlist, playlist_editor, +## search_engine, tag_editor, visualizer, last_fm, lyrics, +## selected_items_adder, server_info, song_info, +## sort_playlist_dialog, tiny_tag_editor. +## +## - run_external_command "command" - runs given command using +## system() function. +## +## 5) In addition to binding to a key, you can also bind actions +## or chains of actions to a command. If it comes to commands, +## syntax is very similar to defining keys. Here goes example +## definition of a command: +## +## def_command "quit" [deferred] +## stop +## quit +## +## If you execute the above command (which can be done by +## invoking action execute_command, typing 'quit' and pressing +## enter), ncmpcpp will stop the player and then quit. Note the +## presence of word 'deferred' enclosed in square brackets. It +## tells ncmpcpp to wait for confirmation (ie. pressing enter) +## after you typed quit. Instead of 'deferred', 'immediate' +## could be used. Then ncmpcpp will not wait for confirmation +## (enter) and will execute the command the moment it sees it. +## +## Note: while command chains are executed, internal environment +## update (which includes current window refresh and mpd status +## update) is not performed for performance reasons. However, it +## may be desirable to do so in some situration. Therefore it's +## possible to invoke by hand by performing 'update enviroment' +## action. +## +## Note: There is a difference between: +## +## def_key "key" +## action1 +## +## def_key "key" +## action2 +## +## and +## +## def_key "key" +## action1 +## action2 +## +## First one binds two single actions to the same key whilst +## second one defines a chain of actions. The behavior of +## these two is different and is described in (1) and (2). +## +## Note: Function def_key accepts non-ascii characters. +## +##### List of unbound actions ##### +## +## The following actions are not bound to any key/command: +## +## - set_volume +## + + +#def_key "mouse" +# mouse_event +# +def_key "k" + scroll_up +# +#def_key "shift-up" +# select_item +# scroll_up +# +def_key "j" + scroll_down +# +#def_key "shift-down" +# select_item +# scroll_down +# +#def_key "[" +# scroll_up_album +# +#def_key "]" +# scroll_down_album +# +#def_key "{" +# scroll_up_artist +# +#def_key "}" +# scroll_down_artist +# +def_key "ctrl-u" + page_up +# +def_key "ctrl-d" + page_down +# +#def_key "home" +# move_home +# +#def_key "end" +# move_end +# +#def_key "insert" +# select_item +# +#def_key "enter" +# enter_directory +# +#def_key "enter" +# toggle_output +# +#def_key "enter" +# run_action +# +#def_key "enter" +# play_item +# +#def_key "space" +# add_item_to_playlist +# +#def_key "space" +# toggle_lyrics_update_on_song_change +# +#def_key "space" +# toggle_visualization_type +# +def_key "d" + delete_playlist_items + +def_key "d" + delete_browser_items + +def_key "d" + delete_stored_playlist + +def_key "l" + next_column +# +#def_key "right" +# slave_screen +# +#def_key "right" +# volume_up +# +#def_key "+" +# volume_up +# +def_key "h" + previous_column +# +#def_key "left" +# master_screen +# +#def_key "left" +# volume_down +# +#def_key "-" +# volume_down +# +#def_key ":" +# execute_command +# +#def_key "tab" +# next_screen +# +#def_key "shift-tab" +# previous_screen +# +#def_key "f1" +# show_help +# +#def_key "1" +# show_playlist +# +#def_key "2" +# show_browser +# +#def_key "2" +# change_browse_mode +# +#def_key "3" +# show_search_engine +# +#def_key "3" +# reset_search_engine +# +#def_key "4" +# show_media_library +# +#def_key "4" +# toggle_media_library_columns_mode +# +#def_key "5" +# show_playlist_editor +# +#def_key "6" +# show_tag_editor +# +#def_key "7" +# show_outputs +# +#def_key "8" +# show_visualizer +# +#def_key "=" +# show_clock +# +#def_key "@" +# show_server_info +# +#def_key "s" +# stop +# +#def_key "p" +# pause +# +#def_key ">" +# next +# +#def_key "<" +# previous +# +#def_key "ctrl-h" +# jump_to_parent_directory +# +#def_key "ctrl-h" +# replay_song +# +#def_key "backspace" +# jump_to_parent_directory +# +#def_key "backspace" +# replay_song +# +#def_key "f" +# seek_forward +# +#def_key "b" +# seek_backward +# +#def_key "r" +# toggle_repeat +# +#def_key "z" +# toggle_random +# +#def_key "y" +# save_tag_changes +# +#def_key "y" +# start_searching +# +#def_key "y" +# toggle_single +# +#def_key "R" +# toggle_consume +# +#def_key "Y" +# toggle_replay_gain_mode +# +#def_key "T" +# toggle_add_mode +# +#def_key "|" +# toggle_mouse +# +#def_key "#" +# toggle_bitrate_visibility +# +#def_key "Z" +# shuffle +# +#def_key "x" +# toggle_crossfade +# +#def_key "X" +# set_crossfade +# +#def_key "u" +# update_database +# +#def_key "ctrl-s" +# sort_playlist +# +#def_key "ctrl-s" +# toggle_browser_sort_mode +# +#def_key "ctrl-s" +# toggle_media_library_sort_mode +# +#def_key "ctrl-r" +# reverse_playlist +# +#def_key "ctrl-f" +# apply_filter +# +#def_key "ctrl-_" +# select_found_items +# +#def_key "/" +# find +# +#def_key "/" +# find_item_forward +# +#def_key "?" +# find +# +#def_key "?" +# find_item_backward +# +#def_key "." +# next_found_item +# +#def_key "," +# previous_found_item +# +#def_key "w" +# toggle_find_mode +# +#def_key "e" +# edit_song +# +#def_key "e" +# edit_library_tag +# +#def_key "e" +# edit_library_album +# +#def_key "e" +# edit_directory_name +# +#def_key "e" +# edit_playlist_name +# +#def_key "e" +# edit_lyrics +# +#def_key "i" +# show_song_info +# +#def_key "I" +# show_artist_info +# +#def_key "g" +# jump_to_position_in_song +# +#def_key "l" +# show_lyrics +# +#def_key "ctrl-v" +# select_range +# +#def_key "v" +# reverse_selection +# +#def_key "V" +# remove_selection +# +#def_key "B" +# select_album +# +#def_key "a" +# add_selected_items +# +#def_key "c" +# clear_playlist +# +#def_key "c" +# clear_main_playlist +# +#def_key "C" +# crop_playlist +# +#def_key "C" +# crop_main_playlist +# +#def_key "m" +# move_sort_order_up +# +#def_key "m" +# move_selected_items_up +# +#def_key "n" +# move_sort_order_down +# +#def_key "n" +# move_selected_items_down +# +#def_key "M" +# move_selected_items_to +# +#def_key "A" +# add +# +#def_key "S" +# save_playlist +# +#def_key "o" +# jump_to_playing_song +# +#def_key "G" +# jump_to_browser +# +#def_key "G" +# jump_to_playlist_editor +# +#def_key "~" +# jump_to_media_library +# +#def_key "E" +# jump_to_tag_editor +# +#def_key "U" +# toggle_playing_song_centering +# +#def_key "P" +# toggle_display_mode +# +#def_key "\\" +# toggle_interface +# +#def_key "!" +# toggle_separators_between_albums +# +#def_key "L" +# toggle_lyrics_fetcher +# +#def_key "F" +# fetch_lyrics_in_background +# +#def_key "alt-l" +# toggle_fetching_lyrics_in_background +# +#def_key "ctrl-l" +# toggle_screen_lock +# +#def_key "`" +# toggle_library_tag_type +# +#def_key "`" +# refetch_lyrics +# +#def_key "`" +# add_random_items +# +#def_key "ctrl-p" +# set_selected_items_priority +# +#def_key "q" +# quit +# diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config new file mode 100644 index 0000000..588b483 --- /dev/null +++ b/.config/ncmpcpp/config @@ -0,0 +1,9 @@ + +execute_on_song_change = notify-send "Now Playing" "$(mpc current)" + +visualizer_fifo_path = "/tmp/mpd.fifo" +visualizer_output_name = "toggle_visualizer" +visualizer_sync_interval = "30" +visualizer_in_stereo = "yes" +visualizer_type = "spectrum" +visualizer_look = "+|" diff --git a/.config/newsboat/config b/.config/newsboat/config new file mode 100644 index 0000000..73e84df --- /dev/null +++ b/.config/newsboat/config @@ -0,0 +1,11 @@ +auto-reload yes +reload-time 30 +reload-threads 32 + +bind-key j down +bind-key k up +bind-key l open +bind-key h quit +bind-key J next-feed articlelist +bind-key K prev-feed articlelist +bind-key a toggle-article-read diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf new file mode 100644 index 0000000..7b6faf8 --- /dev/null +++ b/.config/picom/picom.conf @@ -0,0 +1,423 @@ +################################# +# 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 + +# The blur radius for shadows, in pixels. (defaults to 12) +# shadow-radius = 12 +shadow-radius = 7; + +# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) +# shadow-opacity = .75 + +# 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; + +# Avoid drawing shadows on dock/panel windows. This option is deprecated, +# you should use the *wintypes* option in your config file instead. +# +# no-dock-shadow = false + +# Don't draw shadows on drag-and-drop windows. This option is deprecated, +# you should use the *wintypes* option in your config file instead. +# +# no-dnd-shadow = false + +# 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 + +# Do not paint shadows on shaped windows. Note shaped windows +# here means windows setting its shape through X Shape extension. +# Those using ARGB background is beyond our control. +# Deprecated, use +# shadow-exclude = 'bounding_shaped' +# or +# shadow-exclude = 'bounding_shaped && !rounded_corners' +# instead. +# +# shadow-ignore-shaped = '' + +# 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 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 = false + +# 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 + +# Specify a list of conditions of windows that should not be faded. +# fade-exclude = [] + +# Do not fade on window open/close. +no-fading-openclose = true + +# 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.8; + +# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) +# frame-opacity = 1.0 +frame-opacity = 0.7; + +# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) +# menu-opacity = 1.0 + +# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. +# inactive-opacity-override = true +inactive-opacity-override = false; + +# 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 always 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 = [ + "97:class_g = 'St'", + "97:class_g = 'Zathura'" +]; + + +################################# +# Background-Blurring # +################################# + + +# Parameters for background blurring, see the *BLUR* section for more information. +# blur-method = +# blur-size = 12 +# +# blur-deviation = false + +# 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 = true + +# 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_OPACITY' on client windows, useful for window managers +# not passing '_NET_WM_OPACITY' of client windows to frame windows. +# +# detect-client-opacity = false +detect-client-opacity = true; + +# Specify refresh rate of the screen. If not specified or 0, picom will +# try detecting this with X RandR extension. +# +# refresh-rate = 60 +refresh-rate = 0 + +# Limit picom to repaint at most once every 1 / 'refresh_rate' second to +# boost performance. This should not be used with +# vsync drm/opengl/opengl-oml +# as they essentially does sw-opti's job already, +# unless you wish to specify a lower refresh rate than the actual value. +# +# sw-opti = + +# 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. 'WM_TRANSIENT_FOR' has higher priority if +# detect-transient is enabled, too. +# +# detect-client-leader = false +detect-client-leader = true + +# 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 = false + +# 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. +# +# 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.75; focus = true; full-shadow = false; }; + dock = { shadow = false; } + dnd = { shadow = false; } + popup_menu = { opacity = 0.8; } + dropdown_menu = { opacity = 0.8; } +}; diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..bc0f17c --- /dev/null +++ b/.config/sxhkd/sxhkdrc @@ -0,0 +1,35 @@ +XF86Audio{Mute,LowerVolume,RaiseVolume} + amixer sset Master {0,5-,5+} &\ + refresh_blocks 10 + +super + b + brave + +super + shift + b + pbm -o + +super + t + Staskell + +super + f + st lf + +super + n + st newsboat + +super + m + st ncmpcpp + +super + {Down,Left,Right} + mpc {toggle,prev,next} + +alt + s + scrot ~/Downloads/screenshots/ &&\ + notify-send "Fullscreen screenshot taken" -i "" + +alt + shift + s + scrot -u ~/Downloads/screenshots/ &&\ + notify-send "Windowed screenshot taken" -i "" + +{Home,End} + mod_brightness {0.1,-0.1} diff --git a/.config/taskell/bindings.ini b/.config/taskell/bindings.ini new file mode 100644 index 0000000..0d5eba6 --- /dev/null +++ b/.config/taskell/bindings.ini @@ -0,0 +1,52 @@ +# general +quit = q +undo = u +redo = r +search = / +help = ? +due = ! + +# navigation +previous = k +next = j +left = h +right = l +bottom = G +top = g + +# new tasks +new = a +newAbove = O +newBelow = o +duplicate = + + +# editing tasks +edit = e, A, i +clear = C +delete = D +detail = +dueDate = @ +clearDate = + +# moving tasks +moveUp = K +moveDown = J +# move to top of previous list +moveLeftTop = ˙ +# move to top of next list +moveRightTop = ¬ +# move to bottom of previous list +moveLeftBottom = H +# move to bottom of next list +moveRightBottom = L +# move to bottom of last list +complete = +# select a list to move to +moveMenu = m + +# lists +listNew = N +listEdit = E +listDelete = X +listRight = > +listLeft = < diff --git a/.config/taskell/config.ini b/.config/taskell/config.ini new file mode 100644 index 0000000..bf0d1f6 --- /dev/null +++ b/.config/taskell/config.ini @@ -0,0 +1,17 @@ +[general] +filename = taskell.md + +[layout] +padding = 1 +column_width = 30 +column_padding = 3 +description_indicator = "≡" +statusbar = true + +[markdown] +title = "##" +task = "###" +summary = ">" +due = "@" +subtask = "-" +localTimes = false diff --git a/.config/taskell/template.md b/.config/taskell/template.md new file mode 100644 index 0000000..4da1daf --- /dev/null +++ b/.config/taskell/template.md @@ -0,0 +1,8 @@ +## To Do + + +## Doing + + +## Done + diff --git a/.config/taskell/theme.ini b/.config/taskell/theme.ini new file mode 100644 index 0000000..1228247 --- /dev/null +++ b/.config/taskell/theme.ini @@ -0,0 +1,25 @@ +[other] + +; list title +title.fg = green + +; status bar +statusBar.bg = blue +statusBar.fg = black + +; current list title +titleCurrent.fg = blue + +; current task +taskCurrent.fg = magenta + +; subtasks +; selected +subtaskCurrent.fg = magenta +; incomplete +subtaskIncomplete.fg = blue +; complete +subtaskComplete.fg = yellow + +; disabled +disabled.fg = yellow diff --git a/.config/zathura/mkzathurarc.sh b/.config/zathura/mkzathurarc.sh new file mode 100755 index 0000000..2231131 --- /dev/null +++ b/.config/zathura/mkzathurarc.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +get_option() { + xrdb -query | grep $1 | awk '{print $2}' +} + +config_file=$XDG_CONFIG_HOME/zathura/zathurarc + +cat > $config_file <<- CONF +set recolor +set recolor-darkcolor "$(get_option foreground)" +set recolor-lightcolor "$(get_option *.color0:)" +set default-bg "$(get_option *.color0:)" +map i recolor + +set font Source Code Pro:size=12 +set statusbar-fg "$(get_option *.color0:)" +set statusbar-bg "$(get_option *.color2:)" +set statusbar-v-padding 2 +set statusbar-h-padding 8 + +CONF diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..f4a86c7 --- /dev/null +++ b/.vimrc @@ -0,0 +1,69 @@ +" _ +" __ _(_)_ __ ___ _ __ ___ +" \ \ / / | '_ ` _ \| '__/ __| +" \ V /| | | | | | | | | (__ +" (_)_/ |_|_| |_| |_|_| \___| +" + +syntax on +set number +set relativenumber +set hlsearch +set encoding=utf-8 +set tabstop=4 +set shiftwidth=4 +set expandtab +set formatoptions-=cro "disables auto comments + +setlocal spell +set spelllang=en_us +set spellcapcheck= + +set conceallevel=2 + +" colors +hi Conceal ctermbg=Black +hi SpellBad ctermfg=Red ctermbg=Black cterm=underline + +" Some macros + +" vim plug +" this blob auto installs vim plug if it isnt already +if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC + endif + +call plug#begin('~/.vim/plugged') + +Plug 'sirver/ultisnips' +Plug 'lervag/vimtex' +Plug 'jiangmiao/auto-pairs' +Plug 'PietroPate/vim-tex-conceal' +Plug 'vim-airline/vim-airline' +Plug 'habamax/vim-godot' +Plug 'tpope/vim-commentary' + +call plug#end() + +" Ultisnips +let g:UltiSnipsExpandTrigger = '' +let g:UltiSnipsJumpForwardTrigger = '' +let g:UltiSnipsJumpBackwardTrigger = '' +let g:UltiSnipsSnippetDirectories=["UltiSnips", "mysnippets"] + +" Vimtex +let g:tex_flavor='latex' +let g:vimtex_view_method='zathura' +let g:vimtex_quickfix_mode=0 +let g:tex_conceal='abdmgs' + +let g:vimtex_compiler_latexmk = { + \'build_dir': '/home/pinosaur/.cache/latexaux/', +\} + +" VimAirline +"let g:airline#extensions#tabline#enabled = 1 +let g:airline_powerline_fonts=1 + diff --git a/Scripts/dmenu/Staskell b/Scripts/dmenu/Staskell new file mode 100755 index 0000000..fa968cf --- /dev/null +++ b/Scripts/dmenu/Staskell @@ -0,0 +1,21 @@ +#!/bin/sh + +# This is a simple launcher script for Taskell + +boards_path="$HOME/.config/taskell/boards/" + +#also look into autocomplete and pressing esc to quit this script +# todo: check to see if name is taken, also append .md + +( + cd "$boards_path" + board="new_board" + mode=$(echo -e "o\nn" | dmenu -i -p "Open board (O) or create new board (N)?") + + [ $mode = "n" ] && board=$(dmenu -p "Choose a name for the board") || \ + [ $mode = "o" ] && board=$(ls -1 | dmenu -i -p "Choose board to open") + + [ -z "$board" ] && exit 1 + + st -e taskell "$board" +) diff --git a/Scripts/fzfutil b/Scripts/fzfutil new file mode 100755 index 0000000..3916815 --- /dev/null +++ b/Scripts/fzfutil @@ -0,0 +1,13 @@ +#!/bin/sh + +fuzzy_dirs="$HOME/Scripts/* $HOME/School/* $HOME/.vim/mysnippets/* $HOME/.bashrc $HOME/.xinitrc $HOME/.Xresources $HOME/.Xmodmap $HOME/.config/*" + +fzs() { + fname="$(find $fuzzy_dirs -type f | fzf)" + [ -z $fname ] || $EDITOR $fname # make sure a file was selected +} + +fcd() { + dname="$(find $fuzzy_dirs -type d | fzf)" + [ -z $dname ] || cd $dname +} diff --git a/Scripts/mod_brightness b/Scripts/mod_brightness new file mode 100755 index 0000000..7e41e4c --- /dev/null +++ b/Scripts/mod_brightness @@ -0,0 +1,4 @@ +#!/bin/sh + +bright="$(xrandr --verbose | grep Brightness)" &&\ +xrandr --output LVDS1 --brightness "$(echo ${bright#* } ${1} | awk '{print $1 + $2}')" diff --git a/Scripts/notify b/Scripts/notify new file mode 100755 index 0000000..9e428e2 --- /dev/null +++ b/Scripts/notify @@ -0,0 +1,11 @@ +#!/bin/sh + +get_json() { + cat - | python3 -c "import sys, json; print(json.load(sys.stdin)['$1'])" +} + +while read line; do + icon="$(echo $line | get_json app_icon)" + msg="$(echo $line | get_json summary)" + herbe "$icon $msg" & +done diff --git a/Scripts/pbm b/Scripts/pbm new file mode 100755 index 0000000..452497e --- /dev/null +++ b/Scripts/pbm @@ -0,0 +1,51 @@ +#!/bin/sh +# Pinosaur's BookMarking or pbm +# +# The bookmark file should have one url on each line +# Empty lines and lines with a # symbol will be ignored +# +# You can also add an alias for each url +# Just add the alias as a second column on the same line +# +# example: +# https://suckless.org/ ~suckless +# +# Requires dmenu with the 'reject no match' patch, +# available at https://tools.suckless.org/dmenu/patches/reject-no-match/dmenu-rejectnomatch-4.7.diff +# +# this script is horrible, ill try to improve it once im better at shell scripting + +BOOKMARKS_FILE="$HOME/Data/bookmarks" + +open() { + # Some error checking + [ -z $BROWSER ] &&\ + echo "No browser set, try setting your $BROWSER environmental variable" &&\ + exit 1 + + selection="$(cat "$BOOKMARKS_FILE" | egrep -v '^$' | grep -v '#' \ + | awk '{ print $2 }'\ + | dmenu -r \ + )" + + # Make sure that user actually selects a url + [ -z "$selection" ] &&\ + echo "No url selected" && exit 1 + + url="$(cat "$BOOKMARKS_FILE" | egrep "\s$selection" | awk '{ print $1 }')" + $BROWSER "${url}" +} + +add() { + echo "Not implemented yet lolz" +} + +[ "$1" = "-o" ] &&\ + open &&\ + exit 0 +[ "$1" = "-a" ] &&\ + add &&\ + exit 0 +echo "Invalid flags" && exit 1 + + diff --git a/Scripts/reload-browser b/Scripts/reload-browser new file mode 100755 index 0000000..032c7df --- /dev/null +++ b/Scripts/reload-browser @@ -0,0 +1,11 @@ +#!/bin/bash + +# https://unix.stackexchange.com/questions/37258/refresh-reload-active-browser-tab-from-command-line + +BROWSER=$1 +RELOAD_KEY="CTRL+R" + +CURWINDOW=$(xdotool getactivewindow) + +xdotool search --name ${BROWSER} windowactivate --sync +xdotool search --name ${BROWSER} key --clearmodifiers ${RELOAD_KEY} diff --git a/Scripts/statusbar/blocks_bat b/Scripts/statusbar/blocks_bat new file mode 100755 index 0000000..431d08f --- /dev/null +++ b/Scripts/statusbar/blocks_bat @@ -0,0 +1,11 @@ +#!/bin/sh + +bat="$(cat /sys/class/power_supply/BAT0/capacity)" + +icon="" +[ $bat -gt "13" ] && icon="" +[ $bat -gt "38" ] && icon="" +[ $bat -gt "63" ] && icon="" +[ $bat -gt "88" ] && icon="" + +echo -e "$icon $bat%" diff --git a/Scripts/statusbar/blocks_date b/Scripts/statusbar/blocks_date new file mode 100755 index 0000000..7f93768 --- /dev/null +++ b/Scripts/statusbar/blocks_date @@ -0,0 +1,4 @@ +#!/bin/sh + +dte="$(date +"%a, %b %d %H:%M")" +echo -e "$dte" diff --git a/Scripts/statusbar/blocks_mem b/Scripts/statusbar/blocks_mem new file mode 100755 index 0000000..38c9219 --- /dev/null +++ b/Scripts/statusbar/blocks_mem @@ -0,0 +1,6 @@ +#!/bin/sh + +# alternate to display total mem too +#mem="$(df -h | grep /dev/sda5 | awk '{printf "%s:%s", $3, $2}')" +mem="$(df -h | grep /dev/sda5 | awk '{print $3}')" +echo -e "$mem" diff --git a/Scripts/statusbar/blocks_ram b/Scripts/statusbar/blocks_ram new file mode 100755 index 0000000..a7b2235 --- /dev/null +++ b/Scripts/statusbar/blocks_ram @@ -0,0 +1,7 @@ +#!/bin/sh + +# alternate script to display total ram too +#ram="$(free -t -m | grep Mem | awk '{printf "%sM:%sM", $3, $2}')" +ram="$(free -t -m | grep Mem | awk '{printf "%sM", $3}')" +echo -e "$ram" + diff --git a/Scripts/statusbar/blocks_vol b/Scripts/statusbar/blocks_vol new file mode 100755 index 0000000..4bb4ab9 --- /dev/null +++ b/Scripts/statusbar/blocks_vol @@ -0,0 +1,10 @@ +#!/bin/sh + +volume="$(amixer sget Master | grep 'Mono:' | awk -F'[][]' '{ print $2 }')" + +icon="" +[ ${volume%\%} -gt "0" ] && icon="" +[ ${volume%\%} -gt "50" ] && icon="" +[ ${volume%\%} -gt "75" ] && icon="" +echo -e "$icon $volume" + diff --git a/Scripts/statusbar/blocks_wifi b/Scripts/statusbar/blocks_wifi new file mode 100755 index 0000000..46639d7 --- /dev/null +++ b/Scripts/statusbar/blocks_wifi @@ -0,0 +1,9 @@ +#!/bin/sh + +wifi="$(nmcli device wifi | grep -F '*')" + +#not exactly sure why, but u nede || instead of && +output="" +[ -z "$wifi" ] || output="$(echo "$wifi" | awk '{printf "%s %s", $3, $6}')" + +echo "$output" diff --git a/Scripts/statusbar/refresh_blocks b/Scripts/statusbar/refresh_blocks new file mode 100755 index 0000000..c1d268b --- /dev/null +++ b/Scripts/statusbar/refresh_blocks @@ -0,0 +1,3 @@ +#!/bin/sh + +pkill "-RTMIN+$1" dwmblocks