Linux Specific - FateSwap/Fates-Dots GitHub Wiki
Bash Scripting 
--This is the Bash section--
# Used to check if a PROGRAM is installed
if ! command -v PROGRAM 2>&1 >/dev/null
then
echo "PROGRAM could not be found or is not installed "
exit 1
fi
##
# Send command output to NULL aka no output
2>&1 >/dev/null # at the end of command
# Bash if statements | can be nested
if [ condition ]; then
command
else
command
fi
##
# Bash if directory exists
if [ -d /path/to/directory ]; then
echo "Directory exists."
else
echo "Directory doesn't exist."
fi
##
# Bash if directory doesnt exist
if [ ! -d /path/to/directory ]; then
echo "Directory doesn't exist."
else
echo "Directory exists."
fi
# More info available at https://linuxsimply.com/bash-scripting-tutorial/conditional-statements/if/check-if-directory-exists/
# Call one script from another
#!/usr/bin/env sh
# This just exists
echo "This is test 1"
# Figures out where the hell you are
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# Executes 2nd script
source $SCRIPT_DIR/test2.sh
## NEXT ##
Vim/Nvim 
--This is the Vin/Nvim section--
# Create file in vim :Ex (vim file explorer) | might be useable elsewhere
:!touch FILENAME
# File explorer
:Ex
# Edit between
ci' - change inside the single quotes
ci" - change inside the single quotes
ciw - change inside a word
ci( - change inside parentheses
# Command effects all lines
:%
# Copy to clipboard
:y+
# These can be combined | :%y+ = yank all to clipboard
# Add new line after pattern or symbol ( In this case its } )
:%s/}/\0\r/g
# TonyBanters repo for nvim binds
https://github.com/tonybanters/Nvim
## NEXT ##
Fish Shell 
--This is the Fish Shell section--
# Change theme using .theme file
fish_config theme save "THEMENAME"
## NEXT ##
Nix/Nixos 
--This is the Nix/Nixos section--
# Nix overrides for custom package source
environment.systemPackages = [
(pkgs.emacs.overrideAttrs (oldAttrs: {
name = "emacs-25.0-pre";
src = /path/to/my/emacs/tree;
}))
];
# This allows for custom packages versions | There should be way to have it pull from github for source
# Make Nix override global | any programs that depend on package will use custom instead
# From https://nlewo.github.io/nixos-manual-sphinx/configuration/customizing-packages.xml.html
## Copy below for gnome with gdm and less bloat
# GDM ( need for gnome lock screen
displayManager.gdm = {
enable = true;
wayland = true;
};
# Desktop Manager (contains desktop enviorments)
desktopManager = {
# Gnome with fixed scaling
gnome = {
enable = true;
extraGSettingsOverridePackages = [ pkgs.mutter ];
extraGSettingsOverrides = ''
[org.gnome.mutter]
experimental-features=['scale-monitor-framebuffer']
'';
};
};
## Put near end of nix conf preferably
# Gnome
environment.gnome.excludePackages = with pkgs; [
orca
# evince
# file-roller
geary
# gnome-disk-utility
# gnomeExtensions
# adwaita-icon-theme
# nixos-background-info
# gnome-backgrounds
# gnome-bluetooth
# gnome-color-manager
# gnome-control-center
# gnomeExtensions
gnome-tour # GNOME Shell detects the .desktop file on first log-in.
gnome-user-docs
# baobab
epiphany
# gnome-text-editor
gnome-calculator
gnome-calendar
gnome-characters
gnome-clocks
# gnome-console
gnome-contacts
# gnome-font-viewer
# gnome-logs
gnome-maps
gnome-music
# gnome-system-monitor
gnome-weather
# loupe
# nautilus
gnome-connections
simple-scan
snapshot
totem
yelp
gnome-software
];
# My extensions and extras
# Gnome Extras
gnome-tweaks
gnome-extension-manager
gnome-software # For flatpaks
gradience # Gnome adwaita theming
alacarte
nautilus-open-any-terminal
lm_sensors # For freon
# Gnome extensions
gnomeExtensions.desktop-cube
gnomeExtensions.logo-menu
gnomeExtensions.dash-to-dock
gnomeExtensions.compiz-windows-effect
gnomeExtensions.compiz-alike-magic-lamp-effect
gnomeExtensions.extension-list
gnomeExtensions.blur-my-shell
gnomeExtensions.freon
gnomeExtensions.impatience
gnomeExtensions.just-perfection
gnomeExtensions.media-controls
gnomeExtensions.top-bar-organizer
gnomeExtensions.appindicator
gnomeExtensions.user-avatar-in-quick-settings
## END OF GNOME ##
## Same shit above but for xfce ##
# Xfce
environment.xfce.excludePackages = with pkgs.xfce; [
mousepad
parole
ristretto
xfce4-appfinder
## xfce4-notifyd
## xfce4-screenshooter
## xfce4-session
## xfce4-settings
xfce4-taskmanager
xfce4-terminal
thunar
];