Initial Red Hat laptop config commit

This commit is contained in:
2020-10-27 16:50:13 -04:00
parent 59794e9bdf
commit 15fad27d78
22 changed files with 320 additions and 75 deletions

View File

@@ -0,0 +1,137 @@
# fish completion for kogito -*- shell-script -*-
function __kogito_debug
set file "$BASH_COMP_DEBUG_FILE"
if test -n "$file"
echo "$argv" >> $file
end
end
function __kogito_perform_completion
__kogito_debug "Starting __kogito_perform_completion with: $argv"
set args (string split -- " " "$argv")
set lastArg "$args[-1]"
__kogito_debug "args: $args"
__kogito_debug "last arg: $lastArg"
set emptyArg ""
if test -z "$lastArg"
__kogito_debug "Setting emptyArg"
set emptyArg \"\"
end
__kogito_debug "emptyArg: $emptyArg"
set requestComp "$args[1] __complete $args[2..-1] $emptyArg"
__kogito_debug "Calling $requestComp"
set results (eval $requestComp 2> /dev/null)
set comps $results[1..-2]
set directiveLine $results[-1]
# For Fish, when completing a flag with an = (e.g., <program> -n=<TAB>)
# completions must be prefixed with the flag
set flagPrefix (string match -r -- '-.*=' "$lastArg")
__kogito_debug "Comps: $comps"
__kogito_debug "DirectiveLine: $directiveLine"
__kogito_debug "flagPrefix: $flagPrefix"
for comp in $comps
printf "%s%s\n" "$flagPrefix" "$comp"
end
printf "%s\n" "$directiveLine"
end
# This function does three things:
# 1- Obtain the completions and store them in the global __kogito_comp_results
# 2- Set the __kogito_comp_do_file_comp flag if file completion should be performed
# and unset it otherwise
# 3- Return true if the completion results are not empty
function __kogito_prepare_completions
# Start fresh
set --erase __kogito_comp_do_file_comp
set --erase __kogito_comp_results
# Check if the command-line is already provided. This is useful for testing.
if not set --query __kogito_comp_commandLine
set __kogito_comp_commandLine (commandline)
end
__kogito_debug "commandLine is: $__kogito_comp_commandLine"
set results (__kogito_perform_completion "$__kogito_comp_commandLine")
set --erase __kogito_comp_commandLine
__kogito_debug "Completion results: $results"
if test -z "$results"
__kogito_debug "No completion, probably due to a failure"
# Might as well do file completion, in case it helps
set --global __kogito_comp_do_file_comp 1
return 0
end
set directive (string sub --start 2 $results[-1])
set --global __kogito_comp_results $results[1..-2]
__kogito_debug "Completions are: $__kogito_comp_results"
__kogito_debug "Directive is: $directive"
if test -z "$directive"
set directive 0
end
set compErr (math (math --scale 0 $directive / 1) % 2)
if test $compErr -eq 1
__kogito_debug "Received error directive: aborting."
# Might as well do file completion, in case it helps
set --global __kogito_comp_do_file_comp 1
return 0
end
set nospace (math (math --scale 0 $directive / 2) % 2)
set nofiles (math (math --scale 0 $directive / 4) % 2)
__kogito_debug "nospace: $nospace, nofiles: $nofiles"
# Important not to quote the variable for count to work
set numComps (count $__kogito_comp_results)
__kogito_debug "numComps: $numComps"
if test $numComps -eq 1; and test $nospace -ne 0
# To support the "nospace" directive we trick the shell
# by outputting an extra, longer completion.
__kogito_debug "Adding second completion to perform nospace directive"
set --append __kogito_comp_results $__kogito_comp_results[1].
end
if test $numComps -eq 0; and test $nofiles -eq 0
__kogito_debug "Requesting file completion"
set --global __kogito_comp_do_file_comp 1
end
# If we don't want file completion, we must return true even if there
# are no completions found. This is because fish will perform the last
# completion command, even if its condition is false, if no other
# completion command was triggered
return (not set --query __kogito_comp_do_file_comp)
end
# Remove any pre-existing completions for the program since we will be handling all of them
# TODO this cleanup is not sufficient. Fish completions are only loaded once the user triggers
# them, so the below deletion will not work as it is run too early. What else can we do?
complete -c kogito -e
# The order in which the below two lines are defined is very important so that __kogito_prepare_completions
# is called first. It is __kogito_prepare_completions that sets up the __kogito_comp_do_file_comp variable.
#
# This completion will be run second as complete commands are added FILO.
# It triggers file completion choices when __kogito_comp_do_file_comp is set.
complete -c kogito -n 'set --query __kogito_comp_do_file_comp'
# This completion will be run first as complete commands are added FILO.
# The call to __kogito_prepare_completions will setup both __kogito_comp_results abd __kogito_comp_do_file_comp.
# It provides the program's completion choices.
complete -c kogito -n '__kogito_prepare_completions' -f -a '$__kogito_comp_results'

