Posts Tagged ‘change’

Change grub default boot option on Linux Ubuntu/Mint

Wednesday, April 25, 2012 posted by CSch

Grub's default boot option is stored within a config file found on the partition where your Master Boot Record is located (if you had it installed previously, there may also be grub.cfg files on other partitions, but these won't effect boot sequence). Its direct path is /boot/grub/grub.cfg and it has to be opened as root, so enter following into a terminal:

sudo gedit /boot/grub/grub.cfg

The important parts of the file is the line saying set default="0" and the blocks beginning with menuentry:

[...]
menuentry 'Linux Mint 12 64-bit, 3.0.0-12-generic (/dev/sda5)' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 7df91f6c-5351-4336-a3c5-eac1cf58efca
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=7df91f6c-5351-4336-a3c5-eac1cf58efca ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic
}
[...]

These blocks are the entries that are displayed in the boot menu - they are indexed from 0 to n-1, n being the number of entries. To set the default entry, take its index and enter it into the set default="0" line, replacing 0 with the desired index. Afterwards save the file.

Windows 7 comes with the Aero skin by default which might look nice but consumes a great deal of resources - and with them, power. I have experienced a loss of up to two hours of battery life on my notebook when turning Aero on which one can get back by switching to the classic skin - that ugly gray one, that was used in the times before Windows XP.

It would be great if Windows provided an option to set a scheduled task to trigger on plugging or unplugging the power supply or to configure the power settings to change themes automatically but unfortunately we don't have that luxury, so we have to do it ourselves, in a slightly less elegant way.

What you need is a small VBScript which you can find here and a PowerShell script which checks in what state the notebook battery is in. To create that script, open a new notepad and paste the following into it:

