Jump to content
Read the Funtoo Newsletter: Summer 2023 ×

Search the Community

Showing results for tags 'shell'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Funtoo Discussion Forums
    • News and Announcements
    • General Discussion
    • Dev Central
    • Funtoo Hosting
    • Funtoo Infrastructure
  • Help Central
    • General Help
    • Installation Help
    • Portage Help
    • Desktop Help
    • Server Help
  • Funtoo Services

Blogs

  • drobbins' Blog
  • It's a Bear's life
  • haxmeister's Blog
  • psychopatch's Blog
  • 666threesixes666's Blog
  • decision theory
  • Chris Kurlinski's Blog
  • Sandro's Blog
  • danielv's Blog
  • Not So Stupid Admin Tricks
  • maldoror's Blog
  • andreawilson's Blog
  • Simple Step-by-Step Server Setup
  • saraedward's Blog
  • eusanpe
  • Funtoo Newsletter

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


freenode


github


web


First Name


Last Name


Location


Interests

Found 1 result

  1. Ever need to know when a long emerge or some other command was finally finished after you went off and started something else? Well, here is a script you can add to your .bashrc (or source it from your .bashrc) to do exactly that. Due to some odd race behavior, it will be inactive until you use ls, cd, or n (n just activates it). This was necessary because your .bashrc finishes running before the terminal window actually displays on screen. If you use session management and your shell moves from one GUI window to another, the ls, cd, or n commands all ensure that the correct window is watched. It only notifies if the shell window isn't on top. # #- This is to display notifications when you aren't watching the window # export DISPLAY=":0" alias ls='LC_XWINDOWID=`xdotool getactivewindow`; ls --color=auto' alias cd='LC_XWINDOWID=`xdotool getactivewindow`; cd' alias n='LC_XWINDOWID=`xdotool getactivewindow`' sendNotify() { LC_TASK=$(history 1 | cut -c 8-) LC_NAME=$(xdotool getwindowname $LC_XWINDOWID) LC_ICON="$LC_NAME" #- fix up name to icon mapping case $LC_NAME in Terminal) LC_ICON="gnome-terminal" ;; esac notify-send -i "$LC_ICON" "Task Complete in $LC_NAME" "$LC_TASK" } testWindow() { if [ -z "$LC_XWINDOWID" ]; then return 0; fi if [ "$(xdotool getactivewindow)" != "$LC_XWINDOWID" ]; then sendNotify fi } PROMPT_COMMAND="testWindow" FYI - you can add -t 10000 to the notify-send line to keep the notification up for a much longer duration (or an even greater value). You can always close the notification manually. So .. however long you want the timeout if the default isn't enough. Enjoy!
×
×
  • Create New...