Skip to content

Instantly share code, notes, and snippets.

@connorfuhrman
connorfuhrman / .screenrc
Last active January 23, 2025 20:17
GNU Screen Configuration
# Session directory
sessiondir ~/.screen
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 50000
@connorfuhrman
connorfuhrman / update_shell_prompt.bash
Created September 16, 2022 16:11
Function to set a nice shell prompt with Pyenv and ROS shown along with a nicely trimmed current working directory
#!/bin/bash
## Prompt setup
update_shell_prompt() {
RED='\[\e[0;31m\]'
GREEN='\[\e[0;32m\]'
BLUE='\[\e[0;34m\]'
PURPLE='\[\e[0;35m\]'
RESET='\[\e[0m\]'
@connorfuhrman
connorfuhrman / prompt_dir.c
Created September 16, 2022 16:09
C code for a nicely trimmed working directory string to be used in shell prompt
// Program to display the current working directory but ensure that the string
// does not take up more than half of the current terminal window size
//
// Compile as gcc prompt_dir.c -o prompt_dir_str -Wall -Wextra -pedantic -std=c11 -ltermcap -O3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>