$sav = (Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus
while ($true)
{
start-sleep -s 5
if (((Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus -eq (1 -or 3 -or 4 -or 5 -or 10 -or 11)) -and ((Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus -ne $sav))
{
& 'C:\Windows\Resources\Ease of Access Themes\Classic.theme'
$sav = (Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus
}
else
{
if ((Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus -ne $sav)
{
& 'C:\Windows\Resources\Themes\Aero.theme'
$sav = (Get-WmiObject -Class Win32_Battery -ea 0).BatteryStatus
}}}

Adjust the paths printed bold to the location of the themes you want to use if you want different ones (the first one is the one that is applied on unplugging the supply, second is for replugging). Save the script as a .ps1 file. If you haven't yet created the VBScript, do it now following the above link. Remember to adjust the path to the ps1 script used there to yours. If you now launch the VBScript the PowerShell script should be started silently. If you get an error or the script won't start, you first have to configure your system to allow executing PowerShell scripts - see the instructions below the code provided here.

The locations of the themes are
C:\Windows\Resources\Ease of Access Themes for the classic styled themes.
C:\Windows\Resources\Themes for preconfigured Aero style themes and
C:\Users\[YourUsername]\AppData\Local\Microsoft\Windows\Themes for custom themes (the AppData folder is hidden by default).

To automate everything you can set the execution of your VBScript as a scheduled task. Do so by entering Task Scheduler into your Start-menu search bar. Set up the task for execution on start up if you want it to be run on every session.

The weather app in Windows 8 comes with degree Fahrenheit as its default unit for temperature and its a bit tricky to find out how to change that. To do so, open the weather app and fade in the Charms menu (point your cursor to the top or bottom right corner and slide towards the appearing icons). There, choose Settings. Unlike if you open the settings on the main Metro menu this will open the weather settings where you click on Settings again:

There you have the option to change the temperature unit from Fahrenheit to Celsius or back if you wish to:

Reset account password (Ubuntu Linux) without CD

Thursday, March 29, 2012 posted by CSch

Resetting an account password on Ubuntu Linux is unexpectedly easy to do, you don't even need any tools or anything for it. To start, go into the GRUB menu by pressing Shift while booting. In the menu, enter the Recovery Mode option:

You will be presented a window with quite a few options of which the root command line is what we want. Go down to the menu item named root and hit Enter.

If the command line opens without problems, proceed with the following command (if it prompts you for a root password which you don't have, see here):

mount -o remount,rw /

passwd [your_user_name]

Replace [your_user_name] with the name of the user you want to change the password of. Enter and confirm a new password on the next prompts and reboot your computer afterwards.

How To Customize Basic Cinnamon Elements

Friday, February 24, 2012 posted by CSch

Though Cinnamon comes with a settings tool you can not yet customize it to the fullest. This is because it still is under heavy development and it is even not yet recommended to create super-creative themes, since it is likely that functions will be altered or added in the near future.

Nevertheless I have searched the cinnamon.css file (the file that is responsible for most stylistic issues of cinnamon) of the current version 1.3.1 for the classes that have to be altered to change the basic interface elements, the panel and the menu. The file you need is /usr/share/cinnamon/theme/cinnamon.css. Color values are given in hexadecimal codes (e.g. #FF0000) or in RGB values plus transparency (e.g. (255,255,255,0.5). A color can easily be converted to the other format using graphical software such as Pinta - just use the software's color picker to choose a color and then copy and paste the code, or insert a code to get the other. If two colors are given in the form of a gradient, there is a color flow between the two given colors.

Note: Before you make any changes to your cinnamon.css, make sure you have made a backup copy and know how to use it without a proper user interface since one faulty character in the file could render cinnamon completely unable to start. The best way to save yourself then is to have another desktop such as GNOME 3 installed to be able to switch to it in worst case (use ctrl + alt + backspace to log out)

Note2: Changes only apply after restarting Cinnamon.

Panel:

  • To change the panel's color, search the file for the #panel class and change the background-color value.
  • To change the unfocused panel buttons' colors, search the file fo the .window-list-item-box class and edit the background-gradient-start and background-gradient-end values. Start marks the button's top where end marks the button's bottom.
  • To change the focused panel buttons' colors, search the file fo the .window-list-item-box:focus class and edit the background-gradient-start and background-gradient-end values. Start marks the button's top where end marks the button's bottom.
  • To change the button border color of the two above possibilities, change the box-shadow value in the same classes.

Menu:

  • To change the menu's color, search for the .popup-menu-boxpointer class and edit the arrow-background-color value
  • To change the menu border's color, search for the arrow-background-color class and edit the arrow-border-color value
  • To change the category menu's selector box, search for the .menu-category-button-selected class and change the background-gradient-start and the background-gradient-end values
  • To change the application menu's selector box, search for the .menu-application-button-selected class and change the background-gradient-start and the background-gradient-end values
  • To change the application submenu's selection box color, search for the .popup-menu-item:active class and edit the background-color value
  • To change the border color of the two above possibilities, change the box-shadow value in the same classes.
  • To change the favorites menu's background color, search for the .menu-favorites-box class and edit the background-gradient-start and background-gradient-end values.
  • To change the favorites menu's border color, change the border value in the same class as above
  • To change the favorites menu's selection box color, search for the .menu-favorites-button:hover class and edit the background-gradient-start and background-gradient-end values.
  • To change the scrollbar handle's color, search for the StScrollBar StButton#vhandle class and change the background-color value
  • To change the scrollbar border's color, edit the border value in the same class as above

To change the menu's texts, there is usually a value called color inside the appropriate classes which handle the text color. Also, the other possibilities can easily be identified by the classes' and values' names.

Change Log-In Screen Background Image on Ubuntu Linux

Friday, February 17, 2012 posted by CSch

If you want to make your Ubuntu installation a little less purple and orange, but don't see a solution that covers the change of log-in screen background picture change, try Simple Lightdm Manager. It is a tool that lets you turn the log-in screen into any image you have on your computer. To install, open a terminal and enter the following commands (adding repository, updating sources, installation):

sudo apt-add-repository ppa:claudiocn/slm

sudo apt-get update

sudo apt-get install simple-lightdm-manager

Afterwards open SLM and browse for an image you want to use:

Additionally you can alter the logo that is displayed on the log-in screen's bottom left corner.
Be aware though, that this does not work with images which are located in encrypted file systems!

Change Drive Letter on Windows 7 to Resolve Conflicts

Wednesday, February 15, 2012 posted by CSch

By working with different drives it sometimes may occur that two drives are given the same drive letter - usually this is not the case but it may always happen due to bugs. It is also possible that a drive loses its letter "spontaneously". What results is that one or both of them is/are not shown on Computer anymore. To resolve this error, a new letter has to be assigned to the drive with the help of the Disk Management. Right-click Computer and choose Manage. On the left pane, select Storage > Disk Management and you will see the connected drives listed in the main screen.

To change or assign a drive letter, right-click target drive and select Change Drive Letter and Paths.... On the window that pops up choose Add... or Change.... Afterwards select a new drive letter from the drop-down menu:

Remember that you choose a letter that is not already used by another drive - to ensure that, choose one on the end of the alphabet. Your computer won't have had the chance to fill all the letters up to there already. Usually it should not be possible to choose a letter that is already in use anyway, but it is good to always double-check things like these if the above error should occur.

Change System Sounds on Windows 7 (Including Startup)

Tuesday, February 7, 2012 posted by CSch

This article will deal with two aspects: handling the regular sounds which are accessible in Control Panel as well as changing the system startup sound, which is hidden inside a .dll file and quite tricky to get at.
The regular sounds can be accessed by entering the Control Panel and browsing to Control Panel\Hardware and Sound\Sounds\Change system sounds. A window with selectible sound schemes will open where you can either select a premade scheme or browse your files to choose other .wav files and save a custom scheme. The checkbox below the list already indicates that you will not find the Startup sound in it - you will need third party software for that.

The reason for this requirement is that the startup sound isn't configurable by "normal" means - it is hidden inside a .dll file, C:\Windows\System32\imageres.dll. Before you make any changes to it, make a backup-copy of it to some safe place and also one on your desktop to work with. Afterwards, download a resource hacker - these tools are used to access the data inside .dll files which can be sound files as well as icons and other things. I prefer ResEdit since it does not need an installation. You can download it here:

http://www.resedit.net/

In ResEdit, open the copy of imageres.dll you saved to your desktop.

On the left Resources column, find the "WAVE" entry - there is exactly one file in there, which has different names depending on your system language - I'm using American English, which is why it's called 5080 here (replace any occurance of that number here with the one you have for your language). To be able to import your own sound, it also must be in the .wav format and must be called the same as the file you just found.
Now delete the 5080 entry in ResEdit - right-click it and choose Remove from project. Then right-click on some empty space in the Resource column and select Add Resource... > User Definded. A window pops up - select Name identifier and type in WAVE. Now browse the sound file you want to configure as startup sound and hit Open (I don't know the maximum size of the file you can use, you might try to keep it as small as possible - it worked for me with a file size of ~90kb, others have reported more). It will have the wrong name and language defined after you import it, so you have to change that: Right-click the entry and select Rename. Leave the Ordinal identifier checked and enter 5080 into the identifier box, then select the correct language for you (Englisch (United States) if you had 5080) and hit OK. Afterwards save the file in ResEdit.

Now comes the tricky bit which is replacing the imageres.dll in your System32 folder with the one you edited. If you try to just do it, Windows will most likely hit you with the Permission-Denied-club, no matter how many administrative rights you have got. People have reported that it worked for them in save mode. A save option however is to boot off a Linux Live CD (I used Linux Mint 12 Lisa) and replace the file in the Live environment.

Therefore, just download a CD image file from here or any other Linux distribution's homepage, burn it onto a bootable CD and boot from it.

You will boot into the Live environment, from which you can test and install Linux or if you need, fix stuff on your Windows installation. I will go on with the instructions assuming you chose Linux Mint 12 from the link I provided, if you chose differently you will likely know how to accomplish the next steps on your system.
To replace the file, hover your cursor to the top left corner of the screen - an overlay will pop up. Type in terminal and open the first object of the list appearing:

This is the command line and will be needed in a few moments. Hover to the top left corner again and click on the nautilus icon on the left to open a new file manager window:

On the appearing window, have a look at the left column - there are different (or only one) drives listed, you should be able to determine your Windows system drive by its size or contents. Click on it once to show them. What is important now is the value that is shown on the window decoration on top of the window, circled in red here:

You basically need only the first few characters. Now go back to the terminal you opened and enter

sudo su -

to grant yourself administrative rights. Next, you do the copying. For that, use the following command. You can use the tab-key to autocomplete the path segments, so you don't have to write out the whole value from above. Replace my username with yours and weirdvalue with the drive's value:

cp -f /media/weirdvalue/Users/howtoforge/Desktop/imageres.dll /media/weirdvalue/Windows/System32

The file is now replaced and you can reboot, removing the CD when told to. If you encounter problems with the new imageres.dll, just repeat the process and copy the backup you made to the System32 folder instead.

Adjust Aero To Wallpaper Color on Windows 7

Friday, January 20, 2012 posted by CSch

There is a tool called <em>Aero Adjuster</em> that works as a tray-icon in the taskbar and changes the colors of your Windows 7 Aero theme every time you change your wallpaper. Furthermore you also have the option to change brightness and/or to invert the colors, ignore black, white and grey tones and to only choose a specific region of the wallpaper (e.g. Top right, Bottom left).

It works automatically but can also be applied manually after changing options.
Download Aero Adjuster here: http://samusaranfreak.deviantart.com/art/Aero-Adjuster-261383189