removing old non used scripts

This commit is contained in:
Chris Cochrun 2024-07-15 10:05:55 -05:00
parent 797d90f040
commit ff3d4fb592
32 changed files with 8 additions and 958 deletions

View file

@ -4,14 +4,14 @@ const battery = await Service.import("battery");
const laptop = Utils.exec(`hostname`) === "syl"; const laptop = Utils.exec(`hostname`) === "syl";
export function BatteryPopup(monitor = laptop ? 0 : 2) { export function BatteryPopup(monitor = laptop ? 0 : 2) {
const battery_state = battery.bind("percent"); const battery_percent = battery.bind("percent");
return Widget.Window({ return Widget.Window({
monitor, monitor,
name: `battery${monitor}`, name: `battery${monitor}`,
class_name: "battery-popup", class_name: "battery-popup",
anchor: [laptop ? "bottom" : "top"], anchor: [laptop ? "bottom" : "top"],
css: "margin-right: 30px", css: "margin-right: 30px",
visible: battery_state.as(p => p < 25 ? true : false), visible: battery_percent.as(p => p < 25 ? battery.bind("charging").as(c => c == true ? true : false) : false),
child: Widget.Box({ child: Widget.Box({
// css: "padding: .8em", // css: "padding: .8em",
children: [ children: [

View file

@ -40,7 +40,7 @@ function Notification(n) {
justification: "left", justification: "left",
hexpand: true, hexpand: true,
max_width_chars: 24, max_width_chars: 24,
truncate: "end", // truncate: "end",
wrap: true, wrap: true,
label: n.summary, label: n.summary,
use_markup: true, use_markup: true,

View file

@ -1068,7 +1068,7 @@ end
padding.y = 10; padding.y = 10;
dynamic_padding = true; dynamic_padding = true;
}; };
shell.program = "fish"; shell.program = "nu";
font = { font = {
normal = { normal = {
family = "VictorMono Nerd Font"; family = "VictorMono Nerd Font";
@ -1134,6 +1134,9 @@ end
''; '';
cmd_duration = { cmd_duration = {
format = " $duration"; format = " $duration";
min_time = 0;
show_notifications = true;
min_time_to_notify = 20000;
}; };
time = { time = {
format = "| $time"; format = "| $time";

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
# export QT_QPA_PLATFORMTHEME='qt5ct'
function run {
if ! pgrep -f $1 ;
then
$@&
fi
}
run jellyfin-mpv-shim

View file

@ -1,9 +0,0 @@
#!/bin/sh
wb=$(pgrep waybar)
if [[ "$wb" -gt 1 ]]; then
kill $wb
else
exec waybar &
fi

View file

@ -1,7 +0,0 @@
#!/usr/bin/env sh
echo - | awk "{printf \"%.1f\", \
$(( \
$(cat /sys/class/power_supply/BAT1/current_now) * \
$(cat /sys/class/power_supply/BAT1/voltage_now) \
)) / 1000000000000 }" ; echo " W "

View file

@ -1,4 +0,0 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
notify-send "$(batinfo)" --icon=battery

View file

@ -1,13 +0,0 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
capacity=$(cat /sys/class/power_supply/BAT1/capacity)
status=$(cat /sys/class/power_supply/BAT1/status)
if [ $status = 'Charging' ]; then
icon=''
else
icon=''
fi
echo $icon $capacity

View file

View file

@ -1,5 +0,0 @@
#!/bin/sh
disk_usage=$(df -h | rg /dev/nvme0n1p2 | awk '{print $4}' | head -n 1)
echo "$disk_usage "

View file

@ -1,206 +0,0 @@
#!/bin/sh
# Show a Doppler RADAR of an American user's preferred location.
secs=600 # Download a new doppler radar if one hasn't been downloaded in $secs seconds.
radarloc="${XDG_CACHE_HOME:-$HOME/.cache}/radar"
doppler="${XDG_CACHE_HOME:-$HOME/.cache}/doppler.gif"
pickloc() { chosen="$(echo "Northeast
Southeast
PacNorthWest
PacSouthWest
UpperMissVly
SouthMissVly
SouthPlains
NorthRockies
SouthRockies
Alaska
Carib
Hawaii
CentGrLakes
Conus-Large
KABR: Aberdeen, SD
KBIS: Bismarck, ND
KFTG: Denver/Boulder, CO
KDMX: Des Moines, IA
KDTX: Detroit, MI
KDDC: Dodge City, KS
KDLH: Duluth, MN
KCYS: Cheyenne, WY
KLOT: Chicago, IL
KGLD: Goodland, KS
KUEX: Hastings, NE
KGJX: Grand Junction, CO
KGRR: Grand Rapids, MI
KMVX: Fargo/Grand Forks, ND
KGRB: Green Bay, WI
KIND: Indianapolis, IN
KJKL: Jackson, KY
KARX: La Crosse, WI
KILX: Lincoln/Central Illinois, IL
KLVX: Louisville, KY
KMQT: Marquette
KMKX: Milwaukee, WI
KMPX: Minneapolis, MN
KAPX: Gaylord/Alpena, MI
KLNX: North Platte, NE
KIWX: N. Webster/Northern, IN
KOAX: Omaha, NE
KPAH: Paducah, KY
KEAX: Pleasant Hill, MO
KPUX: Pueblo, CO
KDVN: Quad Cities, IA
KUDX: Rapid City, SD
KRIW: Riverton, WY
KSGF: Springfield, MO
KLSX: St. LOUIS, MO
KFSD: Sioux Falls, IA
KTWX: Topeka, KS
KICT: Wichita, KS
KVWX: Paducah, KY
ICAO: Responsible Wfo
KLTX: WILMINGTON, NC
KCCX: State College/Central, PA
KLWX: Sterling, VA
KFCX: Blacksburg/Roanoke, VA
KRAX: Raleigh/Durham, NC
KGYX: Portland, ME
KDIX: Mt Holly/Philadelphia, PA
KPBZ: Pittsburgh, PA
KAKQ: Wakefield, VA
KMHX: Morehead City, NC
KGSP: Greer/Greenville/Sprtbg, SC
KILN: Wilmington/Cincinnati, OH
KCLE: Cleveland, OH
KCAE: Columbia, SC
KBGM: Binghamton, NY
KENX: Albany, NY
KBUF: Buffalo, NY
KCXX: Burlington, VT
KCBW: Caribou, ME
KBOX: Boston /Taunton, MA
KOKX: New York City, NY
KCLX: Charleston, SC
KRLX: Charleston, WV
ICAO: Responsible WFO
KBRO: Brownsville, TX
KABX: Albuquerque, NM
KAMA: Amarillo, TX
KFFC: Peachtree City/Atlanta, GA
KEWX: Austin/Sanantonio, TX
KBMX: Birmingham, AL
KCRP: Corpus Christi, TX
KFWS: Dallas / Ft. Worth, TX
KEPZ: El Paso, TX
KHGX: Houston/ Galveston, TX
KJAX: Jacksonville, FL
KBYX: Key West, FL
KMRX: Morristown/knoxville, TN
KLBB: Lubbock, TX
KLZK: Little Rock, AR
KLCH: Lake Charles, LA
KOHX: Nashville, TN
KMLB: Melbourne, FL
KNQA: Memphis, TN
KAMX: Miami, FL
KMAF: Midland/odessa, TX
KTLX: Norman, OK
KHTX: Huntsville, AL
KMOB: Mobile, AL
KTLH: Tallahassee, FL
KTBW: Tampa Bay Area, FL
KSJT: San Angelo, TX
KINX: Tulsa, OK
KSRX: Tulsa, OK
KLIX: New Orleans/slidell, LA
KDGX: Jackson, MS
KSHV: Shreveport, LA
ICAO: Responsible WFO
KLGX: Seattle / Tacoma, WA
KOTX: Spokane, WA
KEMX: Tucson, AZ
KYUX: Phoenix, AZ
KNKX: San Diego, CA
KMUX: Monterey/san Francisco, CA
KHNX: San Joaquin/hanford, CA
KSOX: San Diego, CA
KATX: Seattle / Tacoma, WA
KIWA: Phoenix, AZ
KRTX: Portland, OR
KSFX: Pocatello, ID
KRGX: Reno, NV
KDAX: Sacramento, CA
KMTX: Salt Lake City, UT
KPDT: Pendleton, OR
KMSX: Missoula, MT
KESX: Las Vegas, NV
KVTX: Los Angeles, CA
KMAX: Medford, OR
KFSX: Flagstaff, AZ
KGGW: Glasgow, MT
KLRX: Elko, NV
KBHX: Eureka, CA
KTFX: Great Falls, MT
KCBX: Boise, ID
KBLX: Billings, MT
KICX: Salt Lake City, UT
ICAO: Responsible Wfo W/ MSCF
PABC: Anchorage, AK
PAPD: Fairbanks, AK
PHKM: Honolulu, HI
PAHG: Anchorage, AK
PAKC: Anchorage, AK
PAIH: Anchorage, AK
PHMO: Honolulu, HI
PAEC: Fairbanks, AK
TJUA: San Juan, PR
PACG: Juneau, AK
PHKI: Honolulu, HI
PHWA: Honolulu, HI
ICAO: Responsible Wfo W/ MSCF
KFDR: Norman, OK
PGUA: Guam
KBBX: Sacramento, CA
KFDX: Albuquerque, NM
KGWX: Jackson, MS
KDOX: Wakefield, VA
KDYX: San Angelo, TX
KEYX: Las Vegas, NV
KEVX: Mobile, AL
KHPX: Paducah, KY
KTYX: Burlington, VT
KGRK: Dallas / Ft. Worth, TX
KPOE: Lake Charles, LA
KEOX: Tallahassee, FL
KHDX: El Paso, TX
KDFX: San Antonio, TX
KMXX: Birmingham, AL
KMBX: Bismarck, ND
KVAX: Jacksonville, FL
KJGX: Peachtree City/atlanta, GA
KVNX: Norman, OK
KVBX: Vandenberg Afb: Orcutt, CA" | dmenu -r -i -l 50 -p "Select a National Weather Service radar to use as default:" | sed "s/:.*//" | tr "[:lower:]" "[:upper:]")"
# Sanity check of selection and ensure user did not escape.
echo "$chosen" | grep -q "^[A-Z]\+$" && echo "$chosen" > "$radarloc" ;}
getdoppler() {
loc="$(cat "$radarloc")"
notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc."
curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;}
showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}
case $BLOCK_BUTTON in
1) [ ! -f "$radarloc" ] && pickloc && getdoppler
[ $(($(date '+%s') - $(stat -c %Y "$doppler"))) -gt "$secs" ] && getdoppler
showdoppler ;;
2) pickloc && getdoppler && showdoppler ;;
3) notify-send "🗺️ Doppler RADAR module" "\- Left click for local Doppler RADAR.
- Middle click to update change RADAR location.
After $secs seconds, new clicks will also automatically update the doppler RADAR." ;;
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
echo 🗺️

View file

@ -1,27 +0,0 @@
#!/bin/sh
string=$(eww windows)
windows=($string)
host=$(hostname)
for i in "${windows[@]}"
do
if [[ "$host" = kaladin ]]; then
if [[ $i = '*bar1' ]]; then
eww close bar1
return
else
eww open bar1
fi
else
if [[ $i = '*bar0' ]]; then
eww close bar0
return
else
eww open bar0
fi
fi
done

View file

@ -1,2 +0,0 @@
#!/bin/sh
feh --no-fehbg --bg-fill '/home/chris/Pictures/wallpapers/RoyalKing.png'

View file

@ -1,4 +1,4 @@
#!/usr/bin/sh #!/bin/sh
exec 3>&2 exec 3>&2

View file

@ -1,345 +0,0 @@
#!/usr/bin/env perl
# Dilbert themed system info fetch tool
# https://github.com/anhsirk0/fetch-master-6000
use strict;
use Term::ANSIColor;
use Getopt::Long;
my $length = 13;
my $gap = 3;
my $margin = 2;
my $color = 'yellow';
my $wally;
my $dogbert;
my $alice;
my $phb;
my $asok;
my $help;
my $not_de;
my $random;
my @colors = (
'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white',
'bright_red', 'bright_green', 'bright_yellow',
'bright_blue', 'bright_magenta', 'bright_cyan', 'bright_white'
);
sub get_os {
my $os = `lsb_release -sd`;
# for BSD
unless ($os) { $os = `uname -s`; }
for($os){
s/"//;
s/ .*//;
s/"//;
chomp;
}
return $os;
}
sub get_de {
my $de = $ENV{XDG_CURRENT_DESKTOP};
unless ($de) { $de = $ENV{XDG_SESSION_DESKTOP} };
unless ($de) { $de = $ENV{DESKTOP_SESSION} };
# return $de;
return "awesome";
}
sub shell {
# return (split '/', $ENV{SHELL})[-1];
return "fish";
}
sub kernel {
my $ke = `uname -r`;
$ke =~ s/-.*//;
chomp $ke;
return $ke
}
sub packages {
# for arch based
my $pacs = `pacman -Q`;
# for debian based
unless ($pacs) { $pacs = `dpkg-query -f '\n' -W`; }
# for fedora
unless ($pacs) { $pacs = `yum list installed`; }
# for BSD
unless ($pacs) { $pacs = `pkg info`; }
my $count = $pacs =~ tr/\n//;
return $count;
}
sub uptime {
my $time = `uptime`;
for($time) {
s/.*up\s+//;
s/,\s+[0-9]+ user.*//;
s/ //g;
s/,/:/g;
s/[a-z]+//g;
chomp
}
my @time = reverse(split ":", $time);
if (scalar @time == 2) {
$time[0] =~ s/^0//; # remove starting '0' (01 -> 1)
$time = $time[1]. "h, " . $time[0] . "m";
} elsif (scalar @time == 3) {
$time[0] =~ s/^0//; # remove starting '0' (01 -> 1)
$time = $time[2]. "d, " . $time[1]. "h, " . $time[0] . "m";
} else {
$time .= "m";
}
return $time;
}
# today's internet usage via vnstat
sub usage {
my $data = `vnstat`;
my $today;
foreach my $line (split '\n', $data) {
if ($line =~ /today/) {
$today = (split '\|', $line)[2];
$today =~ s/^ *//;
}
}
return $today;
}
sub format_info {
my %info = %{(shift)};
# format => "MARGIN PLACEHOLDER GAP NAME"
my $text = ' ' x $margin . colored($info{'placeholder'}, $info{'color'});
$text .= ' ' x (7 + $gap - length $info{'placeholder'});
$text .= $info{'name'} . ' ' x ($length - length $info{'name'});
return $text;
}
sub get_info {
my $os = get_os();
my $ke = kernel();
my $de = get_de();
my $sh = shell();
my $up = uptime();
my $pac = packages();
my $de_placeholder = 'DE';
my $vnstat = '-1';
my $usg;
GetOptions (
"help" => \$help,
"os=s" => \$os,
"kernel=s" => \$ke,
"de=s" => \$de,
"shell=s" => \$sh,
"uptime=s" => \$up,
"packages=i" => \$pac,
"margin=i" => \$margin,
"length=i" => \$length,
"gap=i" => \$gap,
"color=s" => \$color,
"not_de" => \$not_de,
"vnstat:s" => \$vnstat,
"wally" => \$wally,
"dogbert" => \$dogbert,
"alice" => \$alice,
"phb" => \$phb,
"asok" => \$asok,
"random" => \$random,
);
if ($help) {
print_help();
exit;
}
if ($not_de) {
$de_placeholder = 'WM';
}
if ($vnstat eq '') {
$vnstat = usage();
}
if ($color eq "random") {
$color = @colors[int(rand scalar @colors)];
}
my %usg = (
'placeholder' => 'VNSTAT',
'color' => 'magenta',
'name' => $vnstat
);
my %os = (
'placeholder' => 'OS',
'color' => 'bright_green',
'name' => $os,
);
my %ke = (
'placeholder' => 'KERNEL',
'color' => 'blue',
'name' => $ke,
);
my %de = (
'placeholder' => $de_placeholder,
'color' => 'bright_red',
'name' => $de,
);
my %sh = (
'placeholder' => 'SHELL',
'color' => 'yellow',
'name' => $sh,
);
my %up = (
'placeholder' => 'UPTIME',
'color' => 'bright_magenta',
'name' => $up,
);
my %pac = (
'placeholder' => 'PACKAGE',
'color' => 'cyan',
'name' => $pac,
);
$os = format_info(\%os);
$ke = format_info(\%ke);
$de = format_info(\%de);
$sh = format_info(\%sh);
$up = format_info(\%up);
$pac = format_info(\%pac);
$usg = format_info(\%usg);
my $i = 0;
my @info;
$info[$i++] = ' ' x ($length + $gap + 7 + $margin);
$info[$i++] = $os;
if ($vnstat eq '-1' ) { $info[$i++] = $ke; }
$info[$i++] = $de;
$info[$i++] = $sh;
$info[$i++] = $up;
$info[$i++] = $pac;
unless ($vnstat eq '-1' ) { $info[$i++] = $usg; }
$info[$i++] = ' ' x ($length + $gap + 7 + $margin);
return @info;
}
sub main {
my @info = get_info();
if ($random) {
my @arr = map { 0 } (1..6);
$arr[int rand(6)] = 1;
($wally, $dogbert, $alice, $phb, $asok) = splice @arr, 0, 4;
}
my $text = "\n";
if ($wally) {
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
$text .= colored(q{ .-'''-. │}, $color) . $info[0] . colored('│', $color) . "\n";
$text .= colored(q{ | | │}, $color) . $info[1] . colored('│', $color) . "\n";
$text .= colored(q{ ⪜|---_---|⪛ ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
$text .= colored(q{ Ͼ|__(_)__|Ͽ ││}, $color) . $info[3] . colored('│', $color) . "\n";
$text .= colored(q{ | _ | ││}, $color) . $info[4] . colored('│', $color) . "\n";
$text .= colored(q{ | | ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
$text .= colored(q{ ˏ====○====ˎ │}, $color) . $info[6] . colored('│', $color) . "\n";
$text .= colored(q{ / \ │}, $color) . $info[7] . colored('│', $color) . "\n";
$text .= colored(q{ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
} elsif ($dogbert) {
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
$text .= colored(q{ │}, $color) . $info[0] . colored('│', $color) . "\n";
$text .= colored(q{ .-----. │}, $color) . $info[1] . colored('│', $color) . "\n";
$text .= colored(q{ .` `. ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
$text .= colored(q{ / /-() ()-\ \ ││}, $color) . $info[3] . colored('│', $color) . "\n";
$text .= colored(q{ \_| ○ |_/ ││}, $color) . $info[4] . colored('│', $color) . "\n";
$text .= colored(q{ '. .' ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
$text .= colored(q{ `-._.-' │}, $color) . $info[6] . colored('│', $color) . "\n";
$text .= colored(q{ │}, $color) . $info[7] . colored('│', $color) . "\n";
$text .= colored(q{ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
} elsif ($alice) {
$text .= colored(q{ ..-.. ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
$text .= colored(q{ (~ ~) │}, $color) . $info[0] . colored('│', $color) . "\n";
$text .= colored(q{ ( ) │}, $color) . $info[1] . colored('│', $color) . "\n";
$text .= colored(q{ ( ~~~~~~~ ) ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
$text .= colored(q{ ( | . . | ) ││}, $color) . $info[3] . colored('│', $color) . "\n";
$text .= colored(q{ ( | (_) | ) ││}, $color) . $info[4] . colored('│', $color) . "\n";
$text .= colored(q{ ( | | ) ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
$text .= colored(q{ (.,.,.| === |.,.,.) │}, $color) . $info[6] . colored('│', $color) . "\n";
$text .= colored(q{ '.___.' │}, $color) . $info[7] . colored('│', $color) . "\n";
$text .= colored(q{ / \ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
} elsif ($phb) {
$text .= colored(q{ @ @ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
$text .= colored(q{ @@ ..-.. @@ │}, $color) . $info[0] . colored('│', $color) . "\n";
$text .= colored(q{ @@@' _ _ '@@@ │}, $color) . $info[1] . colored('│', $color) . "\n";
$text .= colored(q{ @( . . )@ ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
$text .= colored(q{ | (_) | ││}, $color) . $info[3] . colored('│', $color) . "\n";
$text .= colored(q{ | _ | ││}, $color) . $info[4] . colored('│', $color) . "\n";
$text .= colored(q{ |_ _| ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
$text .= colored(q{ /|_'---'_|\ │}, $color) . $info[6] . colored('│', $color) . "\n";
$text .= colored(q{ / | '\_/' | \ │}, $color) . $info[7] . colored('│', $color) . "\n";
$text .= colored(q{/ | | | | \ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
} elsif ($asok) {
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
$text .= colored(q{ @@@@@@@@@ │}, $color) . $info[0] . colored('│', $color) . "\n";
$text .= colored(q{ | | │}, $color) . $info[1] . colored('│', $color) . "\n";
$text .= colored(q{ | _ _ | ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
$text .= colored(q{ Ͼ| ○ ○ |Ͽ ││}, $color) . $info[3] . colored('│', $color) . "\n";
$text .= colored(q{ | u | ││}, $color) . $info[4] . colored('│', $color) . "\n";
$text .= colored(q{ | --- | ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
$text .= colored(q{ / `-._.-´ \ │}, $color) . $info[6] . colored('│', $color) . "\n";
$text .= colored(q{ | │}, $color) . $info[7] . colored('│', $color) . "\n";
$text .= colored(q{ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
} else {
$text .= colored(q{ ╭} . '─' x ($length + $margin + $gap + 7) . '╮', $color) . "\n";
$text .= colored(q{ დოოოოოდ │}, $color) . $info[0] . colored('│', $color) . "\n";
$text .= colored(q{ | | │}, $color) . $info[1] . colored('│', $color) . "\n";
$text .= colored(q{ | | ╭│}, $color) . $info[2] . colored('│', $color) . "\n";
$text .= colored(q{ |-ᱛ ᱛ-| ││}, $color) . $info[3] . colored('│', $color) . "\n";
$text .= colored(q{ Ͼ Ͽ ││}, $color) . $info[4] . colored('│', $color) . "\n";
$text .= colored(q{ | | ╯│}, $color) . $info[5] . colored('│', $color) . "\n";
$text .= colored(q{ ˏ`-.ŏ.-´ˎ │}, $color) . $info[6] . colored('│', $color) . "\n";
$text .= colored(q{ @ │}, $color) . $info[7] . colored('│', $color) . "\n";
$text .= colored(q{ @ ╰} . '─' x ($length + $margin + $gap + 7) . '╯', $color) . "\n";
}
$text .= "\n";
print $text;
}
sub print_help {
print "usage: fm6000 [options]\n\n";
print "-c, --color=STR Base color\n";
print "-w, --wally Display Wally \n";
print "-dog, --dogbert Display Dogbert \n";
print "-al, --alice Display Alice \n";
print "-phb, --phb Display Pointy haired Boss \n";
print "-as, --asok Display Asok \n";
print "-r, --random Display Random Art \n";
print "-n, --not_de To use 'WM' instead of 'DE'\n";
print "-o, --os=STR OS name\n";
print "-k or --kernel=STR Kernel version\n";
print "-de or --de=STR Desktop environment name\n";
print "-s or --shell=STR Shell name\n";
print "-u or --uptime=STR Uptime\n";
print "-pa or --package=INT Number of packages\n";
print "-v or --vnstat=STR Use vnstat instead of kernel\n";
print "-m or --margin=INT Spaces on the left side of info\n";
print "-g or --gap=INT Spaces between info and info_value\n";
print "-l or --length=INT Length of the board ( > 14)\n\n";
print "available colors: \n";
print join(", ", splice(@colors, 0, 7)) . ", random\n";
print join(", ", @colors) . "\n";
}
main();

View file

@ -1,14 +0,0 @@
#!/bin/bash
eval $(xdotool getmouselocation --shell)
if [ "$1" -eq "1" ]; then
xdotool mousemove 900 $Y
elif [ "$1" -eq "2" ]; then
xdotool mousemove 2560 $Y
elif [ "$1" -eq "3" ]; then
if [ $Y -gt 700 ]; then
Y=700
fi
xdotool mousemove 4000 $Y
fi

View file

@ -1,2 +0,0 @@
#!/bin/sh
notify-send "$(playerctl metadata xesam:title)"

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
ww -fa firefox -c firefox

View file

@ -1,4 +0,0 @@
const clients = workspace.clientList();
for (var i = 0; i < clients.length; i++) {
print(clients[i].caption);
};

View file

@ -1,37 +0,0 @@
#!/usr/bin/env python
# Author: Andrew Shark
# This script lists windows in kwin on wayland. It is useful, because wmctrl does not work on wayland.
# I read journalctl because printing in kwin script is currently broken. See https://bugs.kde.org/show_bug.cgi?id=445058
# https://unix.stackexchange.com/questions/706477/is-there-a-way-to-get-list-of-windows-on-kde-wayland - described this script here.
import subprocess
from datetime import datetime
def get_list_of_windows():
datetime_now = datetime.now()
script = "/home/chris/.dotfiles/scripts/kde-list-windows.js"
reg_script_number = subprocess.run("dbus-send --print-reply --dest=org.kde.KWin \
/Scripting org.kde.kwin.Scripting.loadScript \
string:" + script + " | awk 'END {print $2}'",
capture_output=True, shell=True).stdout.decode().split("\n")[0]
subprocess.run("dbus-send --print-reply --dest=org.kde.KWin /" + reg_script_number + " org.kde.kwin.Script.run",
shell=True, stdout=subprocess.DEVNULL)
subprocess.run("dbus-send --print-reply --dest=org.kde.KWin /" + reg_script_number + " org.kde.kwin.Script.stop",
shell=True, stdout=subprocess.DEVNULL) # unregister number
since = str(datetime_now)
msg = subprocess.run("journalctl _COMM=kwin_wayland -o cat --since \"" + since + "\"",
capture_output=True, shell=True).stdout.decode().rstrip().split("\n")
msg = [el.lstrip("js: ") for el in msg]
return msg
print('\n'.join(get_list_of_windows()))

View file

@ -1,36 +0,0 @@
#!/bin/sh
# Check to see if an kdenlive is running
if [ $(pgrep -c kdenlive) -gt 0 ]; then
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
#X11
kdenliverg=$(wmctrl -lx | rg kdenlive.kdenlive | rg -v org-agenda | awk '{print $1}')
# echo $kdenliverg
if [ -z $kdenliverg ]; then
exec kdenlive &
exit
else
exec wmctrl -ia $kdenliverg
exit
fi
else
if [ "$KDE_FULL_SESSION" = "true" ]; then
exec /home/chris/bin/ww -fa Kdenlive -c kdenlive
exit
else
# WAYLAND
# kdenliverg=$(wlrctl window list | rg -v 'kdenlive:\sorg-agenda' | rg 'kdenlive:')
# kdenlivewin=$(echo $kdenliverg | sed 's/.*\: //')
# echo $kdenlivewin
exec hyprctl dispatch focuswindow kdenlive
exit
fi
fi
else
exec kdenlive &
fi

View file

@ -1,100 +0,0 @@
#!/usr/bin/env bash
# Very basic interface for rbw using rofi
if [ $(hostname) = "syl" ]; then
if [ $XDG_SESSION_TYPE = "x11" ]; then
style="laptop-rbw"
echo "this is x11"
else
style="laptop-wayland"
echo "this is wayland"
fi
else
style="desktop-rbw"
#echo "this is not hidpi"
fi
export YDOTOOL_SOCKET=/tmp/ydotools
# Get all password files and create an array
root=~/.password-store
CACHE=~/.local/tmp/pass_wofi
seat=seat0
rbw sync
list_passwords() {
rbw list
}
passwords=$list_passwords
prompt='BW'
if [ $XDG_SESSION_TYPE = "x11" ]; then
SECRET=$(list_passwords | wofi -i --prompt="${prompt}" --dmenu --cache-file ${CACHE}
# $@ &
# c=0
# while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
# sleep .1
# c=$((c+1))
# [[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
# done
)
else
SECRET=$(list_passwords | wofi -i --prompt="${prompt}" --dmenu --cache-file ${CACHE})
fi
# Ask whether pass, user or both are required
options=("Password" \
"User" \
"User and password" \
"QR-Code" \
"OTP")
if [ $XDG_SESSION_TYPE = "x11" ]; then
option=$(printf '%s\n' "${options[@]%}" | wofi -i --dmenu --width 400 --prompt="..." --cache-file /dev/null
# $@ &
# c=0
# while ! xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id $(xdotool search -class 'rofi') ; do
# sleep .1
# c=$((c+1))
# [[ c = 50 ]] && exit; # stop script window didn't appear after 5 seconds
# done
)
else
option=$(printf '%s\n' "${options[@]%}" | wofi -i --dmenu --width 400 --lines 8 --prompt="..." --cache-file /dev/null)
fi
# echo $option
case ${option} in
Password )
echo "${SECRET}"
ydotool type --key-delay 0ms $(rbw get "${SECRET}")
;;
User )
echo "$(rbw get --full "${SECRET}" | rg Username: | awk '{print $2}')"
ydotool type --key-delay 0ms "$(rbw get --full "${SECRET}" | rg Username: | awk '{print $2}')"
;;
"User and password" )
ydotool type --key-delay 0ms $(rbw get --full "${SECRET}" | rg Username: | awk '{print $2}')
ydotool key 15:1 15:0
ydotool type --key-delay 0ms $(rbw get "${SECRET}")
;;
"QR-Code" )
if [[ $SECRET =~ wifi$ ]]; then
# Produce a valid wifi QR-code
WIFISSID=$(pass get_user "${SECRET}")
WIFIPASS=$(pass get_pass "${SECRET}")
WIFIQR="WIFI:T:WPA;S:${WIFISSID};P:${WIFIPASS};;"
qrencode -s 8 -o - $WIFIQR | feh --title "pass: QR-WIFI" -
else
# Only password
pass show -q1 ${SECRET}
fi
;;
OTP )
ydotool type --key-delay 0ms $(rbw code "${SECRET}")
;;
esac
# wl-copy -o -s ${seat} ${PASSWD_PASS}

View file

@ -1,18 +0,0 @@
#!/usr/bin/env bash
script="/home/chris/.dotfiles/scripts/kde-list-windows.js"
num=$(dbus-send --print-reply --dest=org.kde.KWin \
/Scripting org.kde.kwin.Scripting.loadScript \
string:"$script" | awk 'END {print $2}' )
echo $num
wins=$(dbus-send --print-reply --dest=org.kde.KWin /$num \
org.kde.kwin.Script.run | sed 's/p/p/')
echo $wins
# I'm not sure if some delay is in order here to let your script complete?
sleep 1
dbus-send --print-reply --dest=org.kde.KWin /$num \
org.kde.kwin.Script.stop

View file

@ -1,7 +0,0 @@
#!/bin/fish
#detect whether running on laptop or not
if hostname = "syl"
echo true
else
echo false

View file

@ -1,4 +0,0 @@
#!/bin/sh
killall mako
killall latte-dock
latte-dock &

View file

@ -1,2 +0,0 @@
#!/bin/sh
libinput-gestures &

View file

@ -1,5 +0,0 @@
#!/bin/sh
awesome-client "naughty.destroy_all_notifications()"
notify-send "$(light -G)" --icon=display-brightness

View file

@ -1,6 +0,0 @@
#!/bin/sh
export LD_LIBRARY_PATH=$LIBRARY_PATH
RUNNER=$(find ~/.guix-profile/lib/ -name 'ld-linux-*.so*')
$RUNNER "$@"

View file

@ -1,27 +0,0 @@
#!/usr/bin/env -S sbcl --script
(require "uiop")
(load "/home/chris/.sbclrc")
(ql:quickload :serapeum)
(defvar *url* (car (uiop:command-line-arguments)))
;; (uiop:println *url*)
;; (uiop:println (type-of *url*))
(defun main ()
(if (serapeum:string-contains-p "inv.cochrun.xyz" *url*)
(run-program "mpv"
`("--ontop"
"--keepaspect-window"
,(serapeum:string-replace-all
"inv.cochrun.xyz" *url* "youtube.com"))
:search "/run/current-system/sw/bin/"
:output t)
(run-program "mpv"
`("--ontop"
"--keepaspect-window"
,(string *url*))
:search "/run/current-system/sw/bin/"
:output t)))
(main)

View file

@ -1,16 +0,0 @@
#!/bin/bash
ID=$1
while true
do
COMMAND="emacsclient -c -e (mu4e)"
muunread="$(mu find flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" | wc -l)"
DATA="| A |  $muunread | |$COMMAND |"
qdbus org.kde.plasma.doityourselfbar /id_$ID \
org.kde.plasma.doityourselfbar.pass "$DATA"
sleep 60s
done

View file

@ -1,6 +0,0 @@
#!/usr/bin/env sh
muunread="$(mu find flag:unread AND NOT flag:trashed AND NOT maildir:\"/outlook/Junk\" AND NOT maildir:\"/office/Junk Email\" AND NOT maildir:\"/outlook/Deleted\" AND NOT maildir:\"/office/Deleted Items\" AND NOT maildir:\"/office/Archive\" AND NOT maildir:\"/outlook/Archive\" AND NOT maildir:\"/cochrun/Archive\" | wc -l)"
# echo " $muunread "
echo "$muunread | color=#f3f99d font='VictorMono Nerd Font' size=11 iconname=mail-message"
# echo " $muunread | color=#AF8700 font='VictorMono Nerd Font' size=11"

View file

@ -1,37 +0,0 @@
#!/usr/bin/env bash
# Check to see if nyxt is running
if [ $(pgrep -c nyxt) -gt 0 ]; then
echo "ff running"
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
#X11
ffrg=$(wmctrl -lx | rg nyxt | awk '{print $1}')
# echo $emacsrg
if [ -z $ffrg ]; then
exec nyxt
exit
else
exec wmctrl -ia $ffrg
exit
fi
else
if [ "$KDE_FULL_SESSION" = "true" ]; then
echo "KDE"
exec /home/chris/bin/ww -fa nyxt -c nyxt
exit
else
# WAYLAND
ffrg=$(hyprctl clients | rg nyxt)
ffwin=$(echo $ffrg | sed 's/.*\: //')
# echo $ffwin
exec hyprctl dispatch focuswindow nyxt
exit
fi
fi
else
exec nyxt
fi