View File

@@ -26,11 +26,17 @@ abbr hum "cd $mfs_dir && hugo serve -D --disableFastRender"
{{ end }}#]]]
# system[[[
set -x PATH $PATH ~/.local/bin ~/scripts ~/scripts/colors ~/go/bin ~/.minetest/minetest/bin ~/.gem/ruby/2.6.0/bin
set -x CLASSPATH $CLASSPATH /home/kevin/java/*.jar
set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH /usr/local/lib /usr/local/lib64
set -x PKG_CONFIG_PATH $PKG_CONFIG_PATH /usr/lib/pkgconfig
set -x GOPATH ~/go
set -x HASTE_SERVER https://pste.gq
set -x GRAALVM_HOME /usr/lib/jvm/graalvm-ce-java11-20.1.0
set -x GRAALVM_BIN $GRAALVM_HOME/bin
# set -x JAVA_HOME /usr/lib/jvm/java-11-openjdk
set -x JAVA_HOME $GRAALVM_HOME
set -x LD_LIBRARY_PATH $LD_LIBRARY_PATH /usr/local/lib /usr/local/lib64
set -x MAVEN_HOME /opt/maven
set -x PATH $GRAALVM_BIN $PATH ~/.local/bin ~/scripts ~/scripts/colors $GOPATH/bin ~/.minetest/minetest/bin ~/.gem/ruby/2.6.0/bin $MAVEN_HOME/bin
set -x PKG_CONFIG_PATH $PKG_CONFIG_PATH /usr/lib/pkgconfig
{{ if eq .chezmoi.fullHostname "nzxt" }}
set -x CALCURSE_CALDAV_PASSWORD (pass show technology/linux/baikal | head -n1)
status --is-interactive; and source (pyenv init -|psub)
@@ -62,6 +68,8 @@ set -xU BROWSER "firefox"
set -xU FZF_DEFAULT_COMMAND "find ."
set -xU KOGITO_SERVICE_URL "http://example-quarkus-3376.apps-crc.testing/"
# ]]] universal var's #
# fish-specific [[[ #
@@ -140,6 +148,8 @@ abbr cpp "copy echo (pwd)"
abbr cff "create-fish-function"
abbr ctr "systemctl-restart"
abbr def "define"
abbr do "debug-operator"
abbr dop "debug-operator pull"
abbr ens "enable-site"
abbr ev "evince-silent"
# abbr fbg "find-bg"
@@ -168,6 +178,7 @@ abbr mn "man-vim"
abbr ma "man-vim task"
abbr mat "math"
abbr mdf "mkdir-cd"
abbr oge "oc-get-events"
abbr pgr "grep-pdf"
abbr pgrf "grep-pdf-file"
abbr pst "pastebin"
@@ -191,13 +202,7 @@ abbr xya "export-pkgs"
# school [[[ #
# 369
abbr grc "grep-c"
abbr grh "grep-headers"
abbr rgh "rg-headers"
abbr jcr "java-compile-run"
abbr jct "java-compile-test"
abbr rdo "redeploy-operator"
# ]]] school #

View File

@@ -0,0 +1,7 @@
function debug-operator
if test (count $argv) -gt 0
git pull --rebase
end
make mod clean
and DEBUG=true operator-sdk run --local --watch-namespace=3376 &| tee debug-operator.log
end

View File

@@ -0,0 +1,3 @@
function oc-get-events
oc get events --field-selector involvedObject.name="$argv[1]"
end

View File

@@ -0,0 +1,5 @@
function redeploy-operator
oc delete deployment kogito-operator
make deploy-operator-on-ocp
oc get pods -w
end

View File

@@ -16,7 +16,8 @@ exec xbacklight -set 10
exec wal -i $(/home/kevin/scripts/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing")
{{ end }}
# exec xrdb ~/.Xresources && grep wallpaper ~/.cache/wal/colors.sh | cut -d\' -f2 | xargs wal -i > /dev/null
exec --no-startup-id i3-msg 'workspace $ws2; exec $term -e fish -c "tmux-attach fortnite"'
# exec --no-startup-id i3-msg 'workspace $ws2; exec $term -e fish -c "tmux-attach fortnite"'
exec --no-startup-id i3-msg 'workspace $ws1; exec $term'
exec --no-startup-id i3-msg 'workspace $ws3; exec $browser'
# exec --no-startup-id i3-msg 'workspace $ws5; exec $term -e twitchy'
# exec --no-startup-id i3-msg 'workspace $ws6; exec discord'
@@ -27,7 +28,7 @@ exec --no-startup-id i3-msg 'workspace $ws3; exec $browser'
set $mod Mod1
set $browser "firefox"
# set $browser "chromium"
# set $browser "chromium-browser"
set $scripts_path "/home/kevin/scripts"
set $sch_dir "$HOME/Documents/School"
@@ -40,7 +41,8 @@ bindsym Control+Shift+Return exec st -A1
bindsym Control+$mod+Return exec $term_alt
# bindsym Control+$mod+Return exec st
# PROTIP: You can also dynamically set dmenu's colors this way:
bindsym Mod4+Return exec /home/kevin/scripts/dmenu-history -nb "$fg" -nf "$bg" -sb "$bg" -sf "$fg"
# bindsym Mod4+Return exec /home/kevin/scripts/dmenu-history -nb "$fg" -nf "$bg" -sb "$bg" -sf "$fg"
bindsym Mod4+Return exec ~/scripts/dmenu-history -nb "$fg" -nf "$bg" -sb "$bg" -sf "$fg"
# bindsym Mod4+Return exec dmenu_run -nb "$fg" -nf "$bg" -sb "$bg" -sf "$fg"
# bindsym Mod4+Return exec dmenu_run
# There also is the (new) i3-dmenu-desktop which only displays applications
@@ -90,8 +92,8 @@ bindsym Print --release exec "scrot -s ~/tmp/screenshot-$(date +%F_%T).png -e 'x
bindsym Control+Print --release exec "scrot -u ~/tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
{{ else }}
bindsym Mod4+x exec xmodmap ~/.Xmodmap-laptop && xset r rate $XSET_DELAY $XSET_RATE
bindsym Control+$mod+p --release exec "scrot -s /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
bindsym Control+Shift+p --release exec "scrot -u /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
bindsym Control+$mod+p --release exec "maim -s ~/tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
bindsym Control+Shift+p --release exec "maim -u ~/tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'"
{{ end }}
# ]]] app shortcuts #
@@ -103,13 +105,13 @@ bindsym $mod+Mod4+2 exec redshift -x && redshift -O 2000
bindsym $mod+Mod4+3 exec redshift -x && redshift -O 3000
bindsym $mod+Mod4+4 exec redshift -x && redshift -O 4000
bindsym $mod+Mod4+5 exec redshift -x && redshift -O 5000
bindsym $mod+Mod4+grave exec redshift -x
bindsym $mod+Mod4+grave exec Redshift -x
# ]]] redshift #
# backlight [[[ #
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
{{ if or (eq .chezmoi.fullHostname "x1-carbon") (eq .linux_os "fedora") }}
bindsym Shift+F1 exec xbacklight -set 10
bindsym Shift+F2 exec xbacklight -set 20
bindsym Shift+F3 exec xbacklight -set 30
@@ -119,7 +121,8 @@ bindsym Shift+F6 exec xbacklight -set 60
bindsym Shift+F7 exec xbacklight -set 70
bindsym Shift+F8 exec xbacklight -set 80
bindsym Shift+F9 exec xbacklight -set 90
bindsym Shift+F0 exec xbacklight -set 100
bindsym Shift+F10 exec xbacklight -set 100
bindsym Shift+grave exec xbacklight -set 0
bindsym Control+$mod+plus exec xbacklight -inc 2
bindsym Control+$mod+minus exec xbacklight -dec 2
@@ -175,8 +178,8 @@ for_window [class="^.*"] border pixel 3
# gaps inner $inner_gaps
# gaps outer $outer_gaps
# gaps bottom 0
gaps inner 0
gaps outer 0
# gaps inner 0
# gaps outer 0
{{ if eq .chezmoi.fullHostname "nzxt" }}
border_radius $border_radius
{{ end }}
@@ -278,7 +281,7 @@ bindsym Control+$mod+a floating enable; resize set 400px 150px; move absolute po
set $make_st_script "/home/kevin/st/make-st.sh"
# test
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
{{ if or (eq .chezmoi.fullHostname "x1-carbon") (eq .linux_os "fedora") }}
bindsym Control+Shift+q exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/bright/editing") && $make_st_script
bindsym Control+Shift+w exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Backgrounds/dim/non-editing") && $make_st_script
bindsym Control+$mod+z exec feh --bg-fill ~/Pictures/Backgrounds/dim/black.jpg
@@ -294,9 +297,12 @@ bindsym Control+$mod+y exec wal -i $($scripts_path/shuffler "$HOME/Pictures/Back
# ws names [[[ #
set $ws1 "1 "
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
{{ if or (eq .chezmoi.fullHostname "x1-carbon") (eq .linux_os "fedora") }}
set $secondary "HDMI2"
set $main "eDP1"
# {{ else if eq .linux_os "fedora" }}
# set $secondary "HDMI2"
# set $main "eDP-1"
{{ else if eq .chezmoi.fullHostname "nzxt" }}
set $secondary "DVI-I-1"
set $main "HDMI-0"
@@ -504,6 +510,9 @@ bar {
i3bar_command i3bar -t
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
font pango:$sb_font 17
{{ else if eq .linux_os "fedora" }}
# font pango:$sb_font 23
font pango:$sb_font 25
{{ else }}
# font pango:$sb_font 17
font pango:$sb_font 16

View File

@@ -15,12 +15,12 @@ color=#cbe4ff
# volume/spotify [[[ #
{{ if eq .chezmoi.fullHostname "nzxt" }}
[volume]
interval=once
signal=1
interval=60
{{ if eq .chezmoi.fullHostname "nzxt" }}
[spotify]
label=
LONG_NAME=
@@ -32,9 +32,9 @@ interval=5
# laptop [[[ #
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
{{ if or (eq .chezmoi.fullHostname "x1-carbon") (eq .linux_os "fedora") }}
[battery]
label=⚡
label=⚡
interval=30
[wifi]
@@ -43,7 +43,7 @@ instance=wlp3s0
interval=10
[backlight]
label=
label=
interval=5
{{ end }}
@@ -54,12 +54,8 @@ interval=5
[calendar]
interval=30
label=
{{ if eq .chezmoi.fullHostname "nzxt" }}
DATEFMT=+%H:%M
{{ else }}
DATEFMT=+%H:%M.%a-%m-%d
{{ end }}
# SHORTFMT=+%H:%M:%S
# DATEFMT=+%H:%M.%a-%m-%d
HEIGHT=180
WIDTH=220
@@ -85,10 +81,9 @@ interval=5
{{ end }}
[cpu_usage]
label=
label=
interval=5
{{ if eq .chezmoi.fullHostname "nzxt" }}
[memory]
label=
# color=#3da061
@@ -98,6 +93,7 @@ interval=5
# name [[[ #
{{ if eq .chezmoi.fullHostname "nzxt" }}
[name]
label=
interval=30

View File

@@ -5,7 +5,7 @@ round()
echo $(printf %.$2f $(echo "scale=$2;(((10^$2)*$1)+0.5)/(10^$2)" | bc))
};
. "/home/kevin/.cache/wal/colors.sh"
. "/home/$USER/.cache/wal/colors.sh"
cur_bl=$(xbacklight -get)
# echo "$(round "$cur_bl" 0)%"
printf "$(round "$cur_bl" 0)\n\n%s\n" "$color7"
printf " $(round "$cur_bl" 0)\n\n%s\n" "$color7"

View File

@@ -37,7 +37,7 @@ case "$BLOCK_BUTTON" in
> /dev/null"
# --close-on-unfocus \
esac
. "/home/kevin/.cache/wal/colors.sh"
. "/home/$USER/.cache/wal/colors.sh"
echo "$LABEL$(date "$DATEFMT")"
echo "$LABEL$(date "$SHORTFMT")"
echo "$color7"

View File

@@ -1,8 +1,7 @@
#!/bin/bash
. "/home/kevin/.cache/wal/colors.sh"
. "/home/$USER/.cache/wal/colors.sh"
idle="$(mpstat 1 1 -P ALL | sed -n -e '4{p;q}' | awk '{print $NF}')"
used=$(echo 100 - "$idle" | bc)
used_rounded=$(printf %.0f "$used")
printf "%s%%\n\n%s\n" "$used_rounded" "$color7"
printf " %s%%\n\n%s\n" "$used_rounded" "$color7"

View File

@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TYPE="${BLOCK_INSTANCE:-mem}"
. "/home/kevin/.cache/wal/colors.sh"
. "/home/$USER/.cache/wal/colors.sh"
awk -v type=$TYPE '
/^MemTotal:/ {

View File

@@ -1,6 +1,5 @@
#!/bin/bash
. "/home/kevin/.cache/wal/colors.sh"
printf "$(date '+%H:%M.%a-%m-%d')\n\n%s\n" "$color7"
# echo "<span foreground=\"%s\">$(date '+%H:%M.%a-%m-%d')%s</span>" "$color2"
# printf "%s" "$color2"

View File

@@ -17,7 +17,7 @@ AUDIO_LOW_SYMBOL=${AUDIO_LOW_SYMBOL:-''}
AUDIO_MUTED_SYMBOL=${AUDIO_MUTED_SYMBOL:-''}
. "/home/kevin/.cache/wal/colors.sh"
. "/home/$USER/.cache/wal/colors.sh"
# DEFAULT_COLOR=${DEFAULT_COLOR:-"#ffffff"}
DEFAULT_COLOR="$color7"
MUTED_COLOR=${MUTED_COLOR:-"#a0a0a0"}

View File

@@ -39,7 +39,7 @@ W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}')
echo $QUALITY% # full text
echo $QUALITY% # short text
. "/home/kevin/.cache/wal/colors.sh"
. "/home/$USER/.cache/wal/colors.sh"
# color
if [[ $QUALITY -lt 50 ]]; then
echo "#FF0000"

View File

@@ -1,7 +1,13 @@
include ~/.cache/wal/colors-kitty.conf
background_opacity .8
background_opacity .6
/* background_opacity .7 */
clipboard_control write-clipboard write-primary
enable_audio_bell no
# font
font_size 12
cursor_blink_interval 0
# font_size 12.5
# font_size 14
font_size 14.5
map ctrl+alt+up change_font_size all +1.0
map ctrl+alt+down change_font_size all -1.0

View File

@@ -20,17 +20,17 @@ print_info() {
info "Shell" shell
info "Packages" packages
info "WM" wm
info "WM Theme" wm_theme
info "WM Theme" wm_theme
# info "Font" font
info "Theme" theme
info "Icons" icons
# info "Theme" theme
# info "Icons" icons
info "CPU" cpu
info "CPU Usage" cpu_usage
info "GPU" gpu
info "GPU Driver" gpu_driver # Linux only
# info "GPU" gpu
# info "GPU Driver" gpu_driver # Linux only
info "Memory" memory
info "Disk" disk
info "Resolution" resolution
# info "Resolution" resolution
# }}} enabled #
@@ -337,7 +337,9 @@ public_ip_host="http://ident.me"
# 'Disk (/): 74G / 118G (66%)'
#
# disk_show=('/' '/home' '/mnt/linux-files' )
disk_show=('/dev/sda1' '/dev/sda3' '/dev/sdc2' )
# disk_show=('/dev/sda1' '/dev/sda3' '/dev/sdc2' )
# disk_show=('/dev/sda2' )
disk_show=('/' '/home' )
# Disk subtitle.
# What to append to the Disk subtitle.

View File

@@ -665,9 +665,10 @@ set preview_images true
# * urxvt-full:
# The same as urxvt but utilizing not only the preview pane but the
# whole terminal window.
set preview_images_method w3m
# set preview_images_method w3m
# set preview_images_method ueberzug
# set preview_images_method urxvt
set preview_images_method kitty
# set preview_images_method urxvt-full
# ]]] image preview #