Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo linux

Append suffix in linux file names with Shell Parameter Expansion

Well, everytime I read about shell (bash) parameter expansion I see examples ripping off the suffixes. But someday, I needed to do the inverse: Append suffixes. How to do that? I've made a simple bash script to do so: #!/bin/bash for i in *; do  mv ${i} ${i}.sh; done exit 0 Using a for loop, I moved every file in the directory to the same name, with a ".sh" appended as suffix. Feel free to change the suffix you want. To revert: #!/bin/bash for i in *; do mv ${i} ${i/.sh/}; done exit 0 In this case, in every file of the directory, ".sh" will be substituted for nothing. It may cause some troubles. Let's suppose you have a dir, full of these files: 1.shellvpower 2.shellvpower 3.shellvpower 4.shellvpower They'll become: 1ellvpower 2ellvpower 3ellvpower 4ellvpower So, in a better way, to remove only the suffixes ".sh": for i in *; do  mv ${i} ${i%%\.sh}; done exit 0 Bonus: Append prefixes: To append,...

Ultimate Guide for good Looking Fonts on Opensuse (13.2) - without Infinality

Well, as I'm using opensuse 13.2 as OS in one of my disks, let's see how we can improve the look of its horrible fonts. First: Yast2>/etc/sysconfig editor>Desktop, as seen below:  Play with font configs in each field. Mine I set as below: FORCE_HINTSTYLE: hintfull FORCE_AUTOHINT: yes FORCE_BW: no FORCE_BW_MONOSPACE: no USE_LCDFILTER: lcddefault USE_RGBA: rgb These settings will make the links on /etc/fonts/conf.d, disabled by default on opensuse. Other way to make this, as root: cd /etc/fonts/conf.d/ ln -s /usr/share/fontconfig/conf.avail/10-autohint.conf ln -s /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf Make a file named user.js in  $HOME/.mozilla/firefox/*.default/ with this content: user_pref("font.FreeType2.enable", "true"); user_pref("font.FreeType2.autohinted", "true"); user_pref("font.FreeType2.printing", "true...

Adding sound to LXDE start

Simple. Make a .desktop file and put it in ~/.config/autostart (if this dir doesn't exist, then create it): # mkdir ~/.config/autostart #touch ~/.config/autostart/sound.desktop As you see, my file's named sound.desktop Which contents may be: [Desktop Entry] Name=Sound Terminal=true Type=Application Exec=mplayer /home/pibarnas/Downloads/221359__melliug__newmessage.mp3 I've downloaded mine from freesound.org. There's a lot of sounds there. Enjoy!

Shutting down or restarting using openbox (with chroot)

First, your user must be allowed to shut down the system. Do it editing /etc/sudoers (a glance at man should help). We don't focus the edition of sudoers here. Then, add to you rc.xml (making backup of it first, always): <keybind key="C-A-Delete" chroot="true">       <keybind key="r">         <action name="Execute">           <prompt>Reiniciar o sistema?</prompt>           <execute>reboot</execute>         </action>       </keybind>       <keybind key="x">         <action name="Execute">           <prompt>Desligar o sistema?</prompt>           <execute>poweroff</execute>         </action>       </keybind>     ...

Aero Snap in Openbox (with or without chroot)

There's quite some time I've been searching on how to do that and I finally found it. First, backup your $HOME/openbox/rc.xml. Then, insert these lines in your rc.xml in keyboard section, before < /keyboard> ,  of course:  </keybind>     <keybind key="C-W-1">       <action name="UnmaximizeFull"/>       <action name="MaximizeVert"/>       <action name="MoveResizeTo">         <width>50%</width>       </action>       <action name="MoveToEdgeWest"/>     </keybind>     <keybind key="C-W-2">       <action name="UnmaximizeFull"/>       <action name="MaximizeVert"/>       <action name="MoveResizeTo">         <width>50%</width>       </action>   ...
Aqui está: Tá, eu confesso, o xcompmgr está ativo. Mas qual outro *box tem transparência real assim?

Openbox 3.5.0 com ícones no menu!! Finalmente!!

Ei-lo.