最後活躍 1790232580

Indonesian date time, synth-shell, custom LS_COLORS with vivid

dartokloning's Avatar dartokloning 已修改 1790232579. 還原成這個修訂版本

1 file changed, 12 insertions, 11 deletions

.bashrc

@@ -189,34 +189,35 @@ alias lsdir='ls -lahd --color=auto */'
189 189 alias treeall='tree -ugsh --du'
190 190
191 191 lssortsize() {
192 - local use_sudo=""
192 + local cmd=()
193 193 local dir="."
194 194
195 - if [[ "$1" == "sudo" ]]; then
196 - use_sudo="sudo"
195 + if [[ "$1" == "-s" || "$1" == "--sudo" ]]; then
196 + cmd=(sudo)
197 197 shift
198 198 fi
199 199
200 200 dir="${1:-.}"
201 201
202 - $use_sudo du -sh --apparent-size -- "$dir"/* 2>/dev/null | sort -hr
202 + "${cmd[@]}" du -sh --apparent-size -- "$dir"/* 2>/dev/null |
203 + sort -hr
203 204 }
204 205
205 206 newest() {
206 - local use_sudo=""
207 + local cmd=()
207 208 local dir="."
208 209
209 - if [[ "$1" == "sudo" ]]; then
210 - use_sudo="sudo"
210 + if [[ "$1" == "-s" || "$1" == "--sudo" ]]; then
211 + cmd=(sudo)
211 212 shift
212 213 fi
213 214
214 215 dir="${1:-.}"
215 216
216 - $use_sudo find "$dir" -type f \
217 - -printf '%T@ %TY-%Tm-%Td %TH:%TM %s bytes %p\n' 2>/dev/null \
218 - | sort -nr \
219 - | cut -d' ' -f2-
217 + "${cmd[@]}" find "$dir" -type f \
218 + -printf '%T@ %TY-%Tm-%Td %TH:%TM %s bytes %p\n' 2>/dev/null |
219 + sort -nr |
220 + cut -d' ' -f2-
220 221 }
221 222
222 223 # Alias definitions.

dartokloning's Avatar dartokloning 已修改 1790232280. 還原成這個修訂版本

1 file changed, 25 insertions, 9 deletions

.bashrc

@@ -182,23 +182,39 @@ alias lssortdate='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=ti
182 182 # Sort by modification time — oldest first
183 183 alias lssortold='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=time --reverse'
184 184
185 - # Sort by size — largest first
186 - lssortsize() {
187 - local dir="${1:-.}"
188 -
189 - du -sh --apparent-size -- "$dir"/* 2>/dev/null | sort -hr
190 - }
191 -
192 185 # Directory only
193 186 alias lsdir='ls -lahd --color=auto */'
194 187
195 188 # Tree with owner/group, human-readable size, and total size
196 189 alias treeall='tree -ugsh --du'
197 190
191 + lssortsize() {
192 + local use_sudo=""
193 + local dir="."
194 +
195 + if [[ "$1" == "sudo" ]]; then
196 + use_sudo="sudo"
197 + shift
198 + fi
199 +
200 + dir="${1:-.}"
201 +
202 + $use_sudo du -sh --apparent-size -- "$dir"/* 2>/dev/null | sort -hr
203 + }
204 +
198 205 newest() {
199 - local dir="${1:-.}"
206 + local use_sudo=""
207 + local dir="."
208 +
209 + if [[ "$1" == "sudo" ]]; then
210 + use_sudo="sudo"
211 + shift
212 + fi
213 +
214 + dir="${1:-.}"
200 215
201 - find "$dir" -type f -printf '%T@ %TY-%Tm-%Td %TH:%TM %s bytes %p\n' 2>/dev/null \
216 + $use_sudo find "$dir" -type f \
217 + -printf '%T@ %TY-%Tm-%Td %TH:%TM %s bytes %p\n' 2>/dev/null \
202 218 | sort -nr \
203 219 | cut -d' ' -f2-
204 220 }

dartokloning's Avatar dartokloning 已修改 1790231034. 還原成這個修訂版本

1 file changed, 5 insertions, 1 deletion

.bashrc

@@ -183,7 +183,11 @@ alias lssortdate='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=ti
183 183 alias lssortold='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=time --reverse'
184 184
185 185 # Sort by size — largest first
186 - alias lssortsize='du -sh --apparent-size -- * 2>/dev/null | sort -hr'
186 + lssortsize() {
187 + local dir="${1:-.}"
188 +
189 + du -sh --apparent-size -- "$dir"/* 2>/dev/null | sort -hr
190 + }
187 191
188 192 # Directory only
189 193 alias lsdir='ls -lahd --color=auto */'

dartokloning's Avatar dartokloning 已修改 1790230886. 還原成這個修訂版本

1 file changed, 9 insertions, 1 deletion

.bashrc

@@ -183,7 +183,7 @@ alias lssortdate='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=ti
183 183 alias lssortold='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=time --reverse'
184 184
185 185 # Sort by size — largest first
186 - alias lssortsize='ls -lah --color=auto --sort=size'
186 + alias lssortsize='du -sh --apparent-size -- * 2>/dev/null | sort -hr'
187 187
188 188 # Directory only
189 189 alias lsdir='ls -lahd --color=auto */'
@@ -191,6 +191,14 @@ alias lsdir='ls -lahd --color=auto */'
191 191 # Tree with owner/group, human-readable size, and total size
192 192 alias treeall='tree -ugsh --du'
193 193
194 + newest() {
195 + local dir="${1:-.}"
196 +
197 + find "$dir" -type f -printf '%T@ %TY-%Tm-%Td %TH:%TM %s bytes %p\n' 2>/dev/null \
198 + | sort -nr \
199 + | cut -d' ' -f2-
200 + }
201 +
194 202 # Alias definitions.
195 203 # You may want to put all your additions into a separate file like
196 204 # ~/.bash_aliases, instead of adding them here directly.

dartokloning's Avatar dartokloning 已修改 1790230302. 還原成這個修訂版本

1 file changed, 18 insertions, 2 deletions

.bashrc

@@ -172,8 +172,24 @@ fi
172 172 #alias la='ls -A'
173 173 #alias l='ls -CF'
174 174 alias sudo="sudo "
175 - alias ls="ls -lah --color=auto --time-style="+%B %d, %Y %H:%M""
176 - alias treeall="tree -ugsh --du"
175 +
176 + # Standard listing
177 + alias ls='ls -lah --color=auto'
178 +
179 + # Sort by modification time — newest first
180 + alias lssortdate='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=time'
181 +
182 + # Sort by modification time — oldest first
183 + alias lssortold='ls -lah --color=auto --time-style="+%B %d, %Y %H:%M" --sort=time --reverse'
184 +
185 + # Sort by size — largest first
186 + alias lssortsize='ls -lah --color=auto --sort=size'
187 +
188 + # Directory only
189 + alias lsdir='ls -lahd --color=auto */'
190 +
191 + # Tree with owner/group, human-readable size, and total size
192 + alias treeall='tree -ugsh --du'
177 193
178 194 # Alias definitions.
179 195 # You may want to put all your additions into a separate file like

dartokloning's Avatar dartokloning 已修改 1790229881. 還原成這個修訂版本

1 file changed, 1 insertion, 1 deletion

.bashrc

@@ -172,7 +172,7 @@ fi
172 172 #alias la='ls -A'
173 173 #alias l='ls -CF'
174 174 alias sudo="sudo "
175 - alias ls="ls -lah --color=auto"
175 + alias ls="ls -lah --color=auto --time-style="+%B %d, %Y %H:%M""
176 176 alias treeall="tree -ugsh --du"
177 177
178 178 # Alias definitions.

dartokloning's Avatar dartokloning 已修改 1787970718. 還原成這個修訂版本

1 file changed, 1 insertion, 1 deletion

.bashrc

@@ -197,7 +197,7 @@ fi
197 197
198 198 ##-----------------------------------------------------
199 199 ## synth-shell-prompt.sh
200 - if [ -f /etc/shell-prompt.sh ] && source /etc/shell-prompt.sh
200 + [ -f /etc/shell-prompt.sh ] && source /etc/shell-prompt.sh
201 201
202 202 #export LS_COLORS="$(vivid generate snazzy)"
203 203

dartokloning's Avatar dartokloning 已修改 1787970160. 還原成這個修訂版本

1 file changed, 5 insertions, 23 deletions

.bashrc

@@ -197,14 +197,8 @@ fi
197 197
198 198 ##-----------------------------------------------------
199 199 ## synth-shell-prompt.sh
200 - if [ -f /etc/shell-prompt.sh ] && [ -n "$( echo $- | grep i )" ]; then
201 - source /etc/shell-prompt.sh
202 - else
203 - wget https://gist.darto.id/dartokloning/def50cb1b3024c3b8683960c873caf34/download/HEAD/shell-prompt.sh -P /home/$USER/.config
204 - source /etc/shell-prompt.sh
205 - fi
200 + if [ -f /etc/shell-prompt.sh ] && source /etc/shell-prompt.sh
206 201
207 - if [ -f /usr/bin/vivid ]; then
208 202 #export LS_COLORS="$(vivid generate snazzy)"
209 203
210 204 ##---------------------------------------------------------
@@ -226,21 +220,9 @@ theme_now=${themes[$random_index]}
226 220
227 221 export LS_COLORS="$(vivid generate $theme_now)"
228 222
229 - else
230 -
231 - wget https://github.com/sharkdp/vivid/releases/download/v0.11.1/vivid_0.11.1_amd64.deb
232 - sudo dpkg -i vivid_0.11.1_amd64.deb
233 - rm vivid_0.11.1_amd64.deb
234 - source /home/$USER/.bashrc
235 223
236 - fi
224 + ##---------------------------------------------------------
225 + ## Fastfetch
226 + ##---------------------------------------------------------
237 227
238 - if command -v fastfetch >/dev/null 2>&1; then
239 - # echo "Command exists"
240 - fastfetch
241 - else
242 - # echo "Command not found"
243 - mkdir -p /home/$USER/.config/fastfetch
244 - wget -P /home/$USER/.config/fastfetch https://gist.darto.id/dartokloning/655822e458964d0a93085c205506443f/download/HEAD/config.jsonc
245 - sudo apt install -y fastfetch
246 - fi
228 + fastfetch --config /etc/fastfetch/config.jsonc

dartokloning's Avatar dartokloning 已修改 1787962222. 還原成這個修訂版本

1 file changed, 3 insertions, 3 deletions

.bashrc

@@ -197,11 +197,11 @@ fi
197 197
198 198 ##-----------------------------------------------------
199 199 ## synth-shell-prompt.sh
200 - if [ -f /home/$USER/.config/shell-prompt.sh ] && [ -n "$( echo $- | grep i )" ]; then
201 - source /home/$USER/.config/shell-prompt.sh
200 + if [ -f /etc/shell-prompt.sh ] && [ -n "$( echo $- | grep i )" ]; then
201 + source /etc/shell-prompt.sh
202 202 else
203 203 wget https://gist.darto.id/dartokloning/def50cb1b3024c3b8683960c873caf34/download/HEAD/shell-prompt.sh -P /home/$USER/.config
204 - source /home/$USER/.config/shell-prompt.sh
204 + source /etc/shell-prompt.sh
205 205 fi
206 206
207 207 if [ -f /usr/bin/vivid ]; then

dartokloning's Avatar dartokloning 已修改 1785825983. 還原成這個修訂版本

1 file changed, 5 insertions, 5 deletions

.bashrc

@@ -235,12 +235,12 @@ source /home/$USER/.bashrc
235 235
236 236 fi
237 237
238 - if command -v neowofetch >/dev/null 2>&1; then
238 + if command -v fastfetch >/dev/null 2>&1; then
239 239 # echo "Command exists"
240 - neowofetch
240 + fastfetch
241 241 else
242 242 # echo "Command not found"
243 - mkdir -p /home/$USER/.config/neowofetch
244 - wget -P /home/$USER/.config/neowofetch https://gist.darto.id/dartokloning/3282d7ef65f549d6a893501d509cfbeb/download/HEAD/config.conf
245 - sudo apt install -y neowofetch
243 + mkdir -p /home/$USER/.config/fastfetch
244 + wget -P /home/$USER/.config/fastfetch https://gist.darto.id/dartokloning/655822e458964d0a93085c205506443f/download/HEAD/config.jsonc
245 + sudo apt install -y fastfetch
246 246 fi
上一頁 下一